Interesting tidbit: I need to hide 'all' empty fie...
# suitescript
s
Interesting tidbit: I need to hide 'all' empty fields on a custom record... beforeLoad UE does not return empty text fields when calling
scriptContext.newRecord.getFields();
To get all record fields, I am using
record.create().getfields();
which supplies all of the fields in the resulting array Does anyone have a better solution/option?
d
This is what I do as well. However, depending on the form you might not get all the fields.
s
good point!
c
just curious what is a use case for hiding the empty fields
s
In this case, the fields needing to be hidden will be displayed when users change fields like 'transaction type', and if they are displayed, it's confusing.
d
I hate to say it but a workflow might be a good option
s
I also found that
form.getField().type
is lowercase, and the ENUM for
serverWidget.FieldType
is upper case.. so a direct comparison isn't possible without re-casing the strings..