UI macro not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2024 07:14 AM
Hi All,
I am trying to change the UI macro for the Dependency View of the Incident, Change, Requested Item etc..
I can find the UI macro that is related to the same - task_show_ci_map (OOTB)
Here is my system setup, I have an application and a service map entry for the same. When an application is selected and if the user click on the Dependency view icon (which invokes the macro), I want them to see the Service Map of the application instead of the application entry. I cannot restrict the class in the reference qualifier because of business reasons and I want them to see the application dependencies via the service map. I tried modifying the "showBSMMap" function as specified below, however its not working. If I hard code the service map entry it is working. Below are the 2 versions I tried, which is not working. In version 1 if I hard code sys id it is working, version 2 it is entering only in the first loop.
if(gr.get(sys_id))
{
var grMap = new GlideRecord('cmdb_ci_service_discovered');
grMap.addEncodedQuery('XXX='+gr.XXX);
grMap.query();
if(grMap.next())
{
sys_id=grMap.sys_id;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2024 08:43 PM
Hello @Sundar16,
Please refer to the link below:
https://www.servicenow.com/community/developer-forum/ui-macro-not-working-properly/m-p/1829698
If it is helpful, please mark it as helpful and accept the correct solution.
Thanks & Regards,
Abbas Shaik