3

I'm looking for information over the network about EmailTemplate sObject.

I've got some questions:

  1. Could I query this object (select, insert, update, delete)?

  2. It's possible to retrive fields from different object as placeholders in the email template only if I've selected the VisualForce Template, right?

Thanks in advance.

1

Answer for your first question is yes. You can query this object. As per docs

Supported Calls

create(), delete(), describeSObjects(), getDeleted(), getUpdated(), query(), retrieve(), search(), update(), upsert()

Referernce

  1. for second yes, You need VF email template. You can try standard email template(HTML email template) but in this case you have limited options available.
  • 2
    I thought there were some limitations in CRUD operations related to which template I choose. Thanks for the quick reply. :) – Fabio Maturo Feb 24 '16 at 9:44
  • @FabioMaturo glad it help. In that case you have to specify particular use case. – Tushar Sharma Feb 24 '16 at 9:45
  • Yeah I forgot to put an use case for the second question. I meant this use case: {!Contract.OpportunityId.AccountId.Name} for example, where I'm not using only sObject but Custom objects as well, and I would like to go more levels deeper than 1 level, by using lookup field to navigate among through my data model. – Fabio Maturo Feb 24 '16 at 9:49
  • @FabioMaturo yes in that case you need VF email template. – Tushar Sharma Feb 24 '16 at 9:53
0

Yes you can query on the email template object.Follow this link for detailed explanation. https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_emailtemplate.htm Use Visual Force Template for second answer and for other templates only related objects can be used.

  • Thanks as well, as I wrote above, " Yeah I forgot to put an use case for the second question. I meant this use case: {!Contract.OpportunityId.AccountId.Name} for example, where I'm not using only sObject but Custom objects as well, and I would like to go more levels deeper than 1 level, by using lookup field to navigate among through my data model." For this scenario I must use VF template rather than HTML Template, right? – Fabio Maturo Feb 24 '16 at 9:52

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.