Archive for category CRM

Data Encryption Error in CRM


Recently when we were trying to update the user’s email address in CRM 2015 On Premise version we were getting the below error and we were not able to update even though the user with  which we were updating was having System Administrator and Customizer Security Roles. We were getting the below error

“There are encrypted fields in the organization database, but the data encryption feature isn’t activated. Contact your Microsoft Dynamic CRM system administrator to activate data encryption. To activate, go to Settings > Data Management > Data Encryption. For more information, see http://go.microsoft.com/fwlink/?LinkId=316366.”

After analyzing the issue, we figured it out that the error is coming since this environment was newly set up by taking a DB Backup from another CRM instance where data encryption was activated. We updated with the same key from the CRM instance from where we took this backup.

How & Where to copy the Key?

  1. Sign in to Microsoft Dynamics CRM as a user with the system administrator security role.
  2. Go to Settings > Data Management > Data Encryption.
  3. In the Data Encryption dialog box, select Show Encryption Key, in the Current encryption key box select the encryption key, and copy it to the clipboard.

In case your CRM is not configured for HTTPS then follow the below link http://www.crmphilly.com/crm-2013-data-encryption/

, , , ,

Leave a comment

Error while publishing entity in CRM 2011


I was getting the below error while  publishing a particular entity as System Admin  in CRM 2011, though was not getting the error for other entities . The error was

The Requested record was not found or you do not have sufficient permissions to view it.”

The details of the error are :

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: role With Id = 3adccc07-6293-4cac-b790-4be053184063 Does Not ExistDetail:
<OrganizationServiceFault xmlns:i=”http://www.w3.org/2001/XMLSchema-instance&#8221; xmlns=”http://schemas.microsoft.com/xrm/2011/Contracts”&gt;
<ErrorCode>-2147220969</ErrorCode>
<ErrorDetails xmlns:d2p1=”http://schemas.datacontract.org/2004/07/System.Collections.Generic&#8221; />
<Message>role With Id = 3adccc07-6293-4cac-b790-4be053184063 Does Not Exist</Message>
<Timestamp>2013-06-13T10:17:03.72479Z</Timestamp>
<InnerFault i:nil=”true” />
<TraceText i:nil=”true” />
</OrganizationServiceFault>

Resolution:

The below link helped me to solve the problem which was removing the extra form for this entity, I had 2 forms out of which one I was not using.

Though I do not fully agree on removing the extra form concept just to get rid of this problem,because this may not be the actual Problem but u know when something works for us we take it with both hands……

http://community.dynamics.com/crm/f/117/p/73740/135685.aspx#.Ubl_hflTDLM

 

 

 

,

Leave a comment

Exporting SSRS report to Word giving Error in CRM 2011


Recently in my Project I was getting a error for one of the report when I was trying to export to Word. Having not faced this issue before we started to hunt for the solutions. Then came to know that if the report is having more no of individual controls then while rendering that to word gives issues. To get rid of this you can group the controls in some other control(For Eg. Rectangle).

And here u go  …. your issue fixed ….

Below URL is a handy one  …

http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/14b0ff43-40b3-4132-9c63-b4731f62c48b

, ,

Leave a comment

By default all fields getting updated issue while using oData(REST) endpoint for Web Resources in Silverlight in CRM 2011


Recently I was facing a typical issue, while updating a couple of fields of a form using REST Endpoint in Silverlight, by default all the fields in the form was getting updated to null. I found this as very strange behavior by using REST in Silverlight.

In seek of answer I found that it was the default feature when you use REST Endpoint in Silverlight in CRM 2011.

The Below URL helped me lot which talks in very detailed manner the actual cause and Resolution.

http://blogs.msdn.com/b/crm/archive/2011/06/20/updating-records-using-the-rest-endpoint-for-web-resources-and-silverlight.aspx

Happy Reading …

, , , , ,

Leave a comment

Update Rollup 6 for Microsoft CRM 2011


Hey Guys, Microsoft has released Update Rollup 6 for CRM 2011 with many changes and fixes. You must have Microsoft Dynamics CRM 2011 build 5.0.9688.583 installed to apply this update rollup. You can get the latest Update Rollup 6 from

http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=28712

For the list of new improvements and changes you can go through the below KB article

http://support.microsoft.com/default.aspx?kbid=2600640

, , ,

2 Comments

Activity Feed in CRM 2011


