How to Resolve the Refused to Connect Error in Salesforce ?
Published:
This issue may occur in the following scenarios:
- After completing a Template Send.
- After completing a Create Template Send.
- After completing a Document Send.
The issue is typically encountered during the redirect process back to the Salesforce after the operation is completed.
Steps to Solve:
To resolve the issue, disable Clickjack Protection for customer Visualforce pages with headers disabled in Salesforce Session Settings.
- Select the gear icon in the upper right-hand corner of the screen and select Setup.
- In the quick find on the left, enter Session Settings.
- Once session settings is selected, navigate to Enable clickjack protection for customer Visualforce pages with headers disabled and deselect the check box.
- Select Save and ensure the changes are applied successfully.
Content will now be displayed correctly.
Workaround:
If clickjack protection must be enabled within an org and stay active, then you can add “*.force.com” as a trusted site.
- Setup -> Session Settings -> Trusted Domains for Inline Frames
- Click Add Domain
- Add the new trust site:
Url = *.force.com, Context = Visualforce page - Select Save and ensure the changes are applied successfully.