XMLHttpRequest cannot load https://mydomainname--c.eu1.visual.force.com/apex/OpportunityOneClickUpdate?id=006D000000ZRwtx. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://mydomainname.my.salesforce.com' is therefore not allowed access.

A Inline Visualforce page is throwing above error when It's calling action function. Even if this visualforce page is opened independently (and not inline) still its giving above error. Strange part is its working fine for almost all customers and not working for just one customer.

For this customer, its failing as request and origin are both from different domain, so its giving access not allowed error. Not sure why request and origin domain are coming as different.

  1. the request url is mydomainname--c.eu1.visual.force.com
  2. origin is mydomainname.my.salesforce.com

I tried similar stuff in another org (with mydomain enabled and same settings) and everything is working fine there.

  1. the request url is mydomainname--c.eu1.visual.force.com
  2. origin is mydomainname--c.eu1.visual.force.com

Already I've followed other posts too (talking about similar issue), but none really helped wrt how to address my (this post) issue:

  1. https://salesforce.stackexchange.com/questions/55676/vf-pages-fail-with-xmlhttprequest-error-no-access-control-allow-origin-heade
  2. XMLHttpRequest cannot load, No 'Access-Control-Allow-Origin' is present

Any clue or feedback on why its failing for few customers (or why the domain and origin are appearing different for certain customers) and not for others? Seems there's something small that I'm missing or some configuration that I need to get enabled (by requesting to Salesforce). Any input in this direction will be really appreciated.

  • Are you sure that "VF pages fail..." isn't applicable? Did you check with support to make sure that permission isn't enabled?
    – sfdcfox
    Nov 20, 2014 at 15:59
  • @sfdcfox My VF page isn't doing any external/webservice call, its a native page calling action:function on click of a button, and thats throwing above error. Nov 20, 2014 at 18:23
  • The first link you referenced regards that exact scenario. Read the link in the answer.
    – sfdcfox
    Nov 20, 2014 at 18:41
  • Thank you! I've already followed that blog and have requested same from salesforce. Waiting on their reply, to see if that will actually address/solve this. The problem is not restricted to INLINE vf page, even when the vf page open separately (with id in url) then too its giving error. Nov 21, 2014 at 4:12

1 Answer 1


Customer reached out to Salesforce Support and got turned OFF "Enables VF pages to be served from thesalesforce.com domain" permission. This solved the issue.

So if anyone faces similar issue, without thinking twice please raise case with Salesforce Support requesting to turn OFF "Enables VF pages to be served from thesalesforce.com domain" permission.

Thank you everyone!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .