Slackbot
02/21/2022, 10:02 AMDmitry Masanov
02/21/2022, 10:51 AM7px
02/22/2022, 12:17 AMfunction beforeLoadFunc(context) {
var idcheck = context.newRecord.id;
var rec = record.load({
type:"customrecord_test",
id: idcheck
});
var recfield = rec.getValue({
fieldId:"custrecord_testbool"
});
if(context.type == context.UserEventType.VIEW
&& recfield == true) {
//button is displayed
} else {
//button doesn't show
}
}
I know I can't use currentRecord as that's a ClientScript-only module. Maybe I'm missing something?jen
02/22/2022, 6:36 PMcontext.newRecord.id
should work in beforeLoadjen
02/22/2022, 6:37 PMlog.debug({title: 'id', details: idcheck});
in there?