I am trying to get Opportunities from Contacts but hitting the below error:
Save error: The configuration of your org has changed, please reload the page. Missing dependent object: Field: Opportunity.ContactId
This is the code:
Contact contactObj = [SELECT Id,
(SELECT Id,Status,CaseNumber,LastModifiedDate FROM Cases),
(SELECT Id,Name,StageName,LastModifiedDate FROM Opportunities)
FROM Contact Where Id=:sobj.Id];
List<SObject> opportunitySObjList = contactObj.Opportunities; //It shows error on this line.
I googled on this and looks like it is a salesforce bug but would like to know if anyone had any suggestion/help on this?