Mike Casey
08/26/2024, 7:13 PMCeligo AI
08/26/2024, 7:14 PMAI generated answer (using internal Slack threads):****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ****** To set a custom shipping address on a Sales Order using SuiteScript's record module, you need to manipulate the
shippingaddress
subrecord. Here's a general approach:
1. Get the shippingaddress
subrecord from the Sales Order record.
2. Set the fields on the shippingaddress
subrecord with the custom address details.
3. Replace the value of the shipaddress
field with the value of the addrtext
field from the shippingaddress
subrecord.
Here's a simplified example:
javascript
var salesOrderRecord = record.load({
type: record.Type.SALES_ORDER,
id: 'your_sales_order_id'
});
var shippingAddressSubrecord = salesOrderRecord.getSubrecord({
fieldId: 'shippingaddress'
});
shippingAddressSubrecord.setValue({
fieldId: 'addr1',
value: '123 Custom St'
});
// Repeat for other address fields as necessary
salesOrderRecord.setValue({
fieldId: 'shipaddress',
value: shippingAddressSubrecord.getValue({fieldId: 'addrtext'})
});
salesOrderRecord.save();
Please note that this is a simplified example and you may need to adjust it to fit your specific needs. Also, remember to replace 'your_sales_order_id'
with the actual ID of the Sales Order you're working with.Celigo AI
08/26/2024, 7:14 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.875632763
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.858413815
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.853143156
Celigo AI
08/26/2024, 7:14 PM