• Todd DeRosa 4
  • NEWBIE
  • 10 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies
Hi everyone, I am trying to receive a platform event for an aura component to work in both lightning and experience cloud.  I tried the empapi, but that only works in lightning.  I then tried cometd and got it to work in lightning, but when testing in experience cloud am struggling with the following error on the cometd.configure call:  

Access to XMLHttpRequest at 'https://incredible-cloudy-240211-dev-ed.lightning.force.com/cometd/52.0' from origin 'https://incredible-cloudy-240211-dev-ed.live-preview.salesforce-experience.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I have added both urls shown above to the CORS policy page and can't find how to add the access-control-allow-origin header to the request. Here is the code where the error is occuring. I am hard coding the url for now until I can get this to work:

       action.setCallback(this, function(response) {
            var sessionId = response.getReturnValue();
            var cometd = new window.org.cometd.CometD();
            cometd.configure({
                
                url:  'https://incredible-cloudy-240211-dev-ed.lightning.force.com' + '/cometd/52.0',
                    requestHeaders: { Authorization: 'OAuth ' + sessionId},
              
                
                appendMessageTypeToURL : false
            });
            cometd.websocketEnabled = false;
I tested this with a fresh developer instance.  Install financial service cloud, then create a person account...all is good.  Then go to package manager and create a namespace, try to create, or update a person account (or any account) and you get: FinServ.AccountTrigger: execution of BeforeInsert caused by: FinServ.MoiExceptionWrapper.ValidationException: Your account record type is missing, a duplicate, or invalid. Ask your admin to check the individual record type configurations in Setup. (FinServ)
I tested this with a fresh developer instance.  Install financial service cloud, then create a person account...all is good.  Then go to package manager and create a namespace, try to create, or update a person account (or any account) and you get: FinServ.AccountTrigger: execution of BeforeInsert caused by: FinServ.MoiExceptionWrapper.ValidationException: Your account record type is missing, a duplicate, or invalid. Ask your admin to check the individual record type configurations in Setup. (FinServ)
I tested this with a fresh developer instance.  Install financial service cloud, then create a person account...all is good.  Then go to package manager and create a namespace, try to create, or update a person account (or any account) and you get: FinServ.AccountTrigger: execution of BeforeInsert caused by: FinServ.MoiExceptionWrapper.ValidationException: Your account record type is missing, a duplicate, or invalid. Ask your admin to check the individual record type configurations in Setup. (FinServ)
I tested this with a fresh developer instance.  Install financial service cloud, then create a person account...all is good.  Then go to package manager and create a namespace, try to create, or update a person account (or any account) and you get: FinServ.AccountTrigger: execution of BeforeInsert caused by: FinServ.MoiExceptionWrapper.ValidationException: Your account record type is missing, a duplicate, or invalid. Ask your admin to check the individual record type configurations in Setup. (FinServ)
I tested this with a fresh developer instance.  Install financial service cloud, then create a person account...all is good.  Then go to package manager and create a namespace, try to create, or update a person account (or any account) and you get: FinServ.AccountTrigger: execution of BeforeInsert caused by: FinServ.MoiExceptionWrapper.ValidationException: Your account record type is missing, a duplicate, or invalid. Ask your admin to check the individual record type configurations in Setup. (FinServ)