I thought about going down the Silverlight road, but in this case it didn't need to be too complicated.
The solution is an HTML web resource which looks for the flags and dependent on them will display an alert:
| Bad Alert |
| Good Alert! 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, which I haven't cleaned up from my early attempts, but could easily be hacked around to suit: <!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> <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> |
Hi thanks for Nice post. Could I ask for a more detailed guide. I am getting an not able to retrive value for : 'creditonhold').getValue();
ReplyDeleteWhen I add it to main form...