Ask Your Question

Revision history [back]

To determine the subtype of an item on the order line in SuiteTalk, you can use the following steps:

  1. Retrieve the order using the "get" operation in SuiteTalk.
  2. Iterate through the order lines using a loop.
  3. For each order line, retrieve the item using the "get" operation in SuiteTalk.
  4. Check the "subtype" field of the item to determine its subtype.

Here's some sample code in SuiteTalk (using PHPToolkit) that demonstrates this approach:

$order = $service->get(new RecordRef("salesOrder", $orderId));
$orderLines = $order->itemList->item;
foreach ($orderLines as $line) {
  $item = $service->get($line->item);
  $itemSubtype = $item->subtype;
  // do something with itemSubtype
}

Note that the "subtype" field is only present for certain item types (such as inventory items), so you may need to handle cases where it is not present.