Aaron McCausland
05/22/2026, 1:26 PMCeligo AI
05/22/2026, 1:26 PMAI generated answer (using internal Slack threads):The
TRANS_UNBALNCD error occurs when a transaction is not in balance. This can happen when you are trying to modify a transaction after it has been posted, which can cause an imbalance in the amounts due to changes in tax or other fields.
In the context of SuiteScript, this error can occur when you are trying to update a Sales Order and the changes you are making are causing the transaction to be out of balance. For example, if you are updating the amount and rate fields in a line item, and the new values are causing the total transaction amount to be different from the original total, you will get this error.
To intentionally cause this error when saving an Opportunity, you can do the following:
1. Create an Opportunity with a certain total amount.
2. Use SuiteScript to load the Opportunity record in dynamic mode.
3. Modify the amount or rate field in a line item in such a way that the new total transaction amount is different from the original total.
4. Try to save the record.
Here is a simplified example of how you can do this:
javascript
var rec = record.load({
type: record.Type.OPPORTUNITY,
id: opportunityId,
isDynamic: true,
});
rec.selectLine({
sublistId: 'item',
line: 0
});
rec.setCurrentSublistValue({
sublistId: 'item',
fieldId: 'amount',
value: newAmount, // Set this to a value that will cause the total to be different from the original total
});
rec.commitLine({
sublistId: 'item'
});
try {
var recordId = rec.save();
} catch (e) {
log.error({
title: 'Error saving record',
details: e
});
}
Remember to replace opportunityId and newAmount with your own values.
******
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
05/22/2026, 1:26 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.808288693
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.796508849
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.796142578
Celigo AI
05/22/2026, 1:26 PM