is there any way to get the displayType of a field...
# suitescript
w
is there any way to get the displayType of a field in beforeLoad? I want to add a custpage field based on the visibility status of another.
n
So you want to look at field A and determine if it's displayType and based on that set the displayType of another field?
w
no, I want to check displayType of field A and if it is visible I want to use form.addField() to add another one.
I have several forms for the record type and I want the new field to only show on some of them. The same forms where field A is shown. Now I base it on the formId instead.
n
🤦‍♂️ Sorry comprehension fail on my part. I'm not sure you can in a UE. you might be able to getField and then look at it's properties. This might entail .stringify of the field object and then toJSON() to make it a native object. Might be worth a try.
w
I've logged the form.field and rec.field but there are no properties for displayType or isDisplay (as on client script)
n
Hmm, I suspect it's the usual, NetSuite gives you something handy like updateDisplayType but just misses the mark in terms of functionality you'd think would be standard 😞 I've had something similar recently had to use dodgy inline html to hide some details on a page based on a status / user / employee field on a record. Sorry I don't have an answer maybe when the USA come online later some clever soul will be able to help.
w
Thanks anyways! I bet there is some handy trick like "oh, you just need to pull out the field and check if the undocumented property X exists on it"
🤭 1