Script to Add/Remove fields from form

Dustin Hux3
Kilo Explorer

Hello, I am trying to find a way to add or remove a field on a table to its default form view with a script.  Is there a way to accomplish this if I know the table and the field on that table that I want to add/remove from its respective form view?

 

 

4 REPLIES 4

Rahul Kumar17
Tera Guru

Hi 

remove the field in a form

write client side code

 

function onLoad() {
g_form.setVisible('e_salary', false);
}

 

 

 

 

 

Mark Correct if it helps.

Warm Regards,

Rahul Kumar

find_real_file.png

www.dxsherpa.com

If my response helped please mark it correct and close the thread.

Thanks,
Rahul Kumar

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Dustin,

What is your exact requirement?

Regards

Ankur

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

Rahul Kumar17
Tera Guru

Hi,

I will try to add field in a form.

 

function onLoad() {
g_form.
g_form.setVisible('e_salary', false);
}

 

 

Mark Correct if it helps.

Warm Regards,

Rahul Kumar

find_real_file.png

www.dxsherpa.com

If my response helped please mark it correct and close the thread.

Thanks,
Rahul Kumar

Jaydeep Parmar
Kilo Guru

Hi Dustin Hux,

you can do this by using

g_form.setVisible("description",false/true);

method based on some condition

Mark Correct if it solved your issue or hit Like and Helpful if you find my response worthy.

Jaydeep Parmar

find_real_file.png