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
Christian Szandor KnappChristian Szandor Knapp 

I built a functional VF Template with Event as RelatedTo - can I use it without a Custom Controller?

Hey there,

still a beginner: I built an VF Email Template that has a Contact as Recipient and an Event as RelatedTo - the template is functional and generates an ics file dynamically.

Actually, I would like to use it like the other templates, without having to write (and test) a custom controller.

My initial attempt was to use something like
XY.salesforce.com/email/author/emailauthor.jsp?p2_lkid=[CONTACT_ID]&p3_lkid=[EVENT_ID]&template_id=00Xb0000000IReQ&new_template=true

but that throws an error as Salesforce does not allow for an Event to be the p3_lkid/WhatId (Opportuinities, Cases, etc are ok, though)...

I have googled quite a lot but found no solution so far, everyone seems conftonted with the same problem. Please tell me there is a workaround... :-)
Ashish_SFDCAshish_SFDC
Hi , 


I do not think this is possible with out the Controller, 

See some sample code in the below links, 

http://www.eltoro.it/ArticleViewer?id=a07A000000NPRhrIAH

https://developer.salesforce.com/forums/ForumsMain?id=906F000000098txIAA

https://communities.bmc.com/message/432166

http://stackoverflow.com/questions/16653447/visualforce-email-template-returns-blank-no-rows-for-assignment-to-sobject


Regards,
Ashish