Notifications

21 views

Issue

Symptoms

Annotations not visible for all users when UI Policy script is active comparing user to field value 

Release

All releases

Cause

Cannot use "current" or "gs" in client side scripting 

Resolution

Since UI policies run client side. You cannot us "current' or "gs". This causes the form to break and your UI policy to not execute. Instead use support client side APIs such as "g_user" and "g_form".

Original:

function onCondition() { 
//comparing current logged in user to selected user value in fields, then reverse if false for currUser; 
var currUser = gs.getUserDisplayname()
if(currUser !=current.u_testField){ 
g_form.setReadOnly('reference_test', true); 

 

Change to:

Execute if true: 

function onCondition() { 
//comparing current logged in user to selected user value in fields, then reverse if false for currUser; 
var currUser = g_user.getUserID(); 
if(currUser != g_form.getValue('u_testField')){ 
g_form.setReadOnly('reference_test', true); 

Article Information

Last Updated:2019-08-02 20:44:10
Published:2019-05-06