How to Make variables readOnly after approval

AP30
Tera Expert

Hello,

I am looking to set the variables on RITM to read-only after final approval.

The flow on the request is that first group (Group Tech) reviews the first RITM and approves then sends to second group (Group Bravo) that will review the second RITM variables, edit as needed. After the second group reviews and approves, we want all the variables to be read only.

Looks like a client script will work but haven't been able to get it working correctly.

Thanks for your help.

2 REPLIES 2

Kieran Anson
Kilo Patron

Hey AP,

If the 'approval' field is on the form you can use the following code to set the fields read only when approval = approved. The field needs to be on the form, but can be hidden with a UI policy, in order for the g_form api to access the value.

function onLoad() {
    if (g_form.getValue('approval') == "approved") {
        g_form.setVariablesReadOnly(true);
    }
}

If my reply helped with your issue please mark helpful 👍 and correct if your issue is now resolved.
By doing so you help other community members find resolved questions which may relate to an issue they're having.

Hi, Checking in on whether my reply resolved your issue? If so please Mark Correct and /or 👍 Helpful if you find my response worthy based on the impact.
By doing so you help other community members find resolved questions which may relate to an issue they're having.