- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2023 07:17 PM
Hi All ,
I have a requirement that in Change form in the related list Ui actions button 'new' and 'Edit' should not be visible in Authorize, Scheduled ,implement ,review and closed stage.
Please suggest how to achieve this.
In all below related list the New and Edit shouldnt be visible in these states.
Thank you In advance. @Ankur Bawiskar @Community Alums
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2023 07:57 PM
update as this
var answer;
if (parent.state.toString() == '-5'|| parent.state.toString() == '-4')
{
answer = false;
}
else {
answer = true;
}
answer;
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-21-2023 12:54 AM
Hi @ServiceNow10sun ,
Please try with below script, no need to declare answer as variable.
answer = (parent.state==-5 || parent.state==-4)?false:true;
If my response helps you to resolve the issue close the question by Accepting solution and hit thumb icon. From Correct answers others will get benefited in future.
If it helps please click Accept as Solution/hit the Thumb Icon.
Thanks,
Ratnakar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2023 07:56 PM
Hi @ServiceNow10sun ,
Please find the below link which will help you to hide new and edit UI actions in a related lists based on condition.
https://www.servicenow.com/community/developer-forum/how-to-hide-new-edit-button-on-related-list-bas...
I hope this helps!
Regards,
Hemant
**Please mark my answer correct or helpful based on the impact**
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2023 08:24 PM
you can use Configure List control -> then use Omit New condition script and Omit Edit condition script and show/hide the button based on state
what did you start with and where are you stuck?
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-20-2023 10:30 AM
Hi Ankur ,
I have tried the below but i can still see the new button in ' Affected CIs' related list .
I have used the below script in Omit edit condition and in Omit new condition
var answer;
if (parent.state == '-5'|| parent.state=='-4')
{
answer = false;
}
else {
answer = true;
}
answer;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2023 07:57 PM
update as this
var answer;
if (parent.state.toString() == '-5'|| parent.state.toString() == '-4')
{
answer = false;
}
else {
answer = true;
}
answer;
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader