Setting the anyof, mine, or myteam Filtering Values

Important:

In many cases, you can achieve the equivalent of SOAP operations using REST web services. For a comparison of available operations in SOAP and REST web services, see SOAP Web Services vs. REST Web Services Operation Mapping.

In SOAP web services, you can further define your search using the following filtering values:

Filter

Note

@NONE@

Equates to anyof (see Filtering Lists that Contain Null Values) or unassigned depending on the field.

@CURRENT@

Equates to mine. For example, use this filter to return all of your own events.

@HIERARCHY@

Equates to my team. For example, use this filter on a salesRep field for customer records. If you have previously defined the members of your sales team, using the @HIERARCHY@ filter will return only the customers that have worked with members of your sales team.

The following provides a SOAP sample for finding my events.

           <search xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
   <searchRecord xsi:type="ns1:CalendarEventSearchBasic"
   xmlns:ns1="urn:common_2017_1.platform.webservices.netsuite.com">
      <ns1:attendee operator="anyOf" xsi:type="ns2:SearchMultiSelectField"
   xmlns:ns2="urn:core_2017_1.platform.webservices.netsuite.com">
         <ns2:searchValue internalId="@CURRENT@" xsi:type="ns2:RecordRef"/>
      </ns1:attendee>
  </searchRecord>
  </search> 

        

Filtering Lists that Contain Null Values

For select lists or multi selects which can have a null value, the UI supports the search criteria on these list type fields as “None Of” “-None-“, which essentially means not “Any Of” all list options. Such a search would result in all records which do NOT have this list type field as null. To accomplish this “None Of” “-None-“ search you need to set the internalId of the search key to “@None@”.

Example

To search for Customers which have a Partner associated with them in NetSuite, the SOAP would look as below for the “Partner field not null” part:

          <ns3:partner operator="noneOf">
<ns8:searchValue internalId="@NONE@" xmlns:ns8="urn:core_2017_1.platform.webservices.netsuite.com"/>
</ns3:partner>
<ns3:customFieldList> 

        

Java code to generate this SOAP would be:

          // Adding search criteria where Partner is not null
RecordRef[] noPartner = new RecordRef[1];
noPartner[0] = new RecordRef();
noPartner[0].setInternalId("@NONE@");
SearchMultiSelectField partner = new SearchMultiSelectField();
partner.setOperator(SearchMultiSelectFieldOperator.noneOf);
partner.setSearchValue(noPartner);
custSearch.setPartner(partner); 

        

C# code to generate this SOAP would be:

          // Adding search criteria where Partner is not null 
RecordRef[] noPartner = new RecordRef[1]; 
noPartner[0] = new RecordRef(); 
noPartner[0].internalId = "@NONE@"; 
SearchMultiSelectField partner = new SearchMultiSelectField(); 
partner.@operator = SearchMultiSelectFieldOperator.noneOf; 
partner.searchValue = noPartner; 
custSearch.partner = partner; 

        

Related Topics

General Notices