【发布时间】:2019-12-27 15:35:12
【问题描述】:
我正在处理一个 Visualforce 电子邮件模板,该模板将从 Salesforce 中的父贷款 (LLC_BI__Loan__c) 记录发送,并且我正在尝试包含来自子实体参与 (LLC_BI__Legal_Entities__c) 记录的字段。
我无法通过正确的父(贷款)ID 来获取正确的子记录。谁能看到我哪里出错了?
提前谢谢你
组件:(名称 = BorrowerRecordsFromLoans)
<apex:component controller="BorrowersOnLoans" access="global">
<apex:attribute name="currentRecordId" description="" assignTo="{!loanId}" type="Id"/>
<apex:dataTable value="{!relatedBorrowers}" var="borrower">
<apex:column >
<apex:facet name="header">Borrower Name</apex:facet>
{!borrower.LLC_BI__Borrower_Type__c}
</apex:column>
</apex:dataTable>
</apex:component>
控制器:(名称 = BorrowersOnLoans)
public class BorrowersOnLoans {
public Id loanId { get; set { loanId = value; loadChildren(); } }
public LLC_BI__Legal_Entities__c[] relatedBorrowers { get; set; }
void loadChildren()
{
List <LLC_BI__Legal_Entities__c> entList = new List<LLC_BI__Legal_Entities__c>();
for(LLC_BI__Loan__c loan:
[SELECT Id, (SELECT Entity_Name__c FROM LLC_BI__Legal_Entities__r ORDER BY Borrower_Number__c) FROM LLC_BI__Loan__c WHERE Id = :loanId])
{
for(LLC_BI__Legal_Entities__c ent:loan.LLC_BI__Legal_Entities__r) entList.add(ent);
}
}
}
电子邮件模板:
<c:BorrowerRecordsFromLoans currentRecordId="{!relatedTo.Id}" />
【问题讨论】:
标签: email templates visualforce