getList

The getList operation is used to retrieve a list of one or more records by providing the unique ids that identify those records.

If there are multiple ids provided, they can either belong to the same record type or different record types. For example, it is possible to retrieve a customer and a contact within a single request using this operation.

If some of the provided ids are invalid, the request is still processed for the valid ids and the response will contain a warning that indicates that some of the ids were invalid.

Note:

An asynchronous equivalent is available for this operation, asyncGetList. For information about asynchronous request processing, see Synchronous Versus Asynchronous Request Processing.

Request

The getListRequest type is used for the request. It contains the following fields.

Element Name

XSD Type

Notes

recordRef

RecordRef

An array of recordRef objects that specify the ids of the records to be retrieved.

Response

The getListResponse type is used for the response. It contains the following fields.

Element Name

XSD Type

Notes

status

Status

The status for this operation. All applicable errors or warnings are listed within this type.

recordList

Record[]

A list of records that correspond to the specified ids. The actual records returned need to be of a type that extends the abstract type Record.

Faults

This operation can throw one of the following faults. See SOAP Fault Status Codes for more information on faults.

Sample Code

SOAP Request

In the following example, two records are retrieved — one customer record and one employee record. Note that you must provide the internal ID of the specify instance of the record and the record type for the getList.

          <soap:Body>
<platformMsgs:getList>
   <platformMsgs:baseRef internalId="983" type="customer" xsi:type="platformCore:RecordRef"/>
   <platformMsgs:baseRef internalId="-5" type="employee" xsi:type="platformCore:RecordRef"/>
</platformMsgs:getList>
</soap:Body> 

        

SOAP Response

          <soapenv:Body>
<getListResponse xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
<readResponseList xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
   <readResponse>
      <ns1:status isSuccess="true" xmlns:ns1="urn:core_2017_1.platform.webservices.netsuite.com"/>
      <record internalId="983" xsi:type="ns2:Customer" 
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xmlns:ns2="urn:relationships_2017_1.lists.webservices.netsuite.com">
         <ns2:entityId>Shutter Fly</ns2:entityId>
         <ns2:isInactive>false</ns2:isInactive>
         <ns2:companyName>Shutter Fly, Inc</ns2:companyName>
         .
         ...[more fields]
         .
         <ns2:customFieldList>
            <ns6:customField internalId="265" scriptId="custentity_map" 
            xsi:type="ns6:StringCustomFieldRef" 
            xmlns:ns6="urn:core_2017_1.platform.webservices.netsuite.com">
                  <ns6:value>http://maps.google.com</ns6:value>
            </ns6:customField>
         </ns2:customFieldList>
      </record>
   </readResponse>
   <readResponse>
      <ns8:status isSuccess="true" xmlns:ns8="urn:core_2017_1.platform.webservices.netsuite.com"/>
      <record internalId="-5" xsi:type="ns9:Employee" 
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xmlns:ns9="urn:employees_2017_1.lists.webservices.netsuite.com">
         <ns9:entityId>A Wolfe</ns9:entityId>
         <ns9:isInactive>false</ns9:isInactive>
         .
         ...[more fields]
         .
      </record>
   </readResponse>
</readResponseList>
</getListResponse>
 </soapenv:Body> 

        

C#

          private int getCustomerList()
{
   // This operation requires a valid session
   this.login( true );
   
   // Prompt for list of nsKeys and put in an array
   _out.write( "\nnsKeys for records to retrieved (separated by commas): " );
   String reqKeys = _out.readLn();
   string [] nsKeys = reqKeys.Split( new Char[] {','} );
   
   return getCustomerList( nsKeys, false );
} 

        

Java

          public int getCustomerList() throws RemoteException,
ExceededUsageLimitFault, UnexpectedErrorFault, InvalidSessionFault,
ExceededRecordCountFault {
   // This operation requires a valid session
   this.login(true);
   
   // Prompt for list of nsKeys and put in an array
   _console
   .write("\nnsKeys for records to retrieved (separated by commas): ");
   String reqKeys = _console.readLn();
   String[] nsKeys = reqKeys.split(",");
   
   return getCustomerList(nsKeys, false);
} 

        

Related Topics

General Notices