1

I have created a custom object called email scheduler that have custom fields like template 1, template 2, template 3...etc.

I have created custom date fields like Delivery Date 1, Delivery Date 2, delivery Date 3... etc.

I would like to make the template 1 a picklist value that would fetch the email templates so that when I create a workflow it will send to the contact after clicking save button.

enter image description here

And make the template 1 field like the Email Template field.

enter image description here

1

Have you tried to create a Visualforce Page through an extension collect in a SELECT a list the names of the templates created ? With this you can generate a dinamic 'Picklist' field in a visualforce, and save the value in another field.

You can storage your templates in a folder and SELECT:

[SELECT Id, Name FROM EmailTemplate WHERE Folder.DeveloperName = 'MyCustomTemplates'] for example.

Then you can send your email via APEX loading the specified template in your field, feeded via your dinamic visualforce picklist.

--EDITED--

You can use this code: Visualforce Picklist from Javascript Query

0

EDIT: some formatting

Unfortunately, that's not possible. See this article.

The only thing that you could do is create a new custom object "Email Template" that stores the unique ID of the Salesforce email template and links it to the display name (so you will need 2 custom fields).

Then you could change the field type of template 1, 2, 3, etc. to a lookup to Email Template. Attention: if you want the Email Template records to stay up to date, you would have to add a new record to this table every time you create a new email template in Salesforce.

  • Could you please show an example – DominicSeb Apr 26 '16 at 15:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.