Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

How to set default value for a field of type 'Sp.FieldMultiChoice' using JavaScriptObject Model

$
0
0

Hi,

How to set default value for a field of type 'Sp.FieldMultiChoice'(dropdown) using JavaScriptObject Model.

Able to set values for that field(dropdown field) as below. 

var clientContext = SP.ClientContext.get_current();

if (clientContext != undefined && clientContext != null) {

var webSite = clientContext.get_web();

taskList = webSite.get_lists().getByTitle("MyList");                

var fieldCollection = taskList.get_fields();

var item = clientContext.castTo(fieldCollection.getByInternalNameOrTitle("Priority"), SP.FieldMultiChoice);

item.set_choices(choices);

item.update();

 

 

Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>