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.

  1. 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

  2. Open the <EntityName>Summary.asp file in a code editor.

  3. Locate the following line of code:

    Copy
    CRM.AddContent(Container.Execute(record));
  4. Immediately above this line, insert the following code:

    Copy
    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')));
        }

    }
  5. Save your changes.