Ensuring a New Custom Entity has Mail Merge capabilities

1 minute read time.

In order to make sure that your new Entities can use the server side Mail Merge they must have been created using the new Advanced Customization Wizard for Sage CRM v7.1 SP2. It is important to realise that this is an edited version of the wizard designed for use with the new version.

If you have not used the Advanced Customization Wizard before, this is a component that provides a quick and easy method for creating new custom main entities in Sage CRM. The Advanced Customization Wizard functionality works in conjunction with the Component Manager. Creating a new custom entity involves using the Component Manager to install the Advanced Customization Wizard component.

Note: You must use the correct version of the Advanced Customization Wizard for Sage CRM and create the new entity with 'Has Communication' and 'Has Library' ticked.

To support the mail merge feature the wizard creates a new view called vMailMerge[entityname] e.g. vMailMergeProject or vMailMergeEvent.

The Mail Merge and Add File buttons are then available within the Documents Tab. If your browser is Chrome or Firefox then the File Drop area is also displayed.

The code can be found in the [entityname]Library.asp page that is created by the wizard. E.g. ProjectLibrary.asp or EventLibrary.asp.

[code language="javascript"]
Container.AddBlock(List);
if (ie_browser.toString() == "-1" ) {
// The "FILEUPLOAD" string below is NOT a CAPTION - it is a constant to indicate to the COM object that a FILEUPLOAD button is expected
Container.AddButton(CRM.Button("FILEUPLOAD", "FileUpload.gif", CRM.URL(343)+" &Key-1="+iKey_CustomEntity+PersonKey+CompanyKey+OpportinityKey+HasCommunication+" &PrevCustomURL="+List.prevURL+" &E=Project"));
}
else
{
Container.AddButton(CRM.Button("FileUpload", "FileUpload.gif", CRM.URL(343)+" &Key-1="+iKey_CustomEntity+PersonKey+CompanyKey+OpportinityKey+HasCommunication+" &PrevCustomURL="+List.prevURL+" &E=Project"));
}
Container.DisplayButton(1)=false;
if (true){
Container.AddButton(CRM.Button("ButtonMailMerge", "MailMerge.gif", CRM.URL(542)));
}
[/code]