Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In an email template it is possible to reference attributes by doing...


However, if the attribute must be in your model. If you did,


The save would not be allowed. You might think fair enough it is not in the model it is catching an error. But what if you are writing an email template which uses attributes that are going to come from another package? Is there anything like dynamic soql which allows the check to made at runtime?


share|improve this question
You could use a component driven by a controller to do the dynamic soql? – techtrekker Feb 13 '13 at 23:32
@dublintech could you clarify whether you just want to use fields from a managed package, or whether you're trying to inject fields at run time? – Ralph Callaway Feb 19 '13 at 15:47
@dublintech, did my answer help at all? – Ralph Callaway Mar 15 '13 at 20:05
up vote 1 down vote accepted

If the field is in a managed package you'll need it installed in the org your developing it. It'll validate the field exists at compile time just like you'd expect with unmanaged fields. Only difference is the managed package field will have a namespace. For example


If you're trying to build an email that has configurable fields you'll want to look at using field sets.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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