Skip to content

Commit 7646165

Browse files
authored
Show Open Incident of Caller (#2612)
* Show Open Incident of caller Show Open Incident of caller * Added Readme file
1 parent 24da1e0 commit 7646165

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Show Open Incident of caller
2+
3+
Script Type: UI Macro
4+
5+
Goal: In Form view caller can see what are the open incident of that particular caller.
6+
7+
Walk through of code: So for this use case a new macro will be added to the caller field, when it is triggered it will open a new popup window where it will show the list of particular caller which are all open incident.So for this a new UImacro have been used in that a new list icon have been rendered from the db_image table and inside that a showopentckts() function this will get the current caller and then add the query to filter out the list of open incident and then open a popup to show the list of that particular caller which are all open(other than Closed and Cancelled).
8+
9+
Note: To inherite the UI Macro in that particular field (Caller) we need to add the attribute in the Dictionary Entry = ref_contributions=caller_inc_lists [ref_contributions="name of the macro"]
10+
11+
UI Macro
12+
<img width="853" height="292" alt="UIMacro" src="https://github.com/user-attachments/assets/f5b353a2-ffb6-4e44-a740-9905b33cb484" />
13+
14+
Dictonary Entry in Attribute section
15+
<img width="848" height="386" alt="UIMacroDictionary" src="https://github.com/user-attachments/assets/b21d2077-3df5-4408-9bb3-c0672fd1398b" />
16+
17+
UI Macro in Incident Form near the Caller Field
18+
<img width="860" height="310" alt="From UIMacro" src="https://github.com/user-attachments/assets/c3867abf-f9cd-4947-a7e9-41c83189681d" />
19+
20+
Result:
21+
<img width="865" height="409" alt="UIMacro Result" src="https://github.com/user-attachments/assets/5412b29b-e96b-4455-a3e0-5552c9680600" />
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
3+
4+
<img src='sn_tile_icon/now-checklist.svg' stype='width=5%,height:5%' onclick="showopentckts()" title="Show Open Incident of me"></img>
5+
6+
<script language="javascript">
7+
function showopentckts(){
8+
var name=g_form.getValue("caller_id");
9+
var tableName='incident';
10+
var url=tableName+'_list.do?sysparm_query=caller_id='+name+'^stateNOT IN7,8';
11+
window.open(url,'OpenIncident',"popup");
12+
}
13+
14+
</script>
15+
16+
</j:jelly>

0 commit comments

Comments
 (0)