mescalante
03/05/2025, 1:18 AMCeligo AI
03/05/2025, 1:18 AMAI generated answer (using internal Slack threads):To block users from updating the Rate on the Order Items screen, you would need to create a script that disables the rate field on the transaction line. You might also want to disable the total amount field. Here is a sample script that disables the quantity field if the status of the record is 'fullyBilled'. You can modify this script to disable the rate field instead:
javascript
/**
* @NApiVersion 2.x
* @NScriptType UserEventScript
*/
define(['N/ui/serverWidget'],
function(serverWidget) {
function beforeLoad(scriptContext) {
var record = scriptContext.newRecord;
var status = record.getValue('statusRef');
if(status === 'fullyBilled'){
scriptContext.form.getSublist('item').getField('rate').updateDisplayType({displayType: serverWidget.FieldDisplayType.DISABLED});
}
}
return {
beforeLoad: beforeLoad
};
});
This script should be deployed to the roles that you want to restrict.
******
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
03/05/2025, 1:19 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.80186969
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.791107
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.790611267
Celigo AI
03/05/2025, 1:19 AMCeligo AI
03/05/2025, 1:26 AMCeligo AI
03/05/2025, 1:26 AM