Activity Feed is a very interesting features introduced in CRM 2011. But it has not become as famous as it should be and one of the most obvious reasons may be that still it has few Question (?) marks that needs to be answered or solved when it comes to security and usability in an efficient manner.

In my opinion still some of the features can be improved as of now in order to accept this globally. But still what we have is lot to cheer about. Why I am dough ting at this time I will clarify later in this post.

Let see how we can use this and take the most out of it.  You can get the Activity Feed solution from the Dynamic Marketplace in CRM Settings tab or you can just do Google. The CRM 2011 server setup that was released before Nov 2011 does not contain this solution. So you have to download and import it manually. But in all the latest CRM versions that are coming after Nov 2011 have this activity feed solution installed from before whether it is Online or On- Premise.

Let’s understand the common terms associated with this. We can say it can act as a Twitter for the CRM users plus lot of many other functions.

Post:

Post is an Entity and whatever you write is saved internally as a record. So every item on your wall is a post. It is yet like another entity. You can create new post through Plugin, workflow etc. You can even trigger anything on different operation performed. We will see how to create a post from workflow to meet our business need.

Wall:

Wall is nothing but the UI html page what we see where all the posts are visible. Records even can have wall and a tab ‘Record Wall’ can be seen for that record.

Follow/Unfollow:

Follow and Unfollow are the two options that will be visible for all entities but will be enabled for only those entities for which the activity feed will be configured.

Configuration of Activity Feed

After importing the solution you will find three links in what’s New in the Workplace Area and the other two as shown below

Let’s configure some entities. Click Activity Feed Configuration and create records for the entities which we want to configure. Remember give the schema name of entity and not the display name.

The interesting thing I found that we cannot define Rules for the entities. Because we cannot find any add New Rule or Existing button. However the system creates few rules for the few entities that exist from before like Lead, Opportunity, etc.

We can configure for custom entities also but cannot define rule directly which I found the funniest part. I hope that issue gets solved in the coming versions /updates. At present if we want to define some rules for custom entities than we can do that by configuring with a workflow.

For following a multiple records we can do Advance Find select the records to Follow or UnFollow.

Workflow to create a Rule and Post Automatically for Custom Entity

We will see how we can configure activity feed for a custom entity. This can be done through a workflow.  Let’s take a custom entity called “Investor”. So whenever investor is created by any user then we will post stating that an Investor is created. Let it act as a Notification. Let it as simple as this. Anyways we can do a lot and configure the workflow for our custom logic but here we are going through a sample.

        1. Create a Process of category as “Workflow” and configure for ‘When record is created’ as shown below

          2. Now we will configure the properties.

Here we can see the Dynamic value assigned called “Post URL (Dynamic)“. This option is only visible when we have the latest Update Rollup installed. This is basically used to provide a link to that record. So we can open that record by clicking this. This is a new feature update from Microsoft in CRM 2011. Really this is very helpful while creating email form the workflow. We can directly open the record from the Email.

Anyways configuring this workflow save and Activate this workflow.

Result: Now whenever the Investor record is created automatically a post will be created. We can see this post in the What’s new  in the Workplace Area. Here we have created investor record DTest10.

Note: Yet a lot of things are missing and I think that it needs to be improved a bit more so that it can be accepted widely. Few things that are strange or lack in the current version of the solution are in my opinion are:-

1. We cannot create Rules as per our choice for the entities. Eventually we opt for Workflows to configure. 

As we can see that there is no New Button to add any Rules.

2.  The post lacks security. This means that anybody who can view that post can delete that post which will be deleted from the system. This means that the person that created that post is not the sole owner of that post. Even we cannot set anything from the roles and permission point of view.

3. The system creates rules for some of the predefined entities like lead, contact, opportunity etc. We can’t add the rules to the entities configured and yet there is Grid where it can be added.

So these were my concerns in terms of usability. Hope this gets better in the coming versions or update.

 Happy Reading !!!!!!!


, , , , ,

5 Comments

SharePoint Integration with CRM 2011


CRM 2011 has introduced the concept of Document Management which is nothing but managing and keeping the document properly so that we can use of the documents in the most efficient manner. Integration with SharePoint was possible in the previous versions of CRM also but in 2011 things are really more efficient and organized. With the help of SharePoint we can avail and use most of the features of SharePoint in Microsoft CRM.

