Need help to write UI Policy Script for a custom created field visibility

Snow Angel
Tera Expert

I need to write a script for a custom created field's visibility (custom field name "Justification"). It needs to be displayed and become mandatory must only if "Score" field is manually updated. The condition builder does not have options for "Score" manual update. 

Can someone help me write this script? I am new to scripting. Thanks

 

1 ACCEPTED SOLUTION

So:

Since the only other means that updates the Demand most likely take place on the server-side(business rules, flow, workflows - potentially UI actions etc) you should not be concerned about how you can identify if this was updated manually.

However, I would write an onChange Client Script for the field "score" which states the following:

if (newValue == '')

return;

else {

g_form.setVisible('justification',true);

g_form.setMandatory('justification',true);

}

Please give it a try and provide feedback.

Tudor

View solution in original post

6 REPLIES 6

@Tudor Hi - Although the suggested client script is working ; however the "justification" field does pop up in "screening" state (after assessment is done, the score field is updated, causing the field to appear due to client script) but it supposed to appear only if its updated manually in "qualified" state. Below is the script I wrote , what can be tweaked to achieve this. I mean how to add "State" = "Qualified" in the existing client script. TIA

 //Type appropriate comment here, and begin script below
    if (newValue == "")
        return;
    g_form.setVisible('u_justification_for_adjusting_score', true);
    g_form.setMandatory('u_justification_for_adjusting_score', true);
}

Snow Angel
Tera Expert

Anyone??