soapnetsuitesuitetalk

SuiteTalk SOAP API TransactionSearchBasic with type journalEntry fails


I tried fetching all the journal entries in my account using the SuiteTalk SOAP API. But it fails with the message

The field type's enum value <journalEntry> is invalid for this search.

The Request and Response are as follows:

==================== Beginning of Request ====================
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Header>
    <ns1:searchPreferences xmlns:ns1="urn:messages_2021_1.platform.webservices.netsuite.com" soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0">
      <ns1:pageSize>20</ns1:pageSize>
    </ns1:searchPreferences>
    <ns2:tokenPassport xmlns:ns2="urn:messages_2021_1.platform.webservices.netsuite.com" soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0">
      <ns3:account xmlns:ns3="urn:core_2021_1.platform.webservices.netsuite.com">#####</ns3:account>
      <ns4:consumerKey xmlns:ns4="urn:core_2021_1.platform.webservices.netsuite.com">#####3</ns4:consumerKey>
      <ns5:token xmlns:ns5="urn:core_2021_1.platform.webservices.netsuite.com">#####</ns5:token>
      <ns6:nonce xmlns:ns6="urn:core_2021_1.platform.webservices.netsuite.com">#####</ns6:nonce>
      <ns7:timestamp xmlns:ns7="urn:core_2021_1.platform.webservices.netsuite.com">#####</ns7:timestamp>
      <ns8:signature xmlns:ns8="urn:core_2021_1.platform.webservices.netsuite.com" algorithm="HMAC-SHA256">#####</ns8:signature>
    </ns2:tokenPassport>
  </soapenv:Header>
  <soapenv:Body>
    <search xmlns="urn:messages_2021_1.platform.webservices.netsuite.com">
      <searchRecord xmlns:ns9="urn:common_2021_1.platform.webservices.netsuite.com" xsi:type="ns9:TransactionSearchBasic">
        <ns9:type xmlns:ns10="urn:core_2021_1.platform.webservices.netsuite.com" operator="anyOf" xsi:type="ns10:SearchEnumMultiSelectField">
          <ns10:searchValue xsi:type="xsd:string">journalEntry</ns10:searchValue>
        </ns9:type>
      </searchRecord>
    </search>
  </soapenv:Body>
</soapenv:Envelope>
==================== End of Request ====================


==================== Beginning of Response ====================
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Header>
    <platformMsgs:documentInfo xmlns:platformMsgs="urn:messages_2021_1.platform.webservices.netsuite.com">
      <platformMsgs:nsId>#####</platformMsgs:nsId>
    </platformMsgs:documentInfo>
  </soapenv:Header>
  <soapenv:Body>
    <searchResponse xmlns="urn:messages_2021_1.platform.webservices.netsuite.com">
      <platformCore:searchResult xmlns:platformCore="urn:core_2021_1.platform.webservices.netsuite.com">
        <platformCore:status isSuccess="true">
          <platformCore:statusDetail type="WARN">
            <platformCore:code>WARNING</platformCore:code>
            <platformCore:message>The field type's enum value &lt;journalEntry&gt; is invalid for this search.</platformCore:message>
          </platformCore:statusDetail>
        </platformCore:status>
        <platformCore:totalRecords>0</platformCore:totalRecords>
        <platformCore:totalPages>0</platformCore:totalPages>
        <platformCore:searchId>#####a</platformCore:searchId>
        <platformCore:recordList/>
      </platformCore:searchResult>
    </searchResponse>
  </soapenv:Body>
</soapenv:Envelope>
==================== End of Response ====================

The permissions for the role are as follows: enter image description here


Solution

  • You should use the TransactionType enum ex in java:

    SearchEnumMultiSelectField searchTypeValue = new SearchEnumMultiSelectField();
    searchTypeValue.getSearchValue().add(TransactionType.JOURNAL.value());