Archive for category Uncategorized

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/

Advertisements

, , , ,

Leave a comment

2013 in review


The WordPress.com stats helper monkeys prepared a 2013 annual report for this blog.

Here’s an excerpt:

The concert hall at the Sydney Opera House holds 2,700 people. This blog was viewed about 22,000 times in 2013. If it were a concert at Sydney Opera House, it would take about 8 sold-out performances for that many people to see it.

Click here to see the complete report.

Leave a comment

Creating Business Rules in CRM 2013


One of new feature added in new release of CRM 2013 is Business Rule. Though this is not very exciting feature provided by CRM 2013 but obviously this is something which developers can relish as it minimizes the burden of common JavaScript validation. Yes that’s true with the use of Business Rules we can easily perform few simple validation in the form without writing a single line of code.

Wow!!!! It sounds great… Let us have a quick walk through of this new feature and see how we can incorporate this for our requirements.

 Example:

When a lead source is changed to Partner – I want to make

1. Business Phone and Email as Mandatory Fields

2. Hide the Mobile Phone Field

Now let us create a Business Rule to meet the above requirement.  Business Rules comes as a part of your entity in the solution as shown below.

BusinessRulesAppear

Go to Business Rules for Lead entity and Create a new one. Here we can notice that we can do the following things

1. Add Conditions

2. Add Actions

3. Provide Description

In this example we have added one condition as if the lead source is Partner. In actions we can see that we are making the Business Phone as Mandatory, Hiding the Mobile Phone field and Making the email as Mandatory.

CreatingNewBusinessRules

There are very limited options available for the creating the actions like as shown below.

ActionsBusinessRules

Once we are done with the creation part we need to save this and activate. Similar to Processes we can activate and deactivate this Rules at any point of time. Also if we have multiple forms then we can also define for which forms these rules should be applied.

ScopeBusinessRules

One good I liked the most is that there is a Save As Option available so we can create multiple rules in minute and then edit accordingly.

Now we can see the desired result in the lead form(UI)LeadUI

Key points to be noted

1. If there is JavaScript written for same field then it executes before your custom business rules(Java script fires before Business Rules).

2.  It does not supports hiding/Showing  Tabs and Sections.

3.  This is similar to JavaScript so these rules do not trigger when any operation is performed by API calls.

4. Well supported in Mobiles and Ipad.

5. Rules can be applied form wise. So in case of multiple forms you may specify for which forms these rules is applicable for.

, , ,

Leave a comment

2012 in Review


The WordPress.com stats helper prepared a 2012 annual report for this blog.
2012review

Here’s an excerpt:

4,329 films were submitted to the 2012 Cannes Film Festival. This blog had 18,000 views in 2012. If each view were a film, this blog would power 4 Film Festivals.

Click here to see the complete report.

Leave a 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