1

I have created a junction object called 'Test1__c' between Opportunity and Contact, soql query on Test1__c object return nothing and got below error. "System.QueryException: List has no rows for assignment to SObject". I have given read permissions to the Opportunity, Contact and Test1__C object on the Profile of the site guest user but the problem still persists. Also mark apex class as a 'Without Sharing'. On sharing setting module please the see the below setting: Sharing Setting

I did all the possible ways that need to resolve this problem but no use. Please help me to resolve this issue, I would be so thankful!

3
  • If you run the query in the developer console or through an anonymous apex script, does it return record? Could you show the code that contains the query? Commented Oct 17, 2021 at 6:29
  • In developer console it returns the record, sorry rael_kid I can not share the code and thanks for the response.
    – Satish
    Commented Oct 18, 2021 at 3:45
  • @rael_kid, If removed Applicant__c=:contactId then it returns data.WHERE Is_Current_Employer__c = true and Applicant__r.Applicant_Type__c = 'Primary Applicant' AND Applicant__c =:contactId LIMIT 1
    – Satish
    Commented Oct 18, 2021 at 11:10

0

You must log in to answer this question.

Browse other questions tagged .