Multi Select Checkboxes – Custom Controls in CRM – Part 1

Multi select check boxes control is a very essential control in web forms. Some times client needs exactly the same feature in CRM forms as well. When the requirement is to develop a dynamic multi select checkboxes control its really difficult for the developer to implement the feature in CRM. CRM developers will have a little relief with this solution even if there are Javascripts needed to activate the functionalities.

An Option Set control and a Multi line textbox are used to create the Multi Select Checkboxes control. Labels of the checkboxes can be stored in the optionset control as items. Selected values will be saved in the multi line textbox seperated by semi colons.

Control looks like this in the CRM form after implementing it.

Multi select checkbox control in the form

Follow the steps below to work with Multi Select Checkbox control.

[1] Create a OptionSet control and add items to the option set. Items are the checkbox captions in the control.

[2] Create a Multi line textbox. This will hold all the selected item values.

Multi select checkbox control - Design time

[3] Add the MultiSelectCheckboxLibrary javascript library to the resources and add it to the form.

Download Multi Select Checkboxes Library Here

[4] Add “OptionSetToMultiSelect.Functions.ToMultiSelect” with relevant parameters to OnLoad event of the form

Multi select checkboxes function @ OnLoad

// Method to be invoked under onload event
ToMultiSelect: function (var_sc_optionset, var_sc_optionsetvalue, required, columns) 

var_sc_optionset – Name of the option set field
var_sc_optionsetvalue – Name of the multiline textbox
required – Whether the new field(Multi Select Checkboxes control) is required or not
columns – Number of columns to be appeared in the control for checkboxes

E.g. ToMultiSelect(“new_sports”,”new_sportsvalues”,true,1)

[5] Add “OptionSetToMultiSelect.Functions.CheckAllMultiCheckboxWithLayersRequiredFields” to OnSave event of the form


// Function to be invoked page OnSave
CheckAllMultiCheckboxWithLayersRequiredFields: function ()
Invoke multi select checkboxes save function

Thats it! Play with it.

Advertisements

2 Replies to “Multi Select Checkboxes – Custom Controls in CRM – Part 1”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s