I am trying to retrieve the selected values of multi select lookup column and store them in array and then set the lookup column with the same selected values after drop down value changes but always the value is returned as blank.
It works fine in case of single select look up column.
Please help.
I am really going mad with this issue :(
function getWebSiteData()
{
clientContext = new SP.ClientContext.get_current();
if (this.clientContext != undefined && clientContext != null)
{
var webSite = clientContext.get_web();
oList = webSite.get_lists().getByTitle("Add New User");
$.urlParam = function(name)
{
var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);
return results[1] || 0;
}
var itemid = parseInt($.urlParam('ID'));
oListItem = oList.getItemById(itemid);
clientContext.load(oListItem,"ID","Unit","System");
clientContext.executeQueryAsync(Function.createDelegate(this, this.success), Function.createDelegate(this, this.failed));
}
}
function success(sender,args)
{
**alert(oListItem.get_item("System").get_lookupId()); // this is null always**
alert('success');
}
function failed(sender, args) {
alert("failed. Message:" + args.get_message());
}
Thanks for your update, I saved the values to array using js code but can you tell me how to assign array values back to the right hand side of Multi-select lookup column on change of a drop down value, this also happens without save button being clicked.