Discussions
Updation of Customfield
Hi,
We have created a custom field in salesorder.When we try to update that custom field it is giving the error as
Error Code: INVALID_KEY_OR_REF
Error Message : The Specified key is invalid. I have given the code below.
Can u pls help me out where i did wrong
SelectCustomFieldRef sel = (SelectCustomFieldRef)salesOrderHeader.itemList.item[j].customFieldList[0];
SelectCustomFieldRef listCF = new SelectCustomFieldRef();
listCF.internalId = sel.internalId;
ListOrRecordRef listRef = new ListOrRecordRef();
listRef.internalId = "1";
listRef.typeId = "24";
listCF.value = listRef;
CustomFieldRef[] cfRefs = null;
cfRefs = new CustomFieldRef[1];
cfRefs[0] = listCF;
SalesOrder sales = new SalesOrder();
sales.customFieldList = cfRefs;
WriteResponse wres = cnw.update(sales);
Thanks for the help in advance,