I have created a visualforce page to display as txt, so that when a button is clicked, a txt file is downloaded to the computer. I need this txt document to be a comma-separated collection of fields.
The main object is Loan
, which can have multiple Legal_Entities
and Loan_Collateral2
records.
I started with using the standardController and then writing an extension to query and gather the child records.
Now I don't know how to get the fields from the query into the visualforce page.
And I've been staring at it for so long, it is making less and less sense.
The following code presents me with "Unknown property 'LLC_BI__Loan__cStandardController.borList'"
VFP
<apex:page contentType="text/plain#{!LLC_BI__Loan__c.name}.txt"
standardController="LLC_BI__Loan__c" extensions="transportExtend">
<apex:variable var="lo" value="{!LLC_BI__Loan__c}"/>
<apex:variable var="b" value="{!borList}"/>
test fields: {!b.name},{!$User.Officer_Codes__c},
<!--1ApplicationCode-->CCD,<!--2LoanNumber-->{!lo.LLC_BI__lookupkey__c},<!--3Mod-->90,<!--4IntType-->1,
<!--5PmtType-->0,<!--6CallCode-->{!lo.Purpose_Code__c},<!--7BranchNo-->{!lo.LLC_BI__Branch__r.LLC_BI__Branch_Id__c},
<!--8ProceedsAmtBLANK-->,
</apex:page>
APXC
public with sharing class transportExtend{
public ApexPages.StandardController stdController {get;set;}
public Id currentLoanId {get;set;}
public transportExtend(ApexPages.StandardController ctrl){
LLC_BI__Loan__c loanObject = (LLC_BI__Loan__c)ctrl.getRecord();
currentLoanId = loanObject.Id;
stdController=ctrl;
}
public List<LLC_BI__Legal_Entities__c> getBorrower(){
List <LLC_BI__Legal_Entities__c> borList = new List<LLC_BI__Legal_Entities__c>();
for(LLC_BI__Legal_Entities__c bor: [SELECT Id,name
FROM LLC_BI__Legal_Entities__c
WHERE LLC_BI__Loan__c =:currentLoanId
AND LLC_BI__Borrower_Type__c='Borrower'
LIMIT 1]){
borList.add(bor);}
return borList;
}
public List <LLC_BI__Legal_Entities__c> getCoBorrower(){
List <LLC_BI__Legal_Entities__c> coBorList = new List<LLC_BI__Legal_Entities__c>();
for(LLC_BI__Legal_Entities__c coBor: [SELECT Id, name
FROM LLC_BI__Legal_Entities__c
WHERE LLC_BI__Loan__c = :currentLoanId
AND LLC_BI__Borrower_Type__c = 'Co-Borrower'
LIMIT 1]){coBorList.add(coBor);}
return coBorList;
}
public List <LLC_BI__Loan_Collateral2__c> getCollateral(){
List <LLC_BI__Loan_Collateral2__c> collateral = new List<LLC_BI__Loan_Collateral2__c>();
for(LLC_BI__Loan_Collateral2__c col: [SELECT Id, name, LLC_BI__Collateral__r.Id, LLC_BI__Collateral__r.CCD_Vehicle_Description__c
FROM LLC_BI__Loan_Collateral2__c
WHERE LLC_BI__Loan__c = :currentLoanId
AND LLC_BI__Is_Primary__c=true]){collateral.add(col);}
return collateral;
}
}