You need to sign in to do that
Don't have an account?
Akanksha sharma 15
there is look up relationship between opportunity and case i need to find soql qery to find all related case for opportunity
there is look up relationship between opportunity and case i need to find soql qery to find all related case for opportunity here is my query please anyone help where i am wrong
<apex:page standardController="Opportunity" extensions="stucasecontroller1"> <apex:form > <apex:pageBlock title="relatedlist details"> <apex:pageblockSection title="case realted list "> <apex:pageBlocktable value="{!cas}" var="c" > <apex:column value="{!c.status}"/> <apex:column value="{!c.origin}"/> </apex:pageblocktable> </apex:pageblockSection> </apex:pageBlock> </apex:form> </apex:page> public class stucasecontroller1 { public string oppID{get;set;} public List<case> caslist{get;set;} public stucasecontroller1 (){ cas=[select Id,status,origin,opportunity__r.Name,opportunity__c from case where opportunity__c=:oppID]; } }
Next add your vf page to Opportunity page layout so it can take current opportunity id to query all realted calse :
edit opportunity page layout and drag your vf page to opportunity detail page :
output :
Thanks, let us know if it helps you, and if it solved your issue kindly close this query with best answer so it will helps others in future
All Answers
Next add your vf page to Opportunity page layout so it can take current opportunity id to query all realted calse :
edit opportunity page layout and drag your vf page to opportunity detail page :
output :
Thanks, let us know if it helps you, and if it solved your issue kindly close this query with best answer so it will helps others in future
I used this but with this page i am getting list of all related case but what i want related case for particular opportunity.my scenario is i have one clone case button on standard page of opportuntiy when i click on this button i will get related cases of that opportunity .but i am getting all the cases that is related to all the opportunity.Please help me out
create a custom detail page clone button which is open your VF page,