When I validate line on item sublist for a field ...
# suitescript
t
When I validate line on item sublist for a field
function drawVerifyValidateLine(type) {
if (type == 'item') {
var isVerified = nlapiGetCurrentLineItemValue('item', 'custcol_drawing_verification');
if (isVerified !== 'T') {
alert("You must check drawing verification for this service item.");
return false;
}
return true;
}
}
This works , but there is another custom sublist in custom tab, that misbehaves due to this. I am not able to add item in that custom list(add operation is rejected). When I undeploy my client script (code above), this custom sublist again starts working normally. What am I doing wrong ?
m
you should return true outside of the if
not inside
because you return true only for sublist type item, for any other you get undefined which is falsy
so any other list is blocked obviously
t
ohh, I got it. Thanks a lot @mizax, have a good day !