After submitting a request, the created record has all the variables 'read-only'

hadron_collider
Tera Contributor

Hello,

 

 

 

I am trying to prevent users from editing their records after they were submitted.

 

Here is a preview of the record:

All the fields should be read-only:

kata90_0-1704455043600.png

 

Here is the client script I have created but it does not work as expected:

 

kata90_1-1704455223373.png

 

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@hadron_collider 

So on existing record they should not be allowed to edit?

then simply update the IF statement as this -> use ! so that the IF runs for existing record and makes fields readonly

if(!g_form.isNewRecord()){

// your code

}

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

1 REPLY 1

Ankur Bawiskar
Tera Patron
Tera Patron

@hadron_collider 

So on existing record they should not be allowed to edit?

then simply update the IF statement as this -> use ! so that the IF runs for existing record and makes fields readonly

if(!g_form.isNewRecord()){

// your code

}

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader