Luis
11/29/2024, 6:14 PMCeligo AI
11/29/2024, 6:15 PMAI generated answer (using internal Slack threads):To add an "extra fee" on a sales order and have it included in the total, you can use a SuiteScript. Here's a general idea of how you can do it: 1. Create a custom field for the "extra fee". You've mentioned that you already have this, so you can skip this step. 2. Write a SuiteScript that triggers on the 'beforeSubmit' event of the sales order. This script should retrieve the value of the "extra fee" custom field and add it to the total of the sales order. Here's a basic example of how the SuiteScript might look:
javascript
function beforeSubmit(type){
if(type == 'create' || type == 'edit'){
var record = nlapiGetNewRecord();
var extraFee = record.getFieldValue('custbody_extra_fee'); // replace 'custbody_extra_fee' with the id of your custom field
var total = record.getFieldValue('total');
total = parseFloat(total) + parseFloat(extraFee);
record.setFieldValue('total', total);
}
}
Please note that this is a simplified example and might need to be adjusted to fit your specific needs. Also, remember to deploy the script and associate it with the sales order 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
11/29/2024, 6:15 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.819501162
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.817725539
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.811076
Celigo AI
11/29/2024, 6:15 PM