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


  1. In 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.
  2. 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.
  3. 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.
  4. 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.