A new example component has been added to the resources section for development partners to download. The purpose of this component is to make the management of escalation rules easier in implementation of Sage CRM where there are a large number of rules to manage. When working with large number of Escalation rules - for example in a system with more than 40 rules it can be time consuming to find the correct rule when editing. This component enhances the existing display of Escalation rules by
1) Adding Table name and View name to the list of escalations.
2) Allowing list to be sorted Alphabetically (asc & desc)
3) Sorting by Table or View
4) It also provided a Filterbox.
The new screen is found under
Administration -> Advanced Customization
The new screen that is produced allows the Administrator to search and access rules quickly.
The simplified code for the page is here:
<!-- #include file ="accpaccrm.js"-->
// hide the button
re = /key0/gi;
var strURL = document.all[i].href;
document.all[i].href = document.all[i].href.replace(re,"key27");
//Build the search block
var SearchBlock = CRM.GetBlock("entrygroup");
var rulename = CRM.GetBlock("entry");
FieldName = "wkrl_caption";
Caption = CRM.GetTrans("colnames","wkrl_caption")+":";
EntryType = 10;
Size = 40;
var tablename = CRM.GetBlock("entry");
FieldName = "wkrl_entity";
Caption = CRM.GetTrans("colnames","wkrl_entity")+":";
EntryType = 10;
Size = 40;
Title = CRM.GetTrans("tabnames","search");
//Build the List Block
var ListBlock = CRM.GetBlock("List");
CaptionFamily = "eworkflowrule";
SelectSQL = "select * from vWorkflowRules"
var entityGridColBlock = AddGridCol("wkrl_entity");
var tableGridColBlock = AddGridCol("wkrl_table");
var captionGridColBlock = AddGridCol("wkrl_caption");
var enabledGridColBlock = AddGridCol("wkrl_enabled");
var intervalGridColBlock = AddGridCol("wkrl_runinterval");
//Set EntryBlock properties for an EntryGroup Block using an Enumerator
var myE = new Enumerator(ListBlock);
myEntryBlock = myE.item();
myEntryBlock.AllowOrderBy = true;
//Set GridColBlock properties
CustomIdField = "wkrl_ruleid";
var strAddEscalation = CRM.Button("new","newescalationrule.gif", CRM.Url(130));
var myBlockContainer = CRM.GetBlock("Container");
ButtonTitle = "search";
ButtonImage = "search.gif";
ListBlock.ArgObj = SearchBlock;
var Arg = "wkrl_ruletype = 'time'";
The page is a fairly straight forward search page. But as the screen is based on an administration table rather than an application table like 'company or 'opportunity' there are number of points to make here
1) The Search Block has been manually built rather than being defined in meta data because the workrules table which holds the definitions of the escalation rules is not exposed in the administration screens. There is an article that discusses building screens not bound to meta data here: Building a Screen not bound to Meta Data using the ASP COM API
2) The List Block like the Search Block has been built with out reference to meta data. See the article "Building Lists without reference to Meta Data in the ASP COM API". There was a small problem with adding the hyperlink to the edit screen as the APIs are generally more suited to managing the context within the main application screens rather that the administration screens. To correct the hyperlink some code was added to execute within the browser to make the correction needed.
3) The clientside code used to make the URL correction is based on the code discussed in the article "Using Clientside Code to Change the Property and Behaviour of a Column in a List".
Development Partners can download the component that will install this page from the resources section of this website. Click here to download now.