簡體   English   中英

Netsuite 庫存項目自定義字段更新

[英]Netsuite Inventory Item Custom Fields Update

我想弄清楚如何在 Netsuite 中更新 InventoryItem 記錄上的自定義字段。 我可以更新常規字段,但似乎無法更新任何內容

InventoryItem item = new InventoryItem();
WriteResponse response;
List<CustomFieldRef> oCustomFieldRefList = new List<CustomFieldRef>();

item.internalId = "9";
StringCustomFieldRef objStringCustomFieldRef = new StringCustomFieldRef();
objStringCustomFieldRef.internalId = "custitem_main_photo";
objStringCustomFieldRef.value = "http://www.google.com/test.jpg";
oCustomFieldRefList.Add(objStringCustomFieldRef); 

item.customFieldList = oCustomFieldRefList.ToArray();
response = _nsService.update(item);

更新調用返回的狀態為成功。 它只是不更新​​自定義字段。 我嘗試了不同的字段和類型,但似乎沒有任何保存。

自定義字段的 internalId 是數字 id,而不是字符串 id。 不知道為什么文檔都顯示字符串 id 值,但使用數字為我解決了問題。

不是分配內部 ID,而是分配 scriptId。

轉這個

objStringCustomFieldRef.internalId = "custitem_main_photo";

對此:

objStringCustomFieldRef.scriptId = "custitem_main_photo";

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM