You need to sign in to do that
Don't have an account?
HelloSan
i need a apex trigger code to fetch child records Opportunities for each record Year(Custom Object) and i need to process those child records in loop
eg for Year 2015 i have four Opportunitites i need to fetch those four opportunites based on parent id
for(Year__c y: ylist)
{
for(Opportunities opp : y.Opportunities)
{
}
for(Year__c y: ylist)
{
for(Opportunities opp : y.Opportunities)
{
}
Can you please elaborate your requirment .
Query those opportunities based on Parent Id.After getting the records, iterate in a loop .
for(Year__c y: [Select ID,[Select Name From Opportunityes] From Year__c]){
for(Opportunityes opp : y.Opportunities){
system.debug('Opportunity Name---->'+opp.Name);
}
}
Hope this will helpfull !!!!
Thanks,
Sagarika