DX
03/26/2019, 3:55 AMNik
03/26/2019, 4:24 AMKevin
03/26/2019, 5:21 AMDX
03/26/2019, 9:04 AMfunction clientFieldChanged(type, name, linenum){
if(type == 'line'){ //checks if the field changed is under sublist 'Lines'
if(name == 'account'){ //checks if the field changed is 'Account'
var account = nlapiGetCurrentLineItemValue('line', 'account');
var index = nlapiGetCurrentLineItemIndex('line');
}
}
}
function clientValidateLine(type){
var currAccount = nlapiGetCurrentLineItemValue('line', 'account');
var boolComplete = true;
var i = 0;
var fieldName = ['2271']; //internalid of fields that will be mandatory
if(currAccount == '115'){ //checking if account selected is one of the certain accounts
while (i < fieldName.length && boolComplete == true){ //iterate through each required field
if(nlapiGetCurrentLineItemValue('line', fieldName[i]) == ''){ //check if customer left the required field blank when adding line item
alert(fieldName[i] + ' field for \'' + nlapiLookupField('account', currAccount, 'name') + '\' account must be filled in.');
boolComplete = false; //set to false so the user cannot add the line item
}
i++;
}
}
return boolComplete;
}