function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Alpesh Patel 16Alpesh Patel 16 

Cross domain error

Hi,

I have encountered a bizzare error. I have made a custom object A and on the standard view of this custom object A, I have placed a custom buttom B. Based on some condition I want to show/hide this custom button B. For this I have added a custom visualforce section inside the standard layout. I have written logic to access this custom button B and show/hide it. But when the page gets loaded, it gives me an error
"SecurityError: Blocked a frame with origin "https://c.ap1.visual.force.com" from accessing a frame with origin "https://ap1.salesforce.com". Protocols, domains, and ports must match." in Chrome and "Permission denied to access property 'document'" in Firefox.
As per my understanding, the Visual force page uses different domain (https://c.ap1.visual.force.com) then the parent standard page(https://ap1.salesforce.com).

Can someone help me solve this ?

Thanks.
KevinPKevinP
use a formula merge field to determine the hide/show of this bit. ie: {!shouldIshowthis}