does anyone know what I could use to hide a field ...
# suitescript
m
does anyone know what I could use to hide a field on a form before load.. currently it's not working, I tried with pageinit and it works however not on load? attached in the comment
define([], function () {
function pageLoad(context) {
var record = context.currentRecord;
var field = record.getField({
fieldId: 'custpage_temp_organic'
});
field.isDisplay = false;
}
return {
pageLoad: pageLoad
};
});
m
I believe the beforeLoad function isonly available to UserEvent scripts.
s
Is the above code for beforeLoad User Event ?
On return make - beforeLoad: pageLoad
a
yeah
pageLoad
isn't a thing
pageInit
is a Client Script entry point
beforeLoad
is a User Event Script entry point
if you want to do this in a UE before load you need to use the form object from the context
context.form
and then get the field from that FORM, your code is trying to get the field from the record, which doesn't have an
isDisplay
to reference
2
s
perhaps chatgpt to blame for the
pageLoad
?
😂 2