CRM 2011 can be integrated with both Sharepoint 2007 and 2010. But there are quite some difference visualization wise. If the CRM 2011 is integrated with 2007 we will be able to see the whole data in an IFrame, whereas with Sharepoint 2010 we have both the options i.e to see in an IFrame as well as properly organized documents list folder wise. We can create folders in Sharepoint with the CRM List Components in CRM 2011 which I will talk later.

CRM 2011 can be integrated with both On-Premise and Online and with the below versions

  • Microsoft SharePoint 2010 – almost all versions.
  • Microsoft Office SharePoint server 2007

CRM List Component

CRM List Component is a solution component that allows CRM to create folders automatically in Sharepoint and thus helping us to view the documents in the form of List in CRM. If it is not installed then the whole Sharepoint site will be visible in CRM in an IFrame. I strongly suggest to install the CRM List Component in order to get a good List View (Documents) in CRM.

You can download the CRM List Component from the below location

http://www.microsoft.com/download/en/details.aspx?id=5283

Now we will see how to integrate with Sharepoint with and without CRM List Component.

Integration of Sharepoint without CRM List Component

1. Go to Settings –>Document Management –>Document Management Settings

2. We can select the entities for which we want to enable the Document Management. By default some of the entities like Lead, Opportunity etc. will be selected. Provide the Sharepoint Site’s URL.

3. It will verify the Sharepoint Site and if everything is fine it will say that the URL is a valid one. Complete the configuration wizard.

4. Now we will configure for the lead entity. Open any Lead Record and Click on Documents.

5. After saving you can see the Sharepoint site in an IFrame as below.

Integration of Sharepoint with CRM List Component

With CRM List component we can see only the related documents in a list type and not the whole Sharepoint Site. Let’s see how we can install the list component in Sharepoint Server.

You can download as well as follow the instructions from the below URL.

http://www.microsoft.com/download/en/details.aspx?id=5283

After adding the solution component in the Sharepoint Server you should activate the solution.

Sometimes after installing the solution [CRM List Component] it gives a lot of pain while activating it. Because of my bad luck I went through the pain due to errors. If you are going through hard luck then you may get the error like ‘The sandboxed code execution request was refused because the Sandboxed Code Host Service was too busy to handle the request.’ Please follow the below link to solve the issue.

http://blogs.msdn.com/b/sharepointdev/archive/2011/02/08/error-the-sandboxed-code-execution-request-was-refused-because-the-sandboxed-code-host-service-was-too-busy-to-handle-the-request.aspx

Now after successfully activating go the CRM and try configuring this time. This time you will get a Window as below stating where the folders will be created.

After completing this wizard now if you will open any lead record and click on Documents then only the documents list will be visible and not the whole Sharepoint site.

I hope this really helps you. For more information related with Sharepoint Integration with CRM 2011 I found the below links very helpful.

http://msdn.microsoft.com/en-us/library/gg334702.aspx

http://msdn.microsoft.com/en-us/library/gg309548.aspx

Happy Reading!!!!!!!!!!!!!!!!!!

, , , ,

1 Comment

Retrieve Option Set Selected Text Value in CRM 2011


Retrieve Option Set Selected Text Value  in CRM 2011

In CRM 4.0 it was very easy to get the Picklist Selected Text value. But in CRM 2011 the Picklist has been changed to Option Set and interestingly they have not exposed any Property to get Text value of the selected value.

So now we can get the value only from the Metadata. It’s not huge but simple to implement. Below is the method which returns the Selected Text Value on Passing the Integer Value.

public string GetPickListText(string entityName, string attributeName,int optionSetValue,IOrganizationService service)
 {
    string AttributeName = attributeName;
    string EntityLogicalName = entityName;
RetrieveEntityRequest retrieveDetails = new RetrieveEntityRequest
 {
    EntityFilters = EntityFilters.All,
    LogicalName = EntityLogicalName
 };
 RetrieveEntityResponse retrieveEntityResponseObj = (RetrieveEntityResponse)service.Execute(retrieveDetails);
 Microsoft.Xrm.Sdk.Metadata.EntityMetadata metadata = retrieveEntityResponseObj.EntityMetadata;
 Microsoft.Xrm.Sdk.Metadata.PicklistAttributeMetadata picklistMetadata = metadata.Attributes.FirstOrDefault(attribute => String.Equals(attribute.LogicalName, attributeName, StringComparison.OrdinalIgnoreCase)) as Microsoft.Xrm.Sdk.Metadata.PicklistAttributeMetadata;
 Microsoft.Xrm.Sdk.Metadata.OptionSetMetadata options = picklistMetadata.OptionSet;
IList<OptionMetadata> picklistOption = (from o in options.Options
 where o.Value.Value == optionSetValue
 select o).ToList();
string picklistLabel = (picklistOption.First()).Label.UserLocalizedLabel.Label;
 return picklistLabel;
 }

