Record action buttons allow users to generate documents directly from Salesforce record pages with a single click. This guide shows you how to add Magic Merge buttons to your page layouts.
Action buttons provide quick access to document generation:
Note: Magic Merge buttons must be created before they can be added to page layouts. See the "Creating Custom Buttons" section below.
To create a button that merges a specific template:
Use the Magic Merge JavaScript API to trigger the merge:
{!REQUIRESCRIPT("/soap/ajax/48.0/connection.js")}
MagicMerge.generateDocument('{!Template.Id}', '{!Account.Id}');
Tip: Replace Template.Id with your actual template ID and adjust the object reference (Account.Id) based on your object type.
Generate a document for the current record being viewed. Best for invoices, contracts, and individual reports.
Bulk generate documents for multiple selected records from a related list. Useful for batch processing orders, statements, or certificates.
Process multiple records selected from a list view. Ideal for mass mailings or bulk document generation.
Yes. Use page layout assignments to show different layouts (with different buttons) to different user profiles.
Salesforce allows multiple custom buttons per layout. However, for better user experience, limit buttons to the most commonly used merge operations.
Yes. In Lightning App Builder, add the "Magic Merge" component to your record page and configure it to display specific merge buttons.
Need Help? Contact support if you need assistance configuring buttons for complex merge scenarios or custom object relationships.