You need to sign in to do that
Don't have an account?
sumanth v 18
Inner query issue
Opportunity opp = [select id,(select id,Test__c,Name,from Vendor_Groups__r) from opportunity where id =: oppid];
system.debug('@@@@Check1'+opp.Vendor_Groups__r); No compile error
system.debug('@@@@Check1'+opp.Vendor_Groups__r.Test__c); Compile error as shown below
Error: Compile Error: A non foreign key field cannot be referenced in a path expression: Vendor_Groups__r
system.debug('@@@@Check1'+opp.Vendor_Groups__r); No compile error
system.debug('@@@@Check1'+opp.Vendor_Groups__r.Test__c); Compile error as shown below
Error: Compile Error: A non foreign key field cannot be referenced in a path expression: Vendor_Groups__r
to access
Opportunity opp = [select id,(select id,Name,Test__c from Vendor_Groups__r) from opportunity where id =: oppid];
system.debug('@@@@Check1'+ opp.Vendor_Groups__r);
system.debug('@@@@Check1'+ opp.Vendor_Groups__r[0].Test__c);
OR play a for loop on Vendor_Group__c
for(Vendor_Group__c vg : opp.Vendor_Groups__r){
system.debug('@@@@Check1'+ vg.Test__c);
}
i hope it helps you.
kindly Let me inform if it helps you and close your query by choosing best answer if you got your right answer so it can helps others
thanks
sfdcmonkey.com
Hello,
Thank You