「XMLHttpRequest cannot load, No 'Access-Control-Allow-Origin' is present in Visualforce page (XMLHttpRequest を読み込めません。Visualforce ページに Access-Control-Allow-Origin が存在しません)」というエラーがユーザーに表示される
カスタムコンポーネントを含むカスタムオブジェクトの埋め込み Visualforce ページで、問題が発生する場合があります。このページは、カスタムオブジェクトの標準ページレイアウトに埋め込まれる場合があります。 そのカスタムオブジェクトレコードが表示されると、VF ページが表示されます。その後ページでポーリングが開始され、プロセスがいつ完了するかを確認します。このポーリング要求が失敗するのは、要求の起点が別のドメインであるためです。
たとえば、[起点] ヘッダーが「https://na14.salesforce.com」に設定されている場合に、要求が「c.na14.visual.force.com」に送信されるために失敗します。
この問題は、組み込み HTTP(S) プロキシを使用して解決できます。 標準の設定メニューでプロキシを有効化できます。
Classic の場合: [設定] | [セキュリティコントロール] | [リモートサイトの設定]
Lightning の場合: [設定] | [セキュリティ] | [リモートサイトの設定]
ここで、eu1.salesforce.com などの独自の Salesforce インスタンスを追加できます (https を有効にすることを忘れないでください)。
リモートサイトの設定方法の詳細をご確認ください。
2 番目のステップでは、URL を「https://c.na1.visual.force.com/services/proxy」に設定するように AJAX 要求を変更する必要があります。
最善のソリューションは、Salesforce の完全に文書化された HTTP プロキシサービスを使用することです。
メモ: サイトが非アクティブである場合、CORS エラーの発生が予想されます。そのため、サイトがアクティブであることを確認してください。
追加の参照:
Http クラス
000386868

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.