You need to sign in to do that
Don't have an account?
Akanksha sharma 15
query to find all case related to the oppotunity can anyone let mw know where i am wrong
select Id,status,Priority,opportunity__r.Name,opportunity__c from case where id=:Opportunity__c
select Id,status,Priority,opportunity__r.Name,opportunity__c from case where id=:Opportunity__c
List<Case> caseList = Database.query('select Id,status,Priority,opportunity__r.Name,opportunity__c from case where opportunity__c = :oppId');
Case and Opportunities are not related to each other , both are related to Account object, so you can fetch account related Cases and opportunity,
not find all case from opportunity, because it's not salesforce standard functionality.
Kindly mark my solution as the best answer if it helps you.
Regards'
Mukesh