RE: Netsuite get records using Sales Order Internal ID
I am using the PHP Toolkit to retrieve Netsuite Sales Order details using pre-built search techniques. I have the internal ID of a sales order, and I want to retrieve records linked to that sales order, such as invoices, cash sales, RMAs, etc. If you have any insights on this or sample code, please update or share it.
I’m happy to help! Here’s how you can use the PHP Toolkit to retrieve linked records from a NetSuite sales order:
1. Identifying Linked Record Types:
First, determine the specific types of linked records you’re interested in (invoices, cash sales, RMAs, etc.). Each record type has its own internal ID and search criteria. Here are some common examples:
- Invoice: RecordType::INVOICE, search criteria:
internalid = '<span class="math-inline">\{salesOrderId\}'\* **Cash Sale:** RecordType::CASH_SALE, search criteria: `createdfrom.internalid = ‘{salesOrderId}’` - RMA: RecordType::RETURN_AUTHORIZATION, search criteria:
salesorder.internalid = '${salesOrderId}'