I was looking for a way to make the department fie...
# suitescript
c
I was looking for a way to make the department field on the sublist line of a JE mandatory depending on the account they choose. I created a Client script to prompt dialog box, but it felt a bit clunky. Would a UE script make more sense in this situation? I was thinking I could use Before Submit, but I believe the end result would be the same. I was trying to think of a way to get the red * appear on the form once they select an appropriate account.
b
there isnt really a point doing that beforeSubmit
the user has already submitted the record at that time
c
ah ok I thought Before Submit may stop the submit from happening. I guess Client Script will be the best way to handle this.
thanks
j
you will need 2 scripts, client side to do conditional check on account and validate department, server side user event before submit to throw error, only one script will still allow - having done the exact thing
c
I used a CS to get it to throw an error when validating the line, which seemed like it would stop the user from creating the line in the first place. However I didn't fully test if there was some way around it, I was just testing the dialog box. I'll take a look at that when I get to that point. Thanks