Information and Error Message feature in Sage CRM v7.2

By | June 14, 2013

Sage CRM v7.2 has simplified the life of developers in many aspects. It has reduced the coding effort required by providing in-build functions and hence optimized the coding.
In earlier version, we were using the content block to display the Information messageNow, in Sage CRM v7.2 this can be done using client side script.
Let us take an example; In Sage CRM we want to display information message to users, about the case, which are on high priority.
Hence, follow below instructions to achieve the same;

1. Navigate to Administration >> Customization >> Cases >> Screens.
2. Select Case Detail Screen. (CaseDetailBox).
3. Add the following script to the Custom Content field.

<script>
crm.ready(function()
{
var sPriority = new String(document.getElementById(“_HIDDENcase_priority”).value);
if(sPriority==”” || sPriority==”null” || sPriority==”undefined”)sPriority=””;

if(sPriority==”High”)
{
crm.infoMessage(“This is a High priority case.”);
}

})
</script>

Also Read: Set Birthday reminders in Sage CRM
There might be other parameters to determine whether current case is high priority. For now, we are just using the Priority field to identify the case priority.
Similarly, suppose you need to show error message (in Red Bar) to users, if they have set the SLA of priority case to Gold. Then paste below code into the custom content of Case Detail box by following steps mentioned above.

<script>
crm.ready(function()
{
var sSLA = new String(document.getElementById(“_HIDDENcase_slaid”).value);
if(sSLA==”” || sSLA==”null” || sSLA==”undefined”)sSLA=””;
if(sSLA!=”Gold”)
{
crm.errorMessage(“Please set SLA as Gold.”);
}
})
</script>

Sage CRM v7.2 has introduced many in-built functions to display the useful information with small piece of code. Hence, making it easier to enhance the system capabilities and easier to use.
Related Posts:

1. Display Background Color on Required Fields in Sage CRM v7.2
2. Sage CRM 7.2 Facebook Component
3. Email Screen in Sage CRM 7.2
4. Notification Features in Sage CRM v7.2