Saturday, December 12, 2015

Dependent (Linked) OptionSets in Dynamics CRM 2015

I recently used the sample code provided in the SDK that allows you to have multiple OptionSets linked together so that selecting an item in the first OptionSet will filter the items appearing in the second.

There was an error in the instructions for configuring the OnLoad event on the form. It says to use


 as a parameter.  That's wrong. You need to use 


The SDK.DependentOptionSet.init function in the JavaScript file I modified slightly to support multiple languages.  The first few lines now read

//Retrieve the XML Web Resource specified by the parameter passed var clientURL = Xrm.Page.context.getClientUrl();

var userLcid = Xrm.Page.context.getUserLcid();

var pathToWR = clientURL + "/WebResources/" + webResourceName + "_" + userLcid;

The data files were then appended with the relevant LCID for each language 

e.g. "sample_TicketDependentOptionSetConfig_1033.xml"

A very cool and easy to use JavaScript Library. Thanks Microsoft.