我正在尝试在 netsuite 中保存现金销售,我们有一个名为业务单位的自定义细分字段(ScriptId = custbody_cseg2),我需要为其设置一个特定值(自定义细分中的内部 ID = 2)。
我正在使用以下代码,它与我们在 netsuite 帮助中的代码几乎相同,但应用于现金销售交易:
SelectCustomFieldRef selectCustomFieldRef = new SelectCustomFieldRef();
ListOrRecordRef custSelectValue = new ListOrRecordRef();
custSelectValue.internalId = "2";
//custSelectValue.typeId = "286"; <- with or whitout doesn't change
selectCustomFieldRef.value = custSelectValue;
selectCustomFieldRef.scriptId = "custbody_cseg2";
CustomFieldRef[] customFieldRefArray = new CustomFieldRef[1];
customFieldRefArray[0] = selectCustomFieldRef;
cashSale.customFieldList = customFieldRefArray;
当我运行此代码时,我收到以下错误:
[Code=INSUFFICIENT_PERMISSION] You do not have permissions to set a value for element custbody_cseg2 due to one of the following reasons: 1) The field is read-only; 2) An associated feature is disabled; 3) The field is available either when a record is created or updated, but not in both cases.
有谁知道会是什么错误?
非常感谢!