0

当我尝试进行 TransactionSearchAdvanced(SalesOrder 搜索)时,它会返回具有相同值的重复记录。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);
4

1 回答 1

3

为 mainline = True 添加一个过滤器。代码应该是这样的

basic.setMainLine(new SearchBooleanField(null, null, SearchBoolenFieldOperator.false));
于 2013-10-18T13:09:54.623 回答