0

I performed this test in my sandbox- There is an object called Object1. When you change a field on it, it triggers a workflow. Workflow sends out email alert. Email alert is using Visualforce Email templates that have merge fields upto several levels (all lookups)

{!relatedTo.Field1__r.Field2__r.Field3__r.Name}

Initially merge field was showing blank when the actual email went out.

I noticed that my user profile did not have FLS to Field2__c. When i provided read access to my profile for that field, merge field worked.

That begs a question - Don't workflows work in System mode where they should have access to all objects, all fields and all records?

Or is it becuase i edited the object1, which set off the workflow, it will work in my user context? If so, does time-based actions also fire under my user context?

2

Workflow Rules evaluate in System context. Field Updates also update in System context. Email Templates, however, honor the field security of the user, because otherwise users could render templates to see data they don't have access to. This is something you'll need to keep in mind when using email templates.

| improve this answer | |

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.