mightyd3
04/26/2025, 4:39 PMCeligo AI
04/26/2025, 4:39 PMAI generated answer (using internal Slack threads):When multiple currencies are enabled in NetSuite, the item vendor pricing does indeed have a subrecord. This is because each vendor price can be set in a different currency, and these are stored as subrecords of the item record. Here is an example of how you can set the vendor price in a specific currency:
javascript
const preferred_vendor_line = itemRecord.findSublistLineWithValue({
sublistId: 'itemvendor',
fieldId: 'preferredvendor',
value: true
});
itemRecord.selectLine({
sublistId: 'itemvendor',
line: preferred_vendor_line
});
const subrecord = itemRecord.getCurrentSublistSubrecord({
sublistId: 'itemvendor',
fieldId: 'purchaseprice'
});
subrecord.setValue({
fieldId: 'currency',
value: currencyId // replace with the internal id of the currency
});
subrecord.setValue({
fieldId: 'value',
value: parseFloat(price || '0').toFixed(2)
});
itemRecord.commitLine({
sublistId: 'itemvendor'
});
itemRecord.save({
ignoreMandatoryFields: true
});
This code first finds the preferred vendor line, then selects it. It then gets the purchase price subrecord and sets the currency and value. Finally, it commits the line and saves the record.
******
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/26/2025, 4:39 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.870175421
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.848413825
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.841038525
Celigo AI
04/26/2025, 4:39 PM