我正在使用套件谈话 API 更新网络套件上的日记条目。我可以为记录添加新行。但是在使用行 ID 更新现有行时,出现以下错误。
由于以下原因之一,您无权为元素 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);