当我尝试进行TransactionSearchAdvanced(SalesOrder搜索)时,它返回具有相同值的dublicate记录。 BodyFieldsOnly设置为true。我的代码有什么问题。代码如下
TransactionSearchAdvanced advanced = new TransactionSearchAdvanced();
TransactionSearch search = new TransactionSearch();
TransactionSearchBasic basic = new TransactionSearchBasic();
TransactionSearchRow tsRow = new TransactionSearchRow();
TransactionSearchRowBasic rowBasic = new TransactionSearchRowBasic();
basic.setType(new SearchEnumMultiSelectField(new String[] { "_salesOrder" }, SearchEnumMultiSelectFieldOperator.anyOf));
basic.setAccount(new SearchMultiSelectField(new RecordRef[] { new RecordRef(null, "54", null, null) }, SearchMultiSelectFieldOperator.anyOf));
basic.setRecordType(new SearchStringField(RecordType._salesOrder , SearchStringFieldOperator.is));
basic.setOtherRefNum(new SearchTextNumberField(null, null, SearchTextNumberFieldOperator.notEmpty));
basic.setInternalIdNumber(new SearchLongField(lastProcessedPoSalesOrderInternalId, null, SearchLongFieldOperator.greaterThan));
search.setBasic(basic);
rowBasic.setOtherRefNum(new SearchColumnTextNumberField[]{new SearchColumnTextNumberField()});
rowBasic.setInternalId(new SearchColumnSelectField[]{new SearchColumnSelectField()});
tsRow.setBasic(rowBasic);
advanced.setColumns(tsRow);
advanced.setCriteria(search);
result = netsuiteService.searchBodyFields(advanced);
答案 0 :(得分:2)
为mainline = True添加过滤器。代码应该是这样的
basic.setMainLine(new SearchBooleanField(null, null, SearchBoolenFieldOperator.false));