James Morris
03/04/2025, 4:49 PMCeligo AI
03/04/2025, 4:49 PMAI generated answer (using internal Slack threads):****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ****** Based on the conversations, it seems that you can't directly make the Amortization Start Date field mandatory on the form level. However, you can achieve this requirement through SuiteScript. Here is a sample client script that you can use:
javascript
/**
* @NApiVersion 2.x
* @NScriptType ClientScript
*/
define(['N/ui/dialog'], function(dialog) {
function saveRecord(context) {
var currentRecord = context.currentRecord;
var lineCount = currentRecord.getLineCount({sublistId: 'item'});
for (var i = 0; i < lineCount; i++) {
var amortizationSchedule = currentRecord.getSublistValue({sublistId: 'item', fieldId: 'amortizationschedule', line: i});
var amortizationStartDate = currentRecord.getSublistValue({sublistId: 'item', fieldId: 'amortizationstartdate', line: i});
if (amortizationSchedule && !amortizationStartDate) {
dialog.alert({
title: 'Error',
message: 'Amortization Start Date is required when an Amortization Schedule is selected.'
});
return false;
}
}
return true;
}
return {
saveRecord: saveRecord
};
});
This script will prevent the record from being saved if an Amortization Schedule is selected but the Amortization Start Date is not filled in. You can deploy this script to your Bills, Bill Credits, and Journal Entries records.Celigo AI
03/04/2025, 4:49 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.861160159
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.852884233
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.848716378
Celigo AI
03/04/2025, 4:49 PMCeligo AI
03/04/2025, 4:56 PM