使用Web服务从Netsuite会计科目表中检索期初余额

时间:2013-01-16 05:32:49

标签: search account netsuite

当我尝试使用Webservice从Netsuite检索帐户详细信息时,期初余额始终返回null。

我使用以下代码检索帐户详细信息:

AccountSearch accountSearch = new AccountSearch();
AccountSearchBasic accBasic = new AccountSearchBasic();
accountSearch.setBasic(accBasic);
port.search(accountSearch);

我也尝试过使用port.get(recordRef),port.getList(recordRef [])和port.getAll(getAllrecord)但得到了相同的结果。还有其他方法可以使用webservice检索Netsuite的帐户详细信息吗?

提前致谢

1 个答案:

答案 0 :(得分:0)

这可能会有所帮助

public boolean performSearch(NetSuitePortType p_objportCall) throws Exception
{
    boolean status = false;
    AccountSearchBasic l_objaccountSearchBasic = new AccountSearchBasic();
    try
    {
        SearchResult l_objSearchResult = p_objportCall.search(l_objaccountSearchBasic);
        System.out.println(" Account Search Number of records: " +l_objSearchResult.getTotalRecords());
        if (l_objSearchResult.getTotalRecords() > 0 )
        {
           processResults(l_objSearchResult.getRecordList());
        }
    }
    catch (Exception e)
    {
        System.err.println("Acct Search performsearch: "+e.toString());
        throw e;
    }
    return status;