Script to Add/Remove fields from form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2018 10:26 AM
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?
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2018 12:28 AM
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
www.dxsherpa.com
Thanks,
Rahul Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2018 12:30 AM
Hi Dustin,
What is your exact requirement?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2018 12:37 AM
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
www.dxsherpa.com
Thanks,
Rahul Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2018 12:44 AM
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