I have the following code inside my remote event reciever, to create a new folder, and then populate the folder managed metadata fields with the current item (item that was added) values:-
ListItem listItem = context.Web.GetList(webrelativeurl + "/"+i2["TemplateListUrl"]).AddItem(listItemCreationInformation);
listItem["FolderType"] = currentitem["FolderType"];
listItem["CorpType"] = currentitem["CorpType"];
now the FodlerType
on both the current item and the listitem is a managed metadata column which allow single value only, while the CorpType
allow multiple values. my above code will assign a value for the FolderType
, but will raise this error when updating the CorpType:-
Microsoft.SharePoint.Client.ClientRequestException
HResult=0x80131500 Message=The object is not associated with an object identity or the object identity is invalid. Source= StackTrace:
any advice?