Hi all! I have an issue that someone might have al...
# suitescript
d
Hi all! I have an issue that someone might have already had in the past. I'm using a client script to dynamically show/hide a SalesOrder field based on the value of another field (triggered by fieldChanged). It works perfectly, but only if the field was initially visible when entering edit mode. Is there something obvious I'm missing?
m
If i remember correctly fields that are hidden onload are not loaded into the DOM so the field does not exist for the client script to act on
d
Thanks @Menno Janssen I suspected something like that. For now I sticked to make field disabled instead of hidden. Do you know if there is maybe a workaround?
m
do you hide the field on user event script? you might try to hide it with the client script, then it should remain available
d
Yes, I use UserEvent to hide it. The problem is that the field should be hidden by default and only appear when another field changed to specific value.
b
Your basic options are to either start with the field visible and then hide it as soon as possible
Or start with the field hidden and use javascript to add the missing dom element so that you can use auitescript to unhide the field
d
Ok, thank you @battk and @Menno Janssen!