Is it possible to refresh the parent window from a Canvas App embedded inside a page layout? Considering the canvas app is stored on an external system, I receive a cross-origin error when doing so.

 Uncaught DOMException: Blocked a frame with origin "https://salesforcehook.rapdevs.com" from accessing a cross-origin frame.

Here's what I've tried:




Try to put your canvas into visualforce page, and in this visualforce subscribe event from canvas app. When you receive event you can refresh the page. Visualforce page will be in page layout.

This is the part(javascript) for visualforce:

Sfdc.canvas(function() {
    Sfdc.canvas.controller.subscribe({name : 'refreshThePage', onData : function(e) { window.top.location= 'your url - for example your record id'; }});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.