SuiteTalk TransactionSearchAdvanced返回重复记录

时间:2013-10-18 11:16:25

标签: netsuite

当我尝试进行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);

1 个答案:

答案 0 :(得分:2)

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

basic.setMainLine(new SearchBooleanField(null, null, SearchBoolenFieldOperator.false));