GetByKey Method (SO)
- Last UpdatedNov 06, 2025
- 2 minute read
The GetByKey() method retrieves the specified sales order record from the SO table.
The sales order is uniquely identified by the combination of the customer ID and purchase order ID in the sales order record.
Parameters
- custId
- Required. Holds the customer ID.
- poId
- Required. Holds the ID of the customer's purchase order.
Return Value
Returns a DataSet that contains the DataRow of the specified sales order in the SO table. If no matching record for the specified sales order is found, an empty DataSet is returned.
The columns of the returned DataSet are described below.
|
Column Names |
Description |
|---|---|
|
cust_id |
A string that is the customer ID. |
|
po_id |
A string that is the customer's purchase order ID. |
|
date_received_utc |
A datetime that indicates when the sales order was received, in UTC. |
|
date_received_local |
A datetime that is the time when the sales order was received in the local time of the entity specified by ship_from, if supplied. If a ship-from entity is not specified, the default time zone will be used to determine the local time. |
|
purchaser_id |
An integer that is the ID of the purchaser in the Cust_Contact table. |
|
ship_from |
An integer that is the ID of the entity from which the order is expected to ship. |
|
so_id |
A string that is the internal sales order. |
|
state_cd |
An integer that indicates the state of the sales order: 0=Open 1=Partial Complete 2=Closed |
|
notes |
A string that is the notes for the sales order. |
|
spare1 |
A string that is the content of the user-defined spare1 field. |
|
spare2 |
A string that is the content of the user-defined spare2 field. |
|
spare3 |
A string that is the content of the user-defined spare3 field. |
|
spare4 |
A string that is the content of the user-defined spare4 field. |
|
last_edit_comment |
A string that contains comments about why the record was added or updated. |
|
last_edit_by |
A string that is the ID of the user who added or last updated this record. |
|
last_edit_at |
A datetime that indicates when the record was added or last updated. |
|
mod_id |
The current modification ID of the record in the table. This ID is binary number that increments each time the record’s table row is modified. Optionally used for optimistic concurrency control when performing updates or deletes. |