Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×Hi everyone,
I'm trying to write a script on Behaviours display or hide a field based on option selected from another field.
On a workflow transition screen, I have 3 fields:
If the user selects "YES" in Routine (customfield_18602) , then Fin Approve (customfield_18603) appear and CEO Approve (customfield_18604) should be hidden.
If the user selects any other value, then CEO Approve (customfield_18604) appear and Fin Approve (customfield_18603) should be hidden.
Please help me with this problem!
Thanks for your view and hope to your comment.
Hi @Thảo Nguyễn ,
please try the floowing code in your behaviour associate to Routine field :
def routineField = getFieldByName("Routine");
def finApproveField = getFieldByName("Fin Approve");
def ceoApproveField = getFieldByName("CEO Approve");
String routine = routineField.getValue()
if("YES".equalsIgnoreCase(routine)){
finApproveField.setHidden(false);
ceoApproveField.setHidden(true);
} else {
finApproveField.setHidden(true);
ceoApproveField.setHidden(false);
}
Thanks for your scripts. But I mean that when the user selects "YES" in Routine then CEO Approve(customfield_18604) should be hidden immediately on the screen.
I try on Routine field with Select List type and Radio button type but it doesn't work.
Please help me if there is any solutions about it.
Thank you so much,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is ROutine a select list field or a radio button?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I try 1 Routine field is Select list and 1 Routine field is radio buttton.
But they don't work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My code is for a select list filed. Please add this code to field "Routine" so it works each time that user cahnge its value.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you so much,
It's my mistake when add script in Initialiser. I added it on field "Routine" and it works well.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you're welcome @Thảo Nguyễn
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.