Quantcast
Channel: jQuery Library for SharePoint Web Services
Viewing all articles
Browse latest Browse all 6517

New Post: Can't set a Drop Down Choice Field using UpdateListItems

$
0
0
Hi Marc...

Ever since your class on SPServices, I have been using it and loving it. However, I have recently hit a conundrum. I am running SharePoint 2013. I am creating new list items using the UpdateListItems web service. Everything is working fine...except when I try to set the Choice field.

I have tried many variations, but it either displays unwanted ";#" text in AllItems or DispForm and in EditForm it is always Blank. This is a Single Choice Field...not a Multi.

How should one format the value being used to set a Choice Field?

function CreateNewWorkOrder(prop, name, place) {
// Trying to determine the right format for a CHOICE field - and None seem to work
//
// var myPlace = place;  // A Simple String  such as 'Boston' from a Choice field
// var myPlace = ";#" + place;
// var myPlace = ";#" + place + ";#";
// var myPlace = place + ";#";      
// var myPlace = place + ";#" + place;

$().SPServices({
        operation: "UpdateListItems",
        async: false,
        batchCmd: "New",
        listName: "Work Order",
        valuepairs: [["Property", prop], ["Facility", myPlace], ["Title",name]],
        completefunc: function(xData, Status) {
        }
    });
}

Viewing all articles
Browse latest Browse all 6517

Trending Articles



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