Customizing Approval Notification

Manoj82
Kilo Expert

Hi,

I need help in customizing our existing Approval notifications on Requests. In our current system(Asset mgmt) when a user request let's say 2 items , our approval notifications will provide the details of each and every Requested item(RITM) as shown below:

find_real_file.png

Sometimes, our requests that have 100 request items and the notification looks very clumsy. I am trying to update this into the following format which consists of a table for all the Requested items(RITMs)

find_real_file.png

 

Can someone please help me how to achieve this kind of notification so that  all the items are in a table. 

Regards,
Manoj

 

1 ACCEPTED SOLUTION

Can you change it to 

 

Short Description: ${sysapproval.short_description}
Priority: ${sysapproval.priority}
Requested For: ${sysapproval.requested_for}
Requested By: ${sysapproval.opened_by}
Total Price: ${sysapproval.price}
<hr/>
<mail_script>
var item = new GlideRecord("sc_req_item");
item.addQuery("request", current.sysapproval);
item.query();


if (item.getRowCount() > 0) {
template.print('<table border="1"><th colspan="4" style="text-align:center">Summary of Requested items</th>');
while(item.next()) {
template.print('<tr><th>'item.number + '</th><th>' + item.quantity + '</th><th>' + item.cat_item.getDisplayValue() + '</th><th>' + item.price.getDisplayValue() + '</th></tr>')

}
template.print('</table>');
}

</mail_script>

 

 

 

if that doesnt work, try this as well 

Short Description: ${sysapproval.short_description}
Priority: ${sysapproval.priority}
Requested For: ${sysapproval.requested_for}
Requested By: ${sysapproval.opened_by}
Total Price: ${sysapproval.price}
<hr/>
<mail_script>
var item = new GlideRecord("sc_req_item");
item.addQuery("request", current.sysapproval);
item.query();


if (item.getRowCount() > 0) {
template.print('<table border="1">'); 
while(item.next()) {
template.print('<tr><th>'item.number + '</th><th>' + item.quantity + '</th><th>' + item.cat_item.getDisplayValue() + '</th><th>' + item.price.getDisplayValue() + '</th></tr>')

}
template.print('</table>');
}

</mail_script>


Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

6 REPLIES 6

Can you tell me, what exactly you want to change?

Do you want to change the style the table is displayed?


Please mark this response as correct or helpful if it assisted you with your question.

Yes, I am just trying to update how table is displayed. Instead of borders for each cell as shown in my image 1 above , I need something like image 2 

Regards,
Manoj