How to call an Apex REST resource from a Salesforce-hosted (internal React, multiframework) app without CORS error?
I have a Salesforce internal React app (hosted on the platform, served from a *.salesforce.app domain) that needs to call an Apex REST resource defined in the same org. Apex Class is defined as: @RestResource(urlMapping='/opportunities/*') global with sharing class OpportunityApi { @HttpGet global static List<Opportunity> getOpportunities() { return [SELECT Id, Name, Amount, StageName, CloseDate FROM Opportunity WITH USER_MODE LIMIT 200]; } } App URL: https://<my-domain>--c.trailblaze.my.salesforce.app/app/c__Reacttest1 I tried calling the Apex REST endpoint directly from the browser: GET http
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.