Setting values in a cross-site lookup field with multiple values
Posted: 23 Jan 2014
When you query a cross-site lookup field in a list you get a return value something like this:
"32;#Atlanta;#54;#Denver"
To assign values to a cross-site lookup field you have to use something like this:
fd.field('CrossSiteLookup').control().value([{Id: 1, Title: 'Item 1'}, {Id: 2, Title: 'Item 2'}])
It would be nice if we could simply do something like this:
var str = "32;#Atlanta;#54;#Denver";
fd.field('CrossSiteLookup').control().value(str);
or
fd.field('CrossSiteLookup').control().value("32;#Atlanta;#54;#Denver");
"32;#Atlanta;#54;#Denver"
To assign values to a cross-site lookup field you have to use something like this:
fd.field('CrossSiteLookup').control().value([{Id: 1, Title: 'Item 1'}, {Id: 2, Title: 'Item 2'}])
It would be nice if we could simply do something like this:
var str = "32;#Atlanta;#54;#Denver";
fd.field('CrossSiteLookup').control().value(str);
or
fd.field('CrossSiteLookup').control().value("32;#Atlanta;#54;#Denver");