Hide "ADD" Button

Shabbir1
Tera Contributor

Hi Team,

on problem we have a field region drop down (1usa  2 Europe) and in related list we have "change requests" in that we have "ADD" button we need to hide the 'ADD' button when region is USA and show when region is Europe can anyone suggest how to achieve this there is no omit option for "ADD" in list control and when i am checking in UI actions it is in change_request table .how can fetch problem field values on that UI action is it possible to do this..?

1 ACCEPTED SOLUTION

@Shabbir1 

parent object should work

parent object -> will be the problem record

See here, I was able to show the Add button only for PRB0000011 and hide for other problem

AnkurBawiskar_2-1742534375129.png

 

 

AnkurBawiskar_0-1742534288439.png

 

AnkurBawiskar_1-1742534326152.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

7 REPLIES 7

@Shabbir1 

parent object should work

parent object -> will be the problem record

See here, I was able to show the Add button only for PRB0000011 and hide for other problem

AnkurBawiskar_2-1742534375129.png

 

 

AnkurBawiskar_0-1742534288439.png

 

AnkurBawiskar_1-1742534326152.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar , Thank you for your response i have added parent.region its working fine 

 

sunil maddheshi
Tera Guru

@Shabbir1 

Hi maybe you can write script include and call it from UI action condition, script include look like this you can modify the code, 
UI action: scriptInlcudeName().checkRegion(current.problem_id) //assuming problem_id is field used for linking

fucntion: checkRegion(){
if (ProblemID) {
    var problem = new GlideRecord('problem');
    if (problem.get(ProblemID)) {
        if (problem.region == '1') { // Assuming '1' is USA
           return false; // Hide the button
        }
return true;
    }
}
}

 Please mark correct/helpful if this helps you!