TransWikia.com

Refreshing Parent from Canvas App embed in a Page Layout

Salesforce Asked by jpmonette on November 30, 2021

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:

window.parent.location.reload()

Thanks

One Answer

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'; }});
 })

Answered by MarosSitko on November 30, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP