UI Policy which only applies for a new form record

Simon Ciglia
Giga Guru

Hi folks

I need a UI Policy which only applies for a new form record.

Any ideas?
Any help is appreciated, thank you in advance.

Simon

1 ACCEPTED SOLUTION

Alberto Consonn
ServiceNow Employee
ServiceNow Employee

Hi,

if you need to make a field mandatory, visible or read only for a new record, then it's better to use an onLoad client script with the isNewRecord() function, see an example below:

if(g_form.isNewRecord()){  

g_form.setMandatory('field_name', 'true');   ////provide field name here

}

else{

g_form.setMandatory('field_name', 'false');

}

If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.

Thank you

Cheers
Alberto

View solution in original post

5 REPLIES 5

Community Alums
Not applicable

hello @Simon Ciglia  ,find_real_file.pngcreated by, created, updated as 6 fields are created when we create one ta

when crecord is new that time created or createdBy fields are empty but when we create new crecord  and save it that time created or createdBY will be auto populated.

I am attaching one image  which describe how I achive this task by ui policy