Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

dot-walking request table to requested item for ui action button

EnricoManalo23
Tera Contributor

I'm trying to make a cancel button that relies on the requested item 'item' field in the request form, currently can't seem to make it exclusive or dependent on the request  form since the request form is mapped to the request table.

12 REPLIES 12

I think, no. mate.

*************************************************************************************************************
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]

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

no, you can dot walk from sc_task to sc_req_item but not from sc_request to sc_req_item.

 

You will need to write script include and call that in your UI action condition for this.


Please mark the answer correct/helpful accordingly.


Raghav
MVP 2023
LinkedIn

RaghavSh
Mega Patron

In the UI action condition you need to call the script include ( and creat a script include as well) for this like:

 

UI action condition : new cancelRequest().getItem(current); // passing the request record

 

Script include code:

getItem : function(reqRecord)
{
var reqItem = new GlideRecord('sc_req_item');
reqItem.addQuery('request',reqRecord.sys_id); // get request item related to request
reqItem.query();
if(reqItem.next()){
if(reqItem.cat_item=='sys_id of your catalog item') // catalog item check
return true;
else
return false;
}
}

 
Please mark the answer correct/helpful accordingly.


Raghav
MVP 2023
LinkedIn

@EnricoManalo23 Did this work for you?


Raghav
MVP 2023
LinkedIn

Dr Atul G- LNG
Tera Patron
Tera Patron

you can only dot walk from a child to a parent.

*************************************************************************************************************
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]

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