Loading...

RE: qSelector not refreshing dialogue

RE: qSelector not refreshing dialogue

#7362
Anonymous
Anonymous
Participant

I'm unable to remove the custom code.  The same situation works for other pages however.

n

I did write a small work-around though.

n

I linked the dropdown to a ListView and then I have some custom jscript which parses the appropriate values and links them together in a function:

n

// SID1: SharePoint ID for first item.
// SID2: SharePoint ID for second item.
// field1: SharePoint field name for first item.
// field2: SharePoint field name for second item.
// list: The list where the two values will be linked
function linkIDs(context, SID1, field1, SID2, field2, list) {

n

console.info("linkIDs:\n\tSID1: %s\n\tSID2 %s\n\tfield1: %s\n\tfield2: %s\n\tlist: %s", SID1, SID2, field1, field2, list);

var clientContext = context;

n

var oList = clientContext.get_web().get_lists().getByTitle(list);
var item = new SP.ListItemCreationInformation();
var oListItem = oList.addItem(item);

n

var Item1LookupField = new SP.FieldLookupValue();
var Item2LookupField = new SP.FieldLookupValue();

n

Item1LookupField.set_lookupId(SID1);
oListItem.set_item(field1, Item1LookupField);

n

Item2LookupField.set_lookupId(SID2);
oListItem.set_item(field2, Item2LookupField);

n

oListItem.update();

n

clientContext.load(oListItem);

n

return clientContext;
};