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
FredrickUNFredrickUN 

JSRemoting Error: Permission denied to access property “document” when using inline VF page

I have created a VF page that I intend to place inline on standard page layouts.

The problem I'm having is that unless the I set the access modifiers to global rather than public I get the following error message

'Error:Permission denied to access property "document"'

Any help on this will be greatly appreciated.

Here's some sample code

VF Page:
<apex:page showHeader="false" Standardcontroller="Account" extensions="TestRemoting" >
Some text here
<apex:page>

and the controller

public with sharing class TestRemoting {

public testRemoting(ApexPages.StandardController standardController) { }

@remoteAction public static void testme(){ }

}
bob_buzzardbob_buzzard
According to the docs this is the expected behaviour : https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_js_remoting_scope_visibility.htm

--- snip ---

@RemoteAction Scope    Visualforce Page    Non-Global Component    Global Component    iframe
Global Remote Method     Allowed                  Allowed                              Allowed                     Allowed
Public Remote Method     Allowed                   Allowed                              Error                         Error

--- snip ---