Which Item sublist fields on a transaction record ...
# ask-stanley-ai
a
Which Item sublist fields on a transaction record loaded in dynamic mode, when changed, also change the amount field?
c
AI generated answer (using internal Slack threads):
When a transaction record is loaded in dynamic mode, changing the following Item sublist fields will also change the amount field: 1. Quantity: This field represents the number of items in the transaction. Changing this value will affect the total amount as the amount is calculated by multiplying the quantity by the rate. 2. Rate: This field represents the price per unit of the item. Changing this value will affect the total amount as the amount is calculated by multiplying the quantity by the rate. 3. Discount: If there are any discounts applied to the item, changing this value will also affect the total amount. Here is an example of how you can change these fields using SuiteScript:
Copy code
javascript
var rec = record.load({
    type: record.Type.SALES_ORDER,
    id: '123',
    isDynamic: true,
});

rec.selectLine({
    sublistId: 'item',
    line: 0
});

rec.setCurrentSublistValue({
    sublistId: 'item',
    fieldId: 'quantity',
    value: 10
});

rec.setCurrentSublistValue({
    sublistId: 'item',
    fieldId: 'rate',
    value: 20
});

rec.commitLine({
    sublistId: 'item'
});
In this example, the quantity and rate fields are changed for the first line of the item sublist on a sales order record. The amount field will be automatically updated based on these changes. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.8439942
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.833313048
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.831909239
Please provide your feedback on this answer.