Aaron McCausland
02/19/2026, 5:26 PMCeligo AI
02/19/2026, 5:26 PMAI generated answer (using internal Slack threads):In order to copy fields and line items from a Purchase Order referenced on one of the Bill's custom fields into the Bill, you can use a combination of SuiteScript and workflows. Here's a step-by-step guide: 1. Create a custom field on the Vendor Bill to store the reference to the Purchase Order. This field will be used to link the Purchase Order to the Vendor Bill. 2. Use a User Event script or a workflow to populate this custom field with the internal ID of the Purchase Order when the Vendor Bill is created. 3. In the same script or workflow, use the
record.load method to load the Purchase Order record using the internal ID stored in the custom field.
4. Once the Purchase Order record is loaded, you can access its fields and line items using the getValue and getSublistValue methods respectively.
5. Use the record.setValue and record.setSublistValue methods to copy the values from the Purchase Order to the corresponding fields and line items on the Vendor Bill.
6. Finally, save the Vendor Bill record using the record.save method.
Here's a sample SuiteScript code snippet that demonstrates this process:
javascript
var poId = vendorBillRecord.getValue('custbody_po_reference');
var poRecord = record.load({
type: record.Type.PURCHASE_ORDER,
id: poId
});
var poField1Value = poRecord.getValue('field1');
vendorBillRecord.setValue('field1', poField1Value);
var poLineItem1Value = poRecord.getSublistValue({
sublistId: 'item',
fieldId: 'item',
line: 0
});
vendorBillRecord.setSublistValue({
sublistId: 'item',
fieldId: 'item',
line: 0,
value: poLineItem1Value
});
vendorBillRecord.save();
Please replace 'custbody_po_reference', 'field1', and 'item' with the actual IDs of your custom field, field, and line item respectively.
******
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
02/19/2026, 5:27 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.849731505
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.840820372
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.83996594
Celigo AI
02/19/2026, 5:27 PM