How to make the custom field “Change Template” read‑only only in the SOW view

Angel k
Tera Contributor

I am working on an SOW story and need guidance on configuring the Change Template field. My requirement is to make this field read‑only in the SOW view, while ensuring that it remains editable in the default Change form.  

 

Could someone suggest the best approach to achieve this without impacting the default Change form behavior?  

1 REPLY 1

Vishal Jaswal
Giga Sage

Hello @Angel k 

Create UI Policy as shown below:

VishalJaswal_0-1778866944648.png

Execute if true:

function onCondition() {
	alert(g_form.getViewName()); //comment this
    if (g_form.getViewName() == 'sow') {
    g_form.setReadOnly('u_change_template', true);
}
}


Execute if false:

function onCondition() {
    if (g_form.getViewName() == 'workspace') {
        g_form.setReadOnly('u_change_template', false);
    }
}


Validation Results:

Service Operations Workspace:

VishalJaswal_1-1778867006917.png



Native UI:

VishalJaswal_2-1778867033135.png

 

 


Hope that helps!