Sage CRM 2023 R1: SDK Improvements - Enabling existing pre-Sage CRM 2023 R1 custom entity to allow email import.

1 minute read time.

The Email Import functionality in Sage CRM 2023 R1 has been upgraded to include support for custom entities, enabling emails to be linked with custom entity records. This enhanced feature is available through a new version of the Advanced Customization Wizard, which includes the necessary code to enable this behaviour for newly generated custom entities.

But what about upgraded systems with custom entities? You can edit the existing generated summary page code to add in the necessary code.

If you have created custom entities using the wizard you will probably know that the files are created in a folder named after the entity. In my case this was Project.

[Installation Name]\WWWRoot\CustomPages\[entity name]


The file that needs to be changed in [EntityName]Summary.asp e.g. ProjectSummary.asp.

Find the line of code with with the "Execute()" method and then immediately above it drop in the code.

recObj = CRM.FindRecord("Custom_Tables", "Bord_Name='" + Entry.Title + "'");
if ((true) && (recObj('Bord_HasCommunication') != undefined)) {
recObjOAuth = CRM.FindRecord("UserSettings", "USet_Key = 'EMC_AuthAccessToken' and USet_
UserId = '"+CRM.GetContextInfo('User', 'User_UserId')+"'");
if ((true) && (recObjOAuth.RecordCount > 0)) {
Container.AddButton(CRM.Button("ImportEmails", "", CRM.URL(1362) +
"&ImportMode=0&EntName=" + Entry.Title + "&EntIdField=" + recObj('Bord_IdField')));

Once you've saved your changes the feature will be available once the system is configured to enable the Contact and Email Import.