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?


  • You could use a component driven by a controller to do the dynamic soql? 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? Feb 19 '13 at 15:47
  • @dublintech, did my answer help at all? Mar 15 '13 at 20:05

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.

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.