Hi Team,
I have a requirement to disable the Custom field "Group" and "User" once the value from "option" custom field is returned as "Add Group".
Below is the piece of code i am trying. And it is not working. I need to disable this at screen level. A early reply will be appreciated as need this functionality for my prod release.
def option = getFieldById("customfield_18404")
def Group = getFieldById("customfield_18405")
def User = getFieldById("customfield_18406")
String optionVal = option.getFormValue();
if(optionVal.equals("Add Group")){
Group.setReadOnly(true);
} else {
Group.setReadOnly(false);
}
if(optionVal.equals("Add Group")){
User.setReadOnly(true);
} else {
User.setReadOnly(false);
}
Hi @mohit panwar May i know the field type of Option field ?
If it's dropdown :-
def option = getFieldById("customfield_18404")
if (option.getValue() == "Add Group")
def option = getFieldById(getFieldChanged())
def option_value = option.getValue()
formField.getValue()
Gets the value that is current in the form. For certain fields, this does do some conversions.
Select fields, radio buttons, checkboxes, etc. the string value will be returned, or a List of string values.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks. Option is the Radio Button.
def option = getFieldById(getFieldChanged())
def option_value = option.getValue()
What should be the value of "getFieldChanged" here ? what parameter need to be passed in this function.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@mohit panwar you have to apply server side script on Option field.
getFieldChanged :- Gets the ID of the field that this script is attached to.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Code should be like this :-
def option = getFieldById(getFieldChanged())
def Group = getFieldById("customfield_18405")
def option_value = option.getValue()
if (option_value == "Add Group") {
Group..setReadOnly(true)
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.