- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2022 03:50 AM
Hello Team,
I have few related lists on few Ticketing Modules. .and I want to remove "Edit" button on one of the related list on HR Form, based on some condition. For EX: if the ticket state is transferred, The below related list should not have "Edit" button available.
I tried to update the List control record directly by giving the "omit Edit condition" .however due to Application scopes vs Record scope mismatches , I could not save the record with my changes.
Hence , I wanted to remove the "Edit" button using a background script. Can someone please help me how can I write a background script to remove "Edit" button based on the below condition.
var answer;
if(parent.state == 9)
{
answer =true;
}
else{
answer = false;
}
Hi
Could you please check and assist on this.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2022 05:25 AM
Hi,
you can try to check that as well in condition by getting the parent class name
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-15-2022 11:27 PM
Hello,
I think it would be easier to copy the OOTB UI action "Edit..." and to apply the conditions that you need on it.
It depends on how many related lists you want to have the logic applied.
Have a great one,
Elena
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2022 11:31 PM
Hi,
If it's not allowing then as mentioned by
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-16-2022 01:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2022 02:17 AM
Hi,
change the table name to m2m_kb_task and do insert and Stay
Then update the condition of UI action so that it hides when ticket state is transferred,
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader