How to show certain section in a form post save of record.

sreeshsurendran
Tera Guru

The requirement is to show certain section in a form post save of record ServiceNow. Not sure how this can be done, I tried via onLoad Client script but seems this is the wrong approach.

 

Any help would be greateful.

 

Thanks,

Sreesh

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@sreeshsurendran 

you can check if record is new and if not then show the section using this syntax

function onLoad() {
	// hide it
    g_form.setSectionDisplay('section_name', false);
    if (!g_form.isNewRecord()) {
		// show it if it's an existing record
        g_form.setSectionDisplay('section_name', 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

6 REPLIES 6

Thanks @Ankur Bawiskar - it worked. Accepted your solution 😄

 

 

Thanks,

Sreesh

@sreeshsurendran 

Glad to know.

Would you mind closing your earlier questions by marking appropriate response as correct?

Members have invested their time and efforts in helping you.

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