How to make a field read only only if its a new record using UI Policy script

Alon Grod
Tera Expert

Hi,

I have a requirement to make the field assignment_group on the incident table as Read Only, only if its a new record.
Is there any way to make a field read only only if its a new record using UI Policy script? Please dont suggest using client script

1 ACCEPTED SOLUTION

@Alon Grod 

 

yes, also pls use the below script

 

if(g_form.isNewRecord() ){

g_form.setReadOnly("assignment_group",'true'); // single quote was missing

}

View solution in original post

3 REPLIES 3

Prince Arora
Tera Sage
Tera Sage

@Alon Grod 

 

You can use:

if(g_form.isNewRecord() ){

g_form.setReadOnly("assignment_group",true');

}

 @Prince Arora 

under Execute is true? 

function oncondition() {
 if(g_form.isNewRecord() ){

  g_form.setReadOnly("assignment_group",true');

}

 

@Alon Grod 

 

yes, also pls use the below script

 

if(g_form.isNewRecord() ){

g_form.setReadOnly("assignment_group",'true'); // single quote was missing

}