KnotKnick
12/20/2021, 2:40 PMif (sublistName === 'item') {
if (sublistFieldName === 'custcol_start_date') {
var start_date = currentRecord.getCurrentSublistValue({
sublistId: sublistName,
fieldId: sublistFieldName
});
var end_date = currentRecord.getSublistValue({
sublistId: sublistName,
line: line,
fieldId: 'custcol_end_date'
});
if(!moment(start_date).isSameOrBefore(end_date)){
dialog.alert({
title: 'Start Date can not be after End date',
message: 'Click OK to continue.'
})
return false;
}
}
}
return true;
When I deploy this code, the validation works and the dialog appears, but when I click OK on the dialog box, nothing happens and the screen kind of freezes there. What am I missing here?
Is using a dialog box in this scenario not a good idea?battk
12/20/2021, 3:26 PMbattk
12/20/2021, 3:26 PMbattk
12/20/2021, 3:26 PMKnotKnick
12/20/2021, 3:34 PMbattk
12/20/2021, 3:36 PMKnotKnick
12/20/2021, 3:38 PMbattk
12/20/2021, 3:52 PMKnotKnick
12/20/2021, 4:14 PMcurrentRecord.setCurrentSublistValue({
sublistId: sublistName,
fieldId: 'custcol_start_date',
line: line,
value: null
});