Friday, January 16, 2015

Convert Dropdown / Pick list /Option set into Radio button list for CRM

In CRM we don't have option to show picklist / option set as a radio button. we can show radio buttons/ check box / drop down for boolean attirbute but not for option set.

If you want to show option set as radio button list we can achieve this by adding one HTML web resource and some Jquery code..

Here are steps to convert Option set into radio button list.

1. Create HTML web resource and give proper name

2. Add following code in your HTML web resource 



3. As I am using Jquery functions in this HTML web resource, so we need to add Jquery library.

<  script type="text/javascript" src="new_jquery_1.10.2" > < / script >

If you are using folder structure for web resources name like new_JavaScript/jquery_1.10.2.js

then reference library like
<  script type="text/javascript" src="../new_JavaScript/jquery_1.10.2.js" > < / script >

4.  In HTML web resource I am using  option set attribute name "new_radiobuttongroup", and to get option set values & Text from CRM form I am using

var dropdownOptions = parent.Xrm.Page.getAttribute("new_radiobuttongroup").getOptions();


5. Save HTML web resource, and open Entity form where you want to convert option set to radio button. 

6. Add Jquery library which we used in HTML web resource in form library.



6.  Add above created web resource on form. and set web resource properties as shown


You can set number or rows depending on your number of option set options. 

7. Add your option set attribute on form which you want to show as radio button list. and set 
Visible by default property to false.


your form will look like




8.  Save and publish your customization. 

Now here is option set shown as radio button list..






6 comments:

  1. Hi, really like the idea of using this as we have issues in CRM 2013 with the number of options being displayed in an option set. Quick question though, can I just confirm that this code doesn't need the the drop-down displayed and it will work with just the radio button visible? And also, if one option is selected, are the other automatically deselected?

    ReplyDelete
  2. Hi Anita,
    Yes dont need to display dropdown but dropdown need on form, you make dropdown as visible false.

    if one option is selected, are the other automatically deselected?
    Yes, I am using radio button group, so only one option will be selected.

    ReplyDelete
  3. sir I want to make option set in subgrid with checkboxes so can select desired fields accordingly plz help on this.

    ReplyDelete
  4. What i had to do if multiple radio button list required in the same page?

    ReplyDelete
  5. Hi there very nice website!! Man .. Beautiful .. Wonderful .. I will bookmark your blog and take the feeds additionally…I’m happy to search out so many helpful info right here in the publish, we’d like work out more strategies in this regard, thank you for sharing. . . . . .
    crm vendors

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete