Manage Escalations

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 Code

The simplified code for the page is here:


}
}
}

<%
if (CRM.Mode==View)
{
CRM.Mode=Edit;
}

//Build the search block
var SearchBlock = CRM.GetBlock("entrygroup");
var rulename = CRM.GetBlock("entry");
with (rulename)
{
FieldName = "wkrl_caption";
Caption = CRM.GetTrans("colnames","wkrl_caption")+":";
EntryType = 10;
Size = 40;
}

var tablename = CRM.GetBlock("entry");
with (tablename)
{
FieldName = "wkrl_entity";
Caption = CRM.GetTrans("colnames","wkrl_entity")+":";
EntryType = 10;
Size = 40;
}

with (SearchBlock)
{
AddBlock(rulename);
AddBlock(tablename);
Title = CRM.GetTrans("tabnames","search");
}

//Build the List Block
var ListBlock = CRM.GetBlock("List");
with (ListBlock)
{
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);
while (!myE.atEnd())
{
myEntryBlock = myE.item();
myEntryBlock.AllowOrderBy = true;
myE.moveNext();
}

//Set GridColBlock properties
with (captionGridColBlock)
{
JumpAction= 415;
CustomIdField = "wkrl_ruleid";
}

var strAddEscalation = CRM.Button("new","newescalationrule.gif", CRM.Url(130));

var myBlockContainer = CRM.GetBlock("Container");
with (myBlockContainer)
{
AddBlock(SearchBlock);
AddBlock(ListBlock);
AddButton(strAddEscalation);

ButtonTitle = "search";
ButtonImage = "search.gif";
}
ListBlock.ArgObj = SearchBlock;

var Arg = "wkrl_ruletype = 'time'";
CRM.AddContent(myBlockContainer.Execute(Arg));
Response.Write(CRM.GetPage("manageEscalation"));

%>

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.

Anonymous