Enabling pre-2023 R1 custom entity for email import
You need to complete the following steps to display the Import Emails button for each custom entity created with a pre-2023 R1 version of Sage CRM.
For custom entities created with Sage CRM 2023 R1 and later, the Import Emails button displays automatically.
-
On a Sage CRM server, go to <Sage CRM installation folder>\WWWRoot\CustomPages\<EntityName>.
Where <EntityName> is the name of the custom entity for which you want to enable email import.
The default Sage CRM installation folder is
%ProgramFiles(x86)%\Sage\CRM\CRM -
Open the <EntityName>Summary.asp file in a code editor.
-
Locate the following line of code:
CopyCRM.AddContent(Container.Execute(record));
-
Immediately above this line, insert the following code:
CopyrecObj = 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')));
}
} -
Save your changes.