Sam's Dynamics, Power Platform & AI Blog

Wednesday, 5 September 2018

Get and Set value in MultiSelect Option Set Using JavaScript


A new enhancement in Dynamics CRM is Multiselect Option set. We can Get and Set Value using below code in the Multiselect Option set using Javascript:-

Get the value of a Multiselect Option Set

Get Value:-
     Syntax:-   Xrm.Page.getAttribute('FieldName').getValue();

     Example:-  Xrm.Page.getAttribute('new_myhobby').getValue();

Set the value of a Multiselect Option Set

Set Value:-
     Syntax:-   Xrm.Page.getAttribute('FieldName').setValue([<Value1>,<Value2>);

     Example:- Xrm.Page.getAttribute('new_myhobby').setValue([360002,3660001]);

No comments:

Post a Comment

Display Density in Model-Driven Apps: Less Whitespace, More CRM

 If you work with Dynamics 365, you've heard this one: "Why is there so much empty space on the screen?" Microsoft now has an ...