Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

SR Behaviour - Change field value on screen

Rob B
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 3, 2022

I want to change the value of a drop down field on the screen when another field has been changed. Why does this not work?

 

def selectListConsent = getFieldById(getFieldChanged())
selectListConsent.clearError()

String selectListConsentValue = selectListConsent.getValue()
def requiredValue = (selectListConsentValue == "ValueXXX")

def cfImpact = getFieldByName("All Meters Impacted")

if (requiredValue == true){
cfImpact.setFormValue("ValueZZZ")


}

 

1 answer

0 votes
Florian Bonniec
Community Champion
November 3, 2022

Hi @Rob B 

You will need to find where the issue is.

 

def selectListConsent = getFieldById(getFieldChanged())
selectListConsent.setDescription("Select List Consent")
String selectListConsentValue = selectListConsent.getValue()

def cfImpact = getFieldByName("All Meters Impacted")
cfImpact.setDescription("Impact Field")

if (selectListConsentValue == "ValueXXX"){
cfImpact.setFormValue("ValueZZZ")
cfImpact.setDescription("Impact Field passed condition")

}

 

If you see the description "Select List Consent" under the field means that you get the proper field.

If you see the description "Impact Field" under the field means that you get the proper field.

If you see the description "Impact Field passed condition" under the field means that you get the proper field and the condition is true., 

 

Regards

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
17.13.1
TAGS
AUG Leaders

Atlassian Community Events