You need to sign in to do that
Don't have an account?
Yukinon
Dynamic SOQL Query in each opportunity record email template
I want to show different data in the email template depending on the opportunity I'm using it on. Is it possible?
For Example:
When I'm on this opportunity record then it should only show the first product on the email template since it's the only related product on this record.
Controller:
Component
For Example:
When I'm on this opportunity record then it should only show the first product on the email template since it's the only related product on this record.
Controller:
public class ActiveOpportunityLineItems { private final List<OpportunityLineItem> lineItems; public ActiveOpportunityLineItems(){ lineItems = [SELECT ProductCode,UnitPrice,Description,Status__c From OpportunityLineItem WHERE Status__c = 'ACTIVE'; } public List<OpportunityLineItem> getActiveOpportunityLineItems(){ return lineItems; } }
Component
<apex:component controller="ActiveOpportunityLineItems" access="global"> <apex:dataTable border="below" value="{!ActiveOpportunityLineItems}" var="active_opp" width="75%" style="text-align:center;" > <apex:column value="{!active_opp.ProductCode}" headerValue="Product Name" /> <apex:column value="{!active_opp.Description}" headerValue="Line Description"/> <apex:column value="{!active_opp.UnitPrice}" headerValue="Sales Price"/> <apex:column value="{!active_opp.Status__c}" headerValue="Status"/> </apex:dataTable> </apex:component>
Please use below code:-
Controller:
COMPONENT:-
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
Please use below code:-
Controller:
COMPONENT:-
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh