A Gutenburg button can launch the managed-package Visualforce document-generation experience from a Salesforce record. The button requires the current record ID and can optionally include a template ID to preselect a specific template.

Required parameter: recordId

Use the recordId parameter to tell Gutenburg which Salesforce record will provide the document context.

Example supplied for an Account button:

{!URLFOR('/apex/Gutenburg__CreateDocuments?recordId=' + Account.Id )}

When adapting this pattern to another object, use that object’s record ID merge reference.

Optional parameter: templateId

Add templateId when the button should automatically select a specific Gutenburg template.

The optional parameter follows this pattern:

&templateId=TEMPLATE_ID

Example supplied with a template selected:

/apex/Gutenburg__ViewDocument?recordId={!Account.Id}&templateId=a02gL000004Acg1QAC

Replace the example template ID with the ID of the template you want the button to use.

When to omit templateId

Leave out templateId when the user should choose the appropriate template after opening Gutenburg.

When to include templateId

Include templateId when the button represents a specific document workflow and the template should already be selected for the user.

Configuration checklist

Before making the button available to users, confirm that:

  • The button passes the correct Salesforce record ID.
  • The selected template ID, if used, is the intended Gutenburg template.
  • The running user has a Gutenburg license and the appropriate permission set.