Now by using this we can easily get the selected option set value of any attribute of any record. Now to retrieve the text value we need to pass the value of the option set.

For e.g [How to call] To Get the selected text for Shipping method for a contact record

IOrganizationService service = GetCrmService();//Get the Crm Service 
string textValue=GetPickListText("contact","address1_shippingmethodcode",5,service) ;

I hope this really helps. HAPPY Reading !!!!!


			

, ,

2 Comments

Filtering records of any entity on top of Role and Permission


Filtering records of any entity on top of Role and Permission

Many times as a developer point of view we get some requirements which are complex in terms of designing and to meet such type of requirement we look to find an alternative solution.

Recently in my project I faced an issue regarding the Security Role for a Specific Type of User(Role). I would like to share the scenario. I had to filer the records of a particular entity dynamically based on a PickList value of that form. I mean in real the problem and the requirement was much more complex but let not focus on that. Let’s see how we can filter the record on top of the role privileges.

To solve my problem I wrote a plugin and registered for a RetrieveMultiple message.

// Obtain the execution context from the service provider.
IPluginExecutionContext context=(IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));
if (context.Mode == 0 && context.Stage == 20 && context.MessageName.Equals("RetrieveMultiple"))
{
  if (context.InputParameters.Contains("Query"))
  {
     if (context.InputParameters["Query"] is QueryExpression)
     {
         QueryExpression objQueryExpression = (QueryExpression)context.InputParameters["Query"];

       if (objQueryExpression.EntityName == "entityName")
       {
          IOrganizationServiceFactory serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
          service = serviceFactory.CreateOrganizationService(context.UserId);
          ConditionExpression conExpress;
          string role = string.Empty;

          role = getUserRole(context.UserId);//Method to get the role of logged In User
          if (role.Contains("roleName"))
          {
             conExpress = new ConditionExpression()
             {
                AttributeName = "attributeName",
                Operator = ConditionOperator.Equal,
                Values = { "1" }
              };
            }
           else
           {
           // show all for legal , finance, system admin

           conExpress = new ConditionExpression()
           {
             AttributeName = "attributeName",
             Operator = ConditionOperator.In,
             Values = { "1", "2", "3" }
           };
        }

       FilterExpression newFilter = new FilterExpression()
       {
           FilterOperator = LogicalOperator.Or,
           Conditions = { conExpress }
       };

       objQueryExpression.Criteria.AddFilter(newFilter);
       }
     }
  }
}

Here I have used the method getUserRole() but not shown in the code. We can get the role easily by using Linq, FetchXml or any other means. Anyways that was not the agenda for this article.

I have tested this plugin & its works fine without any Performance Issue. Below I have shown the registration steps for this plugin.

Note: If you are checking the entityname inside the plugin then its fine you can register the plugin as above otherwise you c an mention the entityname also in the Primary Entity in the above registration  step.

This RetrieveMultiple can be used for multiple purposes for eg for filtering of records in Lookup etc. I hope this really helps.  HAPPY READING !!!!!!!!!!!!!!!!!!

, , , ,

1 Comment

Developer ToolKit in CRM 2011


Developer ToolKit  in CRM 2011

Microsoft has provided the developer toolkit for CRM 2011. But it is unfortunate and sad that lot of people are either not aware or after knowing also do not like to use for their development purpose. But I found it really helpful for development as it can really increase the speed of the development. This tool is integrated with the Visual Studio 2010 to accelerate the development of custom code for Microsoft Dynamics CRM solutions.

This tool comes with the latest CRM SDK version 5.0.7 You can download this from

http://www.microsoft.com/download/en/details.aspx?id=24004

The Developer Toolkit can be found in the following location in the SDK .sdk\tools\developertoolkit folder. Just run the crmdevelopertools_installer where your Visual Studio is present. Just remember you need VS 2010 with Silverlight 4 for proceeding with this developer toolkit development.

Please follow the below link to get a good picture…. It’s really nice …

http://community.dynamics.com/product/crm/crmtechnical/b/crminogic/archive/2011/11/14/crm-2011-developer-toolkit.aspx

Happy Learning ….!!!!!!!!1

, , ,

Leave a comment