使用套件对话 API 更新 Netsuite 上日记账分录的行项目时出现问题



我正在使用套件谈话API更新Net suite上的日志条目。我可以为记录添加新行。但是在我使用线路ID更新现有行时,出现以下错误。

由于以下原因之一,您无权为 line line.line 设置值:1( 该字段是只读的;2( 禁用关联的功能;3( 该字段在创建或更新记录时都可用,但在这两种情况下都不可用

我可以使用 GUI 更新行,但不能使用 API 更新行

NetSuiteServiceBridge  nsServiceBridge = NetSuiteServiceBridge.serviceInstance;
            JournalEntry j = new JournalEntry();
            //j.subsidiary =new RecordRef {internalId="2",type=RecordType.subsidiary };
           j.internalId = "115939";
            JournalEntryLineList jl = new JournalEntryLineList();
            JournalEntryLine line1 = new JournalEntryLine();         
            line1.startDate = DateTime.Now;
            line1.startDateSpecified = true;
            line1.line = 5;
             line1.lineSpecified = true;
            line1.account = new RecordRef { internalId = "206", type = RecordType.account };
            line1.department = new RecordRef { internalId = "1", type = RecordType.department };
            line1.credit = 100;
            line1.creditSpecified = true;
            jl.line = new JournalEntryLine[] {line1};           
            jl.replaceAll = false;
            j.lineList = jl;
           WriteResponse r= nsServiceBridge.UpdateRecords(j);

Web 服务有自己的权限来分隔本机 GUI

这是设计使然

最新更新