Skip to content Skip to main navigation Skip to footer

One custom button to link multiple templates/document actions

I would like to have one custom button on my object layout that can refer to multiple templates/document actions so I do not have multiple custom buttons on layouts referring to different templates/document actions?

Solutions:

  1. We have a built in app feature that allows you to create a button or link to execute any document action from the same base object. You can see this article for more detail to use this feature.
  2. If above option does not work for your use case, another option could be for your button formula you can provide an IF statement with any logic that you can use from the records field information to specific which document action Id to use.  For example if record type = Business then use one template, if record type = Person then use another template.
  3. Create a picklist field on your object that would list all the different templates/Document Action Ids. Then in your custom button you can write IF statements to look for the value of the picklist field selected and then use the appropriate Document Action Id.
  4. You can create a formula field on your object called something like “Generate Documents” and the formula field would create links for each of the forms you have. You can put a / between each one or on each line. This would provide a quick one click for each form but make the links more compact into a single field on the page layout.
  5. Create a button with Javascript to select a certain template/document action Id and then proceed to the button URL. Or some visual force page to make something else.