在Netsuite中获取子列表的名称?

时间:2018-02-05 17:09:03

标签: netsuite suitescript

有没有办法在Netsuite中获取子列表的名称?我正在使用新的Inbound Shipment部分,我需要通过restlet向其添加项目。每次我尝试,我都会收到此错误:

GetNavigationService()

这就是我尝试访问它的方式:

{"type":"error.SuiteScriptError","name":"SSS_INVALID_SUBLIST_OPERATION","message":"You have attempted an invalid sublist or line item operation. You are either trying to access a field on a non-existent line or you are trying to add or remove lines from a static sublist.","stack":["anonymous(N/recordService)","<anonymous>(/SuiteScripts/KK_Sandbox_Scripts_SD/RestLets/InboundShipment.js:57)","doPost(/SuiteScripts/KK_Sandbox_Scripts_SD/RestLets/InboundShipment.js:34)"],"cause":{"type":"internal error","code":"SSS_INVALID_SUBLIST_OPERATION","details":"You have attempted an invalid sublist or line item operation. You are either trying to access a field on a non-existent line or you are trying to add or remove lines from a static sublist.","userEvent":null,"stackTrace":["anonymous(N/recordService)","<anonymous>(/SuiteScripts/KK_Sandbox_Scripts_SD/RestLets/InboundShipment.js:57)","doPost(/SuiteScripts/KK_Sandbox_Scripts_SD/RestLets/InboundShipment.js:34)"],"notifyOff":false},"id":"","notifyOff":false}"

我认为子列表ID可能不正确,但我无法弄清楚它应该是什么。我试过了item,inbounditems,inboundshipmentitems,所有这些都给了我同样的错误。我尝试以相同的方式创建销售订单并尝试向其添加项目,并且它正常工作,因此我认为它只是子列表ID。有谁知道如何帮忙?

1 个答案:

答案 0 :(得分:1)

您可以使用Record.getSublists()检索子列表ID并将其记录下来以确保您拥有有效的子列表ID。

我怀疑这可能与SuiteScript 2.0错误有关,因此请查看NetSuite并尝试在SuiteScript 1.0中重写它。