Skip to main content

I'm receiving an error while trying to view a experience community page as a logged in Portal User that embeds an Omnistudio Flex Card that is built on the Omnistudio Standard Runtime Designer "Failed to process response from Apex class Exception: INVALID_TYPE: sObject type 'ApexClass' is not supported.:

".   

 

The data source of the Flex card is Apex Remote. This works fine when previewed by admin using test params but fails with authorized Portal Users. The same happens when a remote action is called from an Omnistudio Omniscript form for authorized portal users.  

 

On checking the logs in the developer tools from the browser, I saw the params are passed to the data source input, but the apex call is failed, so the flex card loads with blank data.  

 

The Portal User is a Customer Community Login Plus licensed, and has all the Omni related object permissions (Read), sharing settings (Public Read Only), Apex Class permissions, Field Permissions for Omni related Objects and Omnistudio Experience Cloud User Permission Set assigned. 

 

If any of you faced and resolved this issue before, kindly help. 

Failed to process response from Apex class Exception: INVALID_TYPE: sObject type 'ApexClass' is not supported.:

 

#Salesforce Developer #Salesforce Developers #Developer Forums #Omnistudio 

2 risposte
  1. 23 ott 2025, 05:54

    ContentDocument document = [SELECT Title FROM ContentDocument WHERE Id IN (SELECT ContentDocumentId FROM ContentVersion WHERE Id = :cvId)]; 

     

            String fileName = document.Title; 

     

            System.debug('file Name '+ fileName); 

     

    // Prepare the metadata for the file, including the name and parent folder ID 

     

    String metadata = JSON.serialize(new Map<String, Object>{ 

     

        'name' => fileName, 

     

        'parents' => new List<String>{folderId} 

     

    }); 

     

    String boundary = '-------314159265358979323846'; 

     

    String delimiter = '\r\n--' + boundary + '\r\n'; 

     

    String close_delim = '\r\n--' + boundary + '--'; 

     

    String contentType = 'application/pdf'; // Adjust this based on your file type 

     

    // Combine the metadata and file content into a single request body 

     

    String requestBody = delimiter + 

     

        'Content-Type: application/json\r\n\r\n' + 

     

        metadata + '\r\n' + 

     

        delimiter + 

     

        'Content-Type: ' + contentType + '\r\n' +  

     

        'Content-Transfer-Encoding: base64\r\n\r\n' + 

     

        EncodingUtil.base64Encode(cv.VersionData) + 

     

        close_delim; 

     

    // Prepare the HttpRequest 

     

    HttpRequest req = new HttpRequest(); 

     

    req.setHeader('Authorization', 'Bearer ' + accessToken); 

     

    req.setHeader('Content-Type', 'multipart/related; boundary="' + boundary + '"'); 

     

    req.setMethod('POST'); 

     

    req.setEndpoint('

    https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart

    '); 

     

    req.setHeader('Content-Length', String.valueOf(requestBody.length())); 

     

    req.setBody(requestBody); 

     

    // Send the request 

     

    Http http = new Http(); 

     

    HttpResponse response = http.send(req); 

     

    System.debug(response.getBody()

0/9000