Hints, Tips and Tricks

Technical Hints Tips and Tricks that cover customization and development using Sage CRM. API usage and coding are covered.


  • Comments 5
  • Likes
The diagram below shows the general architecture of Sage CRM. Here you can see very clearly that the .NET API is an alternative and NOT a replacement for the COM API which is currently used to build application extensions with ASP pages. 
Both the .NET API and the COM ASP API use the Meta Data based structure of Sage CRM is broadly similar ways. In the diagram below we can see that the properties for any screen and screen element (List, Column, Screen, Entry Field) is determined by definitions held in the Meta Data tables (prefixed "custom_"). 

Both APIs use objects and methods to obtain the definition of the screens from Meta Data and generate the HTML necessary for the output to the browser.

The .NET API uses COM InterOp to access the underlying COM API.

One of the very interesting features of the design of the API is that is now gives very easy control over some parts of the interface that were difficult to control using the COM API. 

The Sage CRM user interface is build by invoking 'blocks' such as screen blocks and list blocks. The code sample below shows that new properties of the underlying blocks have been exposed in the new API. This code is for a rebuild of the Company Quicklook screen.

namespace QuickLook
class QuickLook : Web
public override void BuildContents()

List CommList = Metadata.GetList("CommunicationList");
CommList.RowsPerScreen = 4;
CommList.ShowNavigationButtons = false;
AddContent(HTML.GridData(CommList.GetViewHtml("cmli_comm_companyid =" + Dispatch.EitherField("key1"))));

List OppoList = Metadata.GetList("OpportunityList");
OppoList.RowsPerScreen = 4;
OppoList.ShowNavigationButtons = false;
OppoList.Title = "Opportunities";
AddContent(HTML.GridData(OppoList.GetViewHtml("oppo_primarycompanyid =" + Dispatch.EitherField("key1"))));

List CaseList = Metadata.GetList("CaseList");
CaseList.RowsPerScreen = 5;
CaseList.ShowNavigationButtons = false;
CaseList.Title = "Cases";
AddContent(HTML.GridData(CaseList.GetViewHtml("case_primarycompanyid =" + Dispatch.EitherField("key1"))));


AddUrlButton("NewTask", "newtask.gif", Url("361"));
AddUrlButton("NewAppointment", "newappointment.gif", Url("362"));
AddUrlButton("NewOpportunity", "newopportunity.gif", Url("1190"));
AddUrlButton("Newcase", "newcase.gif", Url("1192"));

string sUrl = "' /CRM6B21/help/EN/Main Menu/wwhelp/wwhimpl/js/html/wwhelp.htm?href=GStarted18.html', 'HELPWIN','scrollbars=yes,toolbar=yes,menubar=no,resizable=yes,top=200, width=600,height=400')";
AddUrlButton("Help", "help.gif", sUrl);

The code above shows the new ability to access properties like the "RowsPerScreen" and "ShowNavigationButtons" means that it will become easier to fine tune screen to a high degree.

The code above has been written in C#. Although C# is the language that the SDK resources and training materials will use, the new .NET API will work with any .NET language.

I will be blogging in the future about when to use which API.