You need to sign in to do that
Don't have an account?
ManoharSF
Visualforce email template
Hi there, can some one please let me know whats missing as I dont get the records back for my VF email template?
Any help is greatly apreciated.
Thanks
Manohar
<messaging:emailTemplate subject="Deign Package Rejected Reasons" recipientType="Contact" relatedToType="Construction_Package__c"> <messaging:htmlEmailBody > <c:rejectedlist CotId="{!relatedTo.Id}" /><br/><br/> </messaging:htmlEmailBody> </messaging:emailTemplate>
componentt name :rejectedlist
<apex:component controller="rejectedlist" access="global"> <apex:attribute name="CotId" type="Id" description="Id of the Construction Package" assignTo="{!conID}"/> <table border = "2" cellspacing = "5"> <tr> <td>Name</td> <td>Rejection Reason</td> <td>Suggested Resolution</td> <td>Status</td> </tr> <apex:repeat value="{!rejectedlist}" var="rl"> <tr> <td>{!rl.Name}</td> <td>{!rl.Rejection_Reason__c}</td> <td>{!rl.Suggested_Resolution__c}</td> <td>{!rl.Status__c}</td> </tr> </apex:repeat> </table> </apex:component>
public with sharing class rejectedlist { public Id conID {get;set;} public List<Rejection_Checklist__c > getrejectedlist () { list <Rejection_Checklist__c> rejlst; rejlst = [Select id, Name, Rejection_Reason__c, Suggested_Resolution__c, Status__c from Rejection_Checklist__c where Construction_Package_ID__c = :conID AND (Status__c = 'Rejected' OR Status__c = 'Not Resolved')]; return rejlst ; } }
Fixed. the 'MAC' in the ID string was throwing off. Not sure where its coming from.
After having below, it worked.
conID = conID.replace('MAC','');
Thanks for all the suggestions.
All Answers
Please remove with sharing key word from your class and check it again.
Hi,
In Email template there is a button "Send Test and Verify Merge Fields" ,when you click on that button a popup is open and there r two mandatory fields,One -Recipient Record Second - Related To Record. Select "Construction_Package__c" record in related to Record and 'Contact' record in Recipient Record.
and click on 'OK' then you can see your result in 'HTML preview'
Please let me know if u have any problem on same and if this post helps u plz give KUDOS by click on star at left.
@Puja, preview still dint give me any records. Also made sure soql is valid and is pulling the right record.
One thing I noticed is related to I'd is concatenated with 'MAC', is that. Normal?
Thanks for checking.
Manohar
Hi,
Please check in the following block ( our block )
http://mindfiresfdcprofessionals.wordpress.com/
I have write down a post regarding same with Title
Send mail with attachment using Visual force Email Template and visual force Component
please cross check uor code with this post.
Please let me know if u have any problem on same and if this post helps u plz give KUDOS by click on star at left.
Fixed. the 'MAC' in the ID string was throwing off. Not sure where its coming from.
After having below, it worked.
conID = conID.replace('MAC','');
Thanks for all the suggestions.