The solution is an HTML web resource which looks for the flags and dependent on them will display an alert:
Good Alert! You would also need to upload the individual images as web resources in order to call them.
The alert in the example above is toggled by the 'Credit Hold' choice, but could easily be used in different ways. This is the basic web resource:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head> <script type="text/javascript" src="ClientGlobalContext.js.aspx"></script>
<script type="text/javascript"> function ContextInformation() {
document.getElementById('td2').innerHTML = window.parent.Xrm.Page.getAttribute('creditonhold').getValue();
var result = window.parent.Xrm.Page.getAttribute('creditonhold').getValue(); }
</script>
<title></title>
</head> <body onload="ContextInformation();" style="border-bottom: 0px;
border-left: 0px; border-top: 0px; border-right: 0px; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; padding-right: 0px; font-family: Segoe UI, Tahoma, Arial; font-size: 11px; font-weight: bold; background-color: #f6f8fa;" text="White"> <table class="style1">
<tr> <td> </td> <td class="style4"> </td> <td class="style3" id="td2"> </td> </tr> </table> <script type="text/javascript" src="ClientGlobalContext.js.aspx"></script> &nbbsp; <td class="style4"> &nsp; <script type="text/javascript"> document.getElementById('td2').innerHTML = window.parent.Xrm.Page.getAttribute('creditonhold').getValue(); var result = window.parent.Xrm.Page.getAttribute('creditonhold').getValue(); //alert(result); if (result == true) {
document.write('<img alt= "alert2" style="height: 38px; width: 51px" src="http://crm-dev-01:5555/CRMDEV/WebResources/arcrp_alert" /><font color ="Red"><marquee>There is a Flag on this record</marquee></font>'); }
else {
document.write('<img alt= "alert2" style="height: 51px; width: 51px" src="http://crm-dev-01:5555/CRMDEV/WebResources/arcrp_Smile" />'); } </script> </body> </html> |