How to add a Generate Document button in a Detail page - Example

Last updated May 01 2019

Following is a detailed example of how to add a generate button to a Detail page:
A- Steps in FormTitan
     1. Create a new form.
     2. Set up the Salesforce Get integration to populate the fields.
     3. Create the PDF mapping.
     4. Configure the button settings in the PDF.
     5. Set up the Push integration to send the generated PDF files to Salesforce as attachments.
B- Steps in Salesforce
     In the Salesforce standard objects you will have a Generate button set up for you, however if you wish to add this button to your custom
 

     objects you will need to do the following:
      1. Create a new button in Salesforce (a detail page button).
      2. Add the button to your object layout.

C- Test the button


A- Steps In FormTitan
:

In this example we will create a form that populates contact information based on a contact ID from Salesforce, and we will use an SF button to view and generate this PDF.

1- Create a new form
- Drag a textbox and change its label to “Contact last”.



- Drag another textbox and change its label to “Contact first”.
- Drag a third textbox and change its label to ‘Assistant’.
- Drag a Hidden field and change its name to Contact_id.




- give your form a name: SF Button form1.

- save it.

2- Set up the Salesforce Get integration to populate the fields


- Authenticate with Salesforce.


- Choose “Contact” object.


- Set a condition:
Contact_id equals Contadt ID


- Map the fields:
Contact last → Last Name
Contact first → First Name
Assistant → Assistant Name


3- Create the PDF mapping
- You can create any type of PDF (Manual PDF, Auto PDF or both) in this example we will create a regular manual PDF and an Auto PDF.


- Press on “page” and upload your scanned pdf document.


- Open the ‘Element’ dropdown and add your fields ontop of the PDF.


4- Configure the button settings
- Click on ‘Settings’ option in the toolbar.


- Go to the  ‘Salesforce Button’ category.
- Press on the ‘Configure’ button.


- Open the ‘Salesforce object settings’ category and select the Object your Salesforce workflow is working with: Contact.
- Map the the record ID sent from SF to your form: Contact_id.



- Choose the Classic Salesforce version.
- In the Classic version you have 2 types of buttons you can create:
Detail page button - this will generate a code for a button that can be added to a specific record page.
List button - this will generate a code for a button that can be added to a record list page.
- Choose: Detail page button

- and last but not least - make sure the ‘Enable’ toggle is turned on.


Then create the Auto PDF
.

- Press on the ‘Configure’ button.


- Turn on the ‘Enable auto PDF mapping’ and ‘Auto fit’ Checkboxes.


- Open the ‘’Salesforce button’ category and press on ‘Configure’.


- Make sure the selected object is: Contact.
- and the record ID is: Contact_id.


- Press on ‘Apply’ and save the form.


5- Set up the Push integration to send the generated PDF files to Salesforce as attachments.
- Authenticate with Salesforce (already authenticated).


- Choose “Attachment” object.


- In the ‘Action’ category leave the “Create’ option selected.
- Map the fields:
Parent ID → Contact_id
File name → PDF mapping
Body → PDF mapping


- Press ‘Apply’
- Press on the ‘Add object’ button to add another push action.


- Choose “Attachment” object again.
- In the ‘Action’ category leave the “Create’ option selected.
- Map the fields:
Parent ID → Contact_id
File name → Auto PDF
Body → Auto PDF


- Press ‘Apply’ then ‘Finish’ and save the form.


B- Steps in Salesforce
In the Salesforce standard objects you will have a Generate button set up for you, however if you wish to add this button to your custom
     objects you will need to do the following:
1. Create a new button in Salesforce (a detail page button)
- Give it a name.
- Choose "Detail page button" in the Display type field.
- Select "URL" option from the 'Content source' dropdown
- and paste the button code (from bullet #2) in the Textarea below.


2. Add the button to your object layout

- Go to a specific record in the object you want to add the button to.
- Open the side menu and choose 'Edit layout'.


- Choose 'Buttons' in the 'Contact layout'. 
- Drag your button to the 'Custom buttons' area
- and finally save the layout.



C- Test the button
- Enter your  salesforce account.
- Create a test contact: Jill Heart, assistant name: James.
- Remain in this record and Press on the ‘Generate’ button.


- A pop up window will open and will display the forms and PDF files available for generation.
In this case you will see 2 PDF of your form “SF Button form1”.  
- Select this form in the list and press on the blue  “Generate” button.




CommentsLogin Required
Didn’t find what you were looking for?
Try the following for assistance or Use the Search box.