我希望将Salesorder记录发送到我的application.how,以指定Salesorder记录类型到事务搜索Basic.currently我得到所有类型的记录但我只需要销售订单记录...怎么办请建议我..
SearchDateField created=new SearchDateField();
//SearchDateFieldOperator searchDateFieldOperator=new SearchDateFieldOp;
SimpleDateFormat dft1=new SimpleDateFormat("MM-dd-yyyy");
Calendar calendar=Calendar.getInstance();
calendar.setTime(fromDate);
created.setSearchValue(calendar);
Calendar calendar2=Calendar.getInstance();
calendar2.setTime(toDate);
created.setSearchValue2(calendar2);
created.setOperator(SearchDateFieldOperator.within);
TransactionSearchBasic tsb=new TransactionSearchBasic();
tsb.setDateCreated(created);
SearchResult res = _port.search(tsb);
RecordList rl=res.getRecordList();
Record[] records=rl.getRecord();
答案 0 :(得分:1)
假设您创建了这样的实用程序方法:
public static SearchEnumMultiSelectField GetSearchEnumMultiSelectField(String[] searchValue, SearchEnumMultiSelectFieldOperator op)
{
SearchEnumMultiSelectField semsf = new SearchEnumMultiSelectField();
semsf.operatorSpecified = true;
semsf.@operator = op;
semsf.searchValue = searchValue;
return semsf;
}
现在在搜索过程中,您可以这样称呼它:
TransactionSearch ts = new TransactionSearch();
ts.basic = new TransactionSearchBasic();
ts.basic.type = GetSearchEnumMultiSelectField(new String[] { "salesOrder" }, SearchEnumMultiSelectFieldOperator.anyOf);
//Do rest of the code here for calling search
//Call Port.search etc
所以这里的想法是使用SearchEnumMultiSelectField对象并设置其不同的值来实现您的结果。
希望这有帮助!