• Best Visa 12
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies
Hello I have a user that is trying to Access Salesforce through Okta App, our org has SSO enabled and the user is able to access SF thorough Okta dashboard  web ,

Tried re-directing user using custom domain but everything is pushing user back to login page.

Note: User is able to access other applications on Okta mobile App however both Salesforce App and Salesforce through Okta are only re-directing him to the login page.
 
Hello, I keep getting an ApexApplication email saying:

Failed to invoke future method 'public static void UploadDocument(String)' on class 'S3Controller' for job id '7073l0000FSMaBy'

caused by: System.LimitException: Query of LOB fields caused heap usage to exceed limit.



The line of code that is causing the error is this:
List<ContentVersion> versions=[SELECT VersionData,Title,ContentDocumentId,FileExtension FROM ContentVersion WHERE ContentDocumentId = :ids AND IsLatest = true];

How can I change my code so that if that error comes up, I still query the files but ONLY query the 1st file (as a way of avoiding the error)?


I TRIED this:

        List<ContentVersion> versions = new list<contentversion>();
        try{
        versions=[SELECT VersionData,Title,ContentDocumentId,FileExtension FROM ContentVersion WHERE ContentDocumentId = :ids AND IsLatest = true];
        }
        catch (exception e){
            versions=[SELECT VersionData,Title,ContentDocumentId,FileExtension FROM ContentVersion WHERE ContentDocumentId = :ids AND IsLatest = true limit 2];
        }

BUT it didn't work. I am still getting the same ApexApplication error email.