Hide the ui action in the related list

tushar_ghadage
Tera Contributor

Screenshot (28).png

here i want to hide the 'edit' button when the state is in progress 

how shall i achieve it ? 

7 REPLIES 7

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 !!

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 ??

Hi @tushar_ghadage 

 

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.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

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/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************