You need to sign in to do that
Don't have an account?
Querying Payment from Opportunity - Relationship Fields
I want to show payment data on a visual force page. I cannot get this to work. I am thinking that I have correctly queried through a nested relationship statement and all is well, but this is not happening. The visualforce page is here:
and the controller is here:
Does anyone have any idea if this is because my npe01__OppPayment__r field is reference NPSP managed fields and is not standard Salesforce payment or is this just a bad query? I think theoretically this makes sense. Why will this not show on the page? The only error I'm getting is Unknown property 'TestRollUpData.o'. On my TestRollUpData page and controller.
Thanks.
<apex:page controller="TestRollUpData"> <apex:form > <apex:pageBlock title="Tests" id="more_tests"> <apex:pageBlockTable value="{! Opportunity }" var="o"> <apex:column value="{! o.Name}"/> <apex:column value="{! o.Designated_Fiscal_Year__c}"/> <apex:column value="{! o.Amount}"/> </apex:pageBlockTable> <apex:pageBlockTable value="{! o.npe01__OppPayment__r }" var="x"> <apex:column value="{! x.npe01__Payment_Date__c}"/> </apex:pageBlockTable> <apex:repeat value="{! Opportunity }" var="x"> <script> document.getElementById('totalRevenue').value = parseFloat(document.getElementById('totalRevenue').value) + {! Opportunity.Amount}; </script> </apex:repeat> </apex:pageBlock> </apex:form> </apex:page>
and the controller is here:
public class TestRollUpData { public List<Opportunity> getOpportunity(){ List<Opportunity> tests = [SELECT Name, Amount, Designated_fiscal_year__c, (SELECT npe01__Payment_Date__c FROM npe01__OppPayment__r ) FROM Opportunity WHERE Designated_fiscal_year__c = '2020-2021' LIMIT 10]; return tests; } }
Does anyone have any idea if this is because my npe01__OppPayment__r field is reference NPSP managed fields and is not standard Salesforce payment or is this just a bad query? I think theoretically this makes sense. Why will this not show on the page? The only error I'm getting is Unknown property 'TestRollUpData.o'. On my TestRollUpData page and controller.
Thanks.
Can you try the above code in visualforce page?
Please try this