razer456
09/17/2021, 12:24 PMvar createdFrom = currentRecord.getValue({
fieldId: "createdfrom",
});
it shows emptyNickSuite
09/17/2021, 1:36 PMSciuridae54696d
09/17/2021, 3:07 PMrazer456
09/17/2021, 5:18 PM//script to call suitelet that will in turn validate the approverlist in purchase order
define([
"N/url",
"N/https",
"N/log",
"N/search",
"N/runtime",
"N/currentRecord",
], function (url, https, log, search, runtime, currentRecord) {
function saveRecord(context) {
//get current transaction record
var currentRecord = context.currentRecord;
var importedFromProspectCheckBox = currentRecord.getValue({
fieldId: "custbody_cet_imported",
});
var createdFrom = currentRecord.getValue({
fieldId: "createdfrom",
});
if(!createdFrom)
{
//get values by using getValue method
var approverList = currentRecord.getValue({
fieldId: "custbody_cet_approverlist",
});
if (approverList == "") {
alert("Please select approver");
return false;
} else if (createdByFld == approverList) {
alert("You cannot select yourself as an approver");
return false;
}
}
NickSuite
09/20/2021, 5:07 AM