Sam's Microsoft Dynamics 365 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

Web Resource vs PCF vs Canvas App - which of the one is used?

While started working on specific Business Requirements related to custom layout, there is a always common question that "where to star...