You need to sign in to do that
Don't have an account?
prasanth puvvada 4
soql subquery not coming in VF page.
i have written apex class (its working fine) and VF page that is retriving the data from sub query, the error is coming at getting the data from subquery. Error in VF:page is :-
Error: Invalid field loan__r for SObject customer__c
Visual force code:
Apex code:
Error: Invalid field loan__r for SObject customer__c
Visual force code:
<apex:page controller="solq3"> <apex:form> <apex:pageblock> <apex:pageblocktable title="customers and transactions" var="a" value="{!cuts}"> <apex:column value="{!a.id}" /> <apex:column value="{!a.Account_Type__c}" /> <apex:column value="{!a.City__c}" /> <apex:column value="{!a.Customer_name_del__c}" /> <apex:column> <apex:repeat value="{!a.loan__r}" var="b"> {!b.Asset_cost__c} . {!b.Salary__c} <br/> </apex:repeat> </apex:column> <!-- <apex:column value="{!a.Asset_cost__c}" /> <apex:column value="{!a.Salary__c}" /> --> </apex:pageblocktable> </apex:pageblock> </apex:form> </apex:page>
Apex code:
public class solq3 { public list<customer__c> cuts{set;get;} public list<account> accs{set;get;} public solq3() { accs=[select id,name,industry,(select lastname,firstname,phone from contacts) from account]; cuts=[select id,Account_Type__c,City__c,Customer_name_del__c, (select Asset_cost__c,Salary__c,Applied_Date__c,Security__c from loans__r) from customer__c]; } }
Please try below code :-
Please mark this as solution if this will help you
All Answers
Please try below code :-
Please mark this as solution if this will help you
Amit Chaudhary............