0

I need to set item in my form (select (yes/no value)) to sharepoint list column of type (Yes/No) Please help

0

In order to set yes/no fields use the 1 for yes and 0 for no as follows:

 var siteUrl = '/sites/MySiteCollection';
function updateListItem() {

var clientContext = new SP.ClientContext(siteUrl);
var oList = clientContext.get_web().get_lists().getByTitle('ListName');

this.oListItem = oList.getItemById(3);

oListItem.set_item('checkField', '1');

oListItem.update();

clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
}

function onQuerySucceeded() {

alert('Item updated!');
}

function onQueryFailed(sender, args) {

alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}

https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/hh185011(v%3Doffice.14)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.