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) {
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) {
}
});
}