If the sales order record item is a kit, loop over...
# ask-stanley-ai
s
If the sales order record item is a kit, loop over kit items.
Copy code
<#assign itemsList = [] />
<#list record.item as item>
   <#assign kitItems = [] />
   <!-- todo: collect names and quantities of kit items -->
   <#assign itemObject = {
      "sku": item.custcol_item_sku,
      "quantity": item.quantity,
      "amount": item.amount,
      "kititems": kitItems
   }/>
  <#assign itemsList = itemsList + [itemObject]/>
</#list>
c
AI generated answer (using internal Slack threads):
The first thread discusses how to loop through items on a sales order for an email template. The user initially tried using
record.item
but it didn't work. Another user suggested using
transaction.item
instead. The second thread is about a user who needs to replace a kit item with its components in a scheduled script for Sales Orders. However, when updating the order source, the kit SKU needs to be sent again. Several suggestions were made, including using a custom field or record to remember the kit SKU, or a custom column on the line with the kit SKU. The user was also advised to be careful about shipping partial kits. The third thread is about a user trying to make as few calls as possible to get all the item details off a Sales Order's sublist. They tried using a for-in loop, but it only returned the methods attached to the nlobjRecord. Another user suggested using the NetSuite FastTrack Toolkit (NFT), which simplifies accessing a SalesOrder item sublist as a simple array-like collection of JavaScript objects. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.840397716
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.832450747
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.82908237
Please provide your feedback on this answer.