Dear Dynamics Community,
I've been working with Dynamics for some time and not experienced this issue before, but it would be great if someone could just confirm (or deny) my assumptions. For this example I'm looking at a real-time workflow that is triggered by a field change.
My understanding of the Scope is this:
User - workflow will only run on the records owned by the owner of the workflow
Business Unit - workflow will only run for records owned by the owner of the workflow or other owners (users or teams) within the workflow owner's business unit
Parent: Child Business Units - workflow will only run for records owned by the owner of the workflow or other owners (users or teams) within the workflow owner's business unit or child business units
Organization: workflow will run on all records
I've tested all of this and it works. The challenge I have is when using Execute As; if I set Execute As to 'The user that made changes to the record', along with scope 'User' my assumption is that the workflow would run on any records that are owned by the person that triggered the workflow (in this case made a change to the trigger field on the specific entity/table the workflow was set up on) rather than just records owned by the owner of the workflow itself, but it doesn't - it still only works on records owned by the owner of the workflow.
My tests:
Workflow is real-time, has a Start After trigger for one field, Scope is 'User' and Execute As is 'The user that made changes to the record'
- Changing ownership of the workflow to the same user who triggers the workflow (field change) = workflow runs
- Changing the ownership of the workflow to a different user from the user who triggers the workflow (field change) = workflow does not run
- Setting the workflow to also run on-demand, with the owner of the workflow different to the triggering user of the workflow = workflow runs when on-demand is used (not when triggered)
I should say that this isn't a huge problem at the the moment because running the workflow with 'Organization' Scope will not cause any security issues, I just thought I knew this stuff and my (apparently tiny) brain is struggling to understand. If anyone can explain it simply, please do help!
My assumption from testing is this:
Scope indicates which set of records the workflow will run on and for automated (i.e. triggered) workflows this is defined by the owner of the workflow. For on-demand workflows the process will take the scope of the person that called the on-demand workflow, not the owner of the workflow.
Kindest regards,
Matt