function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
KongKong 

SOQL in VisualForce Email template

I am experimenting with Visualforce email templates.

1.) Is there a way to run a query for a list of open Leads that belongs to a specific campaign?
2.) Can I then have the results render as a csv?


Essentially I would like something similar to this,
http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_messaging_emailTemplate.htm
but want it to display information for Lead instead of Account.

Thank you in advance for any help.

prakash_sfdcprakash_sfdc
What issues are you facing ? Try replacing the object name from Account to Leads and its fields.
NoodleNoodle

I'm trying to do something similar.

I have a custom object similar to tasks called "Actions". I would like to send an email to users once a week to list all their Actions "Tasks", that are late.

With the example above, I can't see where you set a condition (SOQL). i.e. Select Name, Due_Date__c From Actions__c Where Status__c = 'Late'

Any ideas?