gpt4 book ai didi

java - 热衷于从 netsuite 获取最后修改的贷项凭证记录

转载 作者:行者123 更新时间:2023-12-01 12:11:07 27 4
gpt4 key购买 nike

我正在使用 Java 和 NetSuite Web 服务来获取所有客户最后修改的贷项凭证交易或退款交易,但没有任何类型的 searchBasic 类可以执行此操作。如果有人之前做过,请提供您的建议或绝对答案,因为我是 netsuite 的新手,我不知道所有的事情。

如果您了解余额而不是贷项凭证,那么这对我也会有帮助。

最佳答案

public ArrayList<CreditMemo> searchRecentCreditMemos()
throws Exception {
TransactionSearch transactionsSearch = new TransactionSearch();
TransactionSearchBasic transactionSearchBasic = new TransactionSearchBasic();
CustomerSearchBasic custSearchBasic = new CustomerSearchBasic();

Calendar startDate = Calendar.getInstance();
startDate.add(Calendar.DAY_OF_MONTH, -1);
Calendar endDate = Calendar.getInstance();

// Create criteria
com.netsuite.webservices.platform.core_2014_1.SearchDateField searchDateField = new com.netsuite.webservices.platform.core_2014_1.SearchDateField();
searchDateField
.setOperator(com.netsuite.webservices.platform.core_2014_1.types.SearchDateFieldOperator.within);
searchDateField.setSearchValue(startDate);
searchDateField.setSearchValue2(endDate);

transactionSearchBasic.setLastModifiedDate(searchDateField);

transactionsSearch.setBasic(transactionSearchBasic);
transactionsSearch.setCustomerJoin(custSearchBasic);

SearchResult result = port.search(transactionsSearch);
ArrayList<CreditMemo> creditMemoList = new ArrayList<>();

if (result.getStatus().isIsSuccess()) {
RecordList recordList = result.getRecordList();
Record[] records = recordList.getRecord();

if (records != null && records.length != 0) {
for (int i = 0; i < records.length; i++) {
if (records[i] instanceof CreditMemo) {
CreditMemo creditMemo = (CreditMemo) records[i];
creditMemoList.add(creditMemo);
}
}
}
}

return creditMemoList;
}

关于java - 热衷于从 netsuite 获取最后修改的贷项凭证记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27276222/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com