function validateLine (context) {
var currentRecord = context.currentRecord;
var sublistName = context.sublistId;
if(sublistName == 'item'){
var userObj = runtime.getCurrentUser();
var user_role = userObj.role;
var roleList = [1015,1016,1021,1063,1022,1020,1059,1055,3];
var poID = currentRecord.getCurrentSublistValue ({
sublistId: 'item',
fieldId: 'createpo'
});
if(!isEmpty(poID)){
if(roleList.indexOf(user_role)<0){
alert("PO attached to this line item; changes are not allowed.");
return false;
}
}
return true;
}
}