+ Start a Discussion

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

and the controller

public with sharing class TestRemoting {

public testRemoting(ApexPages.StandardController standardController) { }

@remoteAction public static void testme(){ }

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 ---