Steven Craig
04/29/2026, 2:58 PMCeligo AI
04/29/2026, 2:58 PMAI generated answer (using internal Slack threads):Based on the conversations, it seems that you can't directly set the 'Create PO' field on the Sales Order line to link to an existing Purchase Order (PO) in NetSuite. This field is system controlled and is used to generate a new PO when the Sales Order is approved, it's not designed to link to an existing PO. However, you can create a workaround by using a custom transaction line field on the Sales Order. This field can be used to store the internal ID of the related PO. You can then use SuiteScript to set this custom field when the Sales Order is saved. Here's a basic example of how you might do this:
javascript
var salesOrder = record.load({
type: record.Type.SALES_ORDER,
id: salesOrderId,
isDynamic: true
});
var lineCount = salesOrder.getLineCount({sublistId: 'item'});
for (var i = 0; i < lineCount; i++) {
var poId = salesOrder.getSublistValue({
sublistId: 'item',
fieldId: 'yourCustomFieldId', // replace with your custom field ID
line: i
});
if (poId) {
salesOrder.setSublistValue({
sublistId: 'item',
fieldId: 'yourCustomFieldId', // replace with your custom field ID
line: i,
value: poId
});
}
}
salesOrder.save();
This script loads the Sales Order, iterates over each line, and if the custom field has a value (the internal ID of the PO), it sets the custom field with that value. The Sales Order is then saved, storing the link to the PO.
Remember to replace 'yourCustomFieldId' with the actual ID of your custom field.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
04/29/2026, 2:58 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.86315918
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.859680176
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.852294922
Celigo AI
04/29/2026, 2:58 PM