Microsoft Dynamics CRM, SharePoint & One Note Step-by-Step Integration

With the Microsoft Dynamics CRM Spring 2015 release just around the corner, I wanted to try out the OneNote integration. The setup is amazing easily.  If you would like a preview, check out the step-by-step article I wrote for the Microsoft MVP Award blog site.

I think this integration is definitely going to make the most frequently used, new feature, list.


Configuring Cascading Entity Relationship Behavior

As we know, CRM is a highly configurable application.  One of the configurable options is to configure the behavior of related records when a CRM record is assigned, merged or some other action is taken.  This is a very important concept in CRM because the decisions and actions you take will affect your Organization’s data. 

By default, when you install CRM,  the cascading relationship of entities is generally set to Parental for actions like Assign, Share, Unshare, Reparent, etc. where there is an option to modify the relationship behavior.  Some entity relationships are not available for modifications because there are System dependencies.  The “Type of Behavior” will appear as System and you will not be able to modify those relationship behaviors. 

So what does this mean?  Let’s use the Contact entity as an example to understand how cascading behavior impacts CRM data.  

A common action that users might take on a Contact record is to reassign the record.  By default, that means that when a Contact record is reassigned to someone else (ownership change) other related record ownership will also be updated to the new Contact owner.  Ownership for related records like a Case, E-mail, Task, etc. will change to the new Contact owner for those records that are in an Active or Open status.  This can be confusing for the end user when viewing the records because it can appear that someone different from the original owner (created by) created the record.  We can modify this behavior to alleviate the confusion and ensure that the related record maintains its original owner. 

Here are the steps to configure the cascading behavior of the Contact entity relationship with the E-mail entity.  This examples assumes that you know how to open the Contact entity to customize it.

From the Contact entity, select 1:N Relationships.  Find the row named Contact_Emails and open it.  Notice that the default behavior is set to Parental.


After opening the relationship record, select Type of Behavior and change it from Parental to Configurable Cascading.


Change the remaining behaviors from Cascade All to Cascade None.  Save your changes and Publish. 


You can repeat these steps for other entities like Accounts, Cases and their relationships with Activities and other CRM entities.

Generally speaking, when I install a CRM application, I modify the system to set the cascading relationship of related Activities (E-mail, Appointments, Phone Calls, etc.) to System Configurable, change the behavior from Parental to Configurable Cascading, and set the Assign, Share, Unshare, and Reparent behavior to Cascade None. 

Now that we have CRM 2011, this is much easier to manage as we can create a ‘Default Solution’ that contains the default Cascading behavior desired and import that into each new CRM implementations as a starting point for the project.  This is a significant productivity gain.

If you would like to learn more about CRM Customization, check out the 11 Things to know about Customization on the Resource Center.  See # 5 for more information about Cascading Behavior.


Calculate the Value of a field using JavaScript

Here is a simple way to calculate the value of a field based on the values of two other fields on a form using JavaScript.  The value of the field is updated whenever the value of one of the two other fields is changed.
For this example, I will use the Opportunity form.  The request is to add a custom field that shows the Total Value of the Opportunity after Discount.  I will use the following fields for reference in the example.
  • Field1 (Custom attribute) = Total_Estimated_Value
  • Field2 (Custom attribute)  = Total_Discount
  • Field3 (Standard attribute)= Est. Booking (estimatedvalue)
Steps to implement the change:
  • Create the two custom attributes that you need by going to Settings, Customization, Customize Entities, open the Opportunity Entity, select Attributes, create two new money attributes, and save the changes.
  • Open the Opportunity form and add the two fields to the form.
  • Double-click (Open) the Est. Booking field (estimatedvalue) on the form and add the following line of script to the OnChange event of the field
    crmForm.all. Total_Estimated_Value.FireOnChange();
  • Open the Total_Discount field on the form and add the same script to the OnChange event of the field
  • Open the Total_Estimated_Value field on the form and add the following script to the OnChange event of the field
    crmForm.all.Total_Estimated_Value.DataValue=crmForm.all.estimatedvalue.DataValue – crmForm.all.Total_Discount.DataValue
  • Save your changes and test using the Create or Update Form feature from the Customization Tool

The end result will be that whenever the Total_Discount or Est. Booking field is updated the Total_Estimated_Value will update by subtracting the Total_Discount from the Est. Booking amount.

Please note that this example assumes there is always a value in the Est. Booking and Discount field when one of those fields are updated.  You may have to add some additional code that first checks to see if there is a value in the Total_Discount and Est. Booking field before firing the “crmForm.all.Total_Estimated_Value.FireOnChange();” script.  If there is no value (null), then you will have to set the value to 0 (zero).  Checking and setting the default value of the fields to 0 can be done in the Form properties OnLoad event.