Hide the ui action in the related list
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 06:47 AM
here i want to hide the 'edit' button when the state is in progress
how shall i achieve it ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 11:40 PM
Hi ,
actually, I was working on some other tasks:
where i need to close the parent when child is closed for that i have this before update BR: and in when to run condition ' state changes to close complete'.
var count=0;
var tasks = new GlideRecord('sc_task');
tasks.addQuery('request_item',current.request_item);
tasks.query();
var taskcount = tasks.getRowCount();
while(tasks.next())
{
if(tasks.state == 3)
{
count++
}
}
if(count == taskcount)
{
var rq = new GlideRecord('sc_req_item');
rq.addQuery('sys_id',current.request_item);
rq.query();
if(rq.next())
{
rq.state = 3;
rq.update();
}
}
but when state is changing from close complete to work in progress thats when the parent records is being changed to close complete.
can you help me out here !!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 11:55 PM
actually did not check it yet i have been working on the close parent when child is closed :
var count=0;
var tasks = new GlideRecord('sc_task');
tasks.addQuery('request_item',current.request_item);
tasks.query();
var taskcount = tasks.getRowCount();
while(tasks.next())
{
if(tasks.state == 3)
{
count++
}
}
if(count == taskcount)
{
var rq = new GlideRecord('sc_req_item');
rq.addQuery('sys_id',current.request_item);
rq.query();
if(rq.next())
{
rq.state = 3;
rq.update();
}
} here is before uppdate br with condition of state changes to work in progress;
but its not working can you please check ??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2025 04:53 AM
Could you please rasie the new question in a way that encourages the community to assist? Once we test the solution for the raised issue, we can close the thread.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]
****************************************************************************************************************
