- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2022 03:50 AM
Hi,
I am facing an issue as below.
there's a form. it has two sections .
- Inofrmation section
- Closure information
So, I need to hide this closure information section only when record creation.
but when existing record opens closure information section should be there.
Is anyone has an idea how to achieve this.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2022 03:52 AM
Hi
Check the below link it give the details
https://community.servicenow.com/community?id=community_question&sys_id=8141dfe9dbdcdbc01dcaf3231f9619d5
function onLoad() {
if (g_form.isNewRecord()) {
g_form.setSectionDisplay('SectionName', false);
}
else{
g_form.setSectionDisplay('SectionName', true);
}
}
Please Mark the answer if correct/helpful , if it helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2022 03:52 AM
Hi
Check the below link it give the details
https://community.servicenow.com/community?id=community_question&sys_id=8141dfe9dbdcdbc01dcaf3231f9619d5
function onLoad() {
if (g_form.isNewRecord()) {
g_form.setSectionDisplay('SectionName', false);
}
else{
g_form.setSectionDisplay('SectionName', true);
}
}
Please Mark the answer if correct/helpful , if it helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2022 03:57 AM
Hi,
you can use g_form.isNewRecord() in your onload client script and check if it's new record or not
Show/Hide Form Section by Name
function onLoad(){
if(g_form.isNewRecord()){
g_form.setSectionDisplay('name of section', false);
}
}
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
‎05-07-2025 05:13 AM
I Need Help On, How to Hide the Details based On Variable this Variable Is Choice Variable In Sc_task table For Particular Catalog Item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-07-2025 09:14 AM
please post a new question and tag me on that and share all the details there along with complete requirement and screenshots
also share what you tried so far and what debugging did you do
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader