You need to sign in to do that
Don't have an account?
gsickal
DML not allowed on EmailTemplate?
I tried to create an EmailTemplate in apex but got the message "Save Error: DML not allowed on EmailTemplate". Is there a reason we cannot create or update email templates in apex now or any other way to do this?
=====================================================================
We're able to reproduce this issue and it is most likely expected behavior, but please could you provide us what your business reason is for wanting to create or update EmailTemplates with Apex Code.
We can send this on to the PM to position this as a feature request (to open up access to these tables) or as a documentation error (add EmailTemplate to the list of objects that do not accept DML statements).
Should you have further questions please let me know.
=====================================================================
By the time this response was received we had already reimplemented the functionality without creation of EmailTemplate and hence did not bother to explain the use case because it did not seem like it would change anything in the near future.
So, I guess it should be considered as a bug in the documentation rather than in the actual system, i.e. documentation should not say than EmailTemplates can be created using API.
So I guess I'll have to use Apex to call the API to meet the business requirement.