Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

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

"{!relatedTo.opportunity__r.CloseDate}"

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

"{!relatedTo.opportunity__r.CloseDate_blah_blah__c}"

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?

Thanks.

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 Feb 19 '13 at 15:47
    
@dublintech, did my answer help at all? –  Ralph Mar 15 '13 at 20:05
add comment

1 Answer 1

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

{!relatedTo.opportunity__r.namespace__managed_package_field__c}

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
add comment

Your Answer

 
discard

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.