Saturday, June 02, 2012

MS CRM 2011: N-N Relationship control: checklistbox style

I have developed WebResource for CRM which displays N-N relation in checklistbox style and decided to share it:

Good thing in this control that you don’t need any knowledge of development to use it in your system. Here is instruction how to install it.
Prerequisite is N-N relation in your system. For demonstration I have created custom entity Industry and created N-N relationship between Account and Industry:


 For following usage you should remember following things:
1. Associated entity logical name (xrm_industry in my case).
2. Associated entity display field name (xrm_name in my case).
3. Relationship entity name (xrm_industry_account in my case).
Download and install provided solution:


Open form where you want to put control and clear some space for it:

Open Insert tab and click Webresource. In window that appeared select xrm_NtoNCheckBoxStyle.html webresource from installed solution, give your webreource some name and label and fill Custom Parameter field attentively.

Once you have finished your form should look like:
As a datasource Industry records are taken:

Demonstration was shown on first screen.
Several notes:
1. For Create and Bulk Edit form control would not show anything.
2. All information about associated record is saved when user clicks Save on parent form. For disabled form (when record is inactive) additional button “Save” appears at the top of control: