User should not be able to update fields after submitted the form

sahana1998
Tera Contributor
 
3 ACCEPTED SOLUTIONS

function onLoad() {
    if(g_form.isNewRecord()){
              g_form.setReadOnly('description'false);// change the field name here
            }
    else{
              g_form.setReadOnly('description'true);// change the field name here
            }
}

View solution in original post

@sahana1998 

create onLoad client script on your table

function onLoad(){
	if(!g_form.isNewRecord())
		g_form.setReadOnly('nameField', true);
}

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

@sahana1998 

As per new community feature you can mark multiple responses as correct.

If my response helped please mark it correct as well so that it benefits future readers.

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

View solution in original post

7 REPLIES 7

Dhananjay Pawar
Kilo Sage

Hi,

Please provide more details on the requirement.

Thanks.

Ankur Bawiskar
Tera Patron
Tera Patron

@sahana1998 

this should be an easy task

It can be achieved via table level WRITE ACL or onLoad client script on your table

what did you start with and where are you stuck?

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

sahana1998
Tera Contributor

@Ankur Bawiskar 

Once after the submitted the form, if any one open the same record that time ex: Name field should be read-only 

function onLoad() {
    if(g_form.isNewRecord()){
              g_form.setReadOnly('description'false);// change the field name here
            }
    else{
              g_form.setReadOnly('description'true);// change the field name here
            }
}