Skip to content Skip to main navigation Skip to footer

Creating Custom Button Code for Partner Communities & Salesforce Internal

When using custom buttons in partner community and Salesforce internal, you need to check the following:

  1. Make sure the community user is an assigned Opero Documents user.
  2. Make sure any community you are using is ACTIVE and PUBLISHED. This will make the community domain active.
  3. Make sure your custom button is both on Classic layout and community page layout.
  4. Then Modify Button Code:

You need to modify button code to include “{!URLFOR($Site.Prefix + ‘/” at the beginning of the button code that is showing at bottom of document action.

Example of original button code in Document Action:

Example of how to change button code to work with Partner Community: 
{!URLFOR($Site.Prefix + ‘/apex/rsdoc__GenerateDocument?id=’ + Lead.Id + ‘&templateId=GDT-000004&attach=true&output=pdf&emailAction=autosend&emailTo=’ + Lead.Id + ‘&emailTemplate=00X28000001SwGo’)}

This button format needs to be used in communities and salesforce internal to avoid URI mismatch error message. Salesforce article showing this is common issue with these types of org’s:

If community customers have issue with redirecting to login page when use (redirect, email preview, template preview) then have system admin in Salesforce go to System Administrator profile -> Session Settings -> and enable “Separate Experience Cloud site and Salesforce login authentication for employees.”