- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2025 11:13 PM
Dear experts,
I am facing a problem where I am stuck in how to make certain related list tabs show when a certain field in the risk event form is selected then prompting the specific related list tabs to appear instead of all the tabs that is unrelated to appear simultaneously after submitting the risk event form. For example, I have created two custom tables one is payment-related fraud table, and another one is cyber incident table. In the risk event form, there is a field called risk event type so when I select payment-related fraud, then after submitting the payment-related fraud table will populate out and the cyber incident table will not, vice-versa.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 12:44 AM
I assume you are using correct value to compare and given correct name of the related list
try this
function onLoad() {
if (g_form.getValue('u_risk_event_type').toString() != '5') {
alert('inside');
g_form.hideRelatedList('sn_risk_advanced_payment_fraud_related_risk', true);
}
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 12:07 AM
It does not work as it appears to. This is my script. Please help.
function onLoad() {
if (g_form.getValue('u_risk_event_type').toString() !== '5') {
g_form.hideRelatedList('sn_risk_advanced_payment_fraud_related_risk');
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 01:25 AM
Hi @ChuanYanF
Can you make sure that the related list name is correct. Go to List Control and check for related list name and make changes in your code accordingly.
I have checked in my PDI for me it is working fine
MY PDI Snip
Impacted Services/CIs Related List Hidden
If my response helped, please mark it correct and close the thread so that it benefits future readers.
Regards,
Rohit