Hi everyone,
i'm trying to solve an issue i'm experiencing on a couple of plugins in my client's environment, here's the scenario:
- User A creates a record "Interest"
- "Interest" creation triggers a plugin running on "SYSTEM (Disabled)" context. InitiatingUserId is User A in this case (everything's fine until now).
The plugin creates a record "Brand Data".
- "Brand Data" creation triggers another plugin, always in "SYSTEM (Disabled)" context. Depth is 2 and InitiatingUserId is SYSTEM in this case.
In point 3 i was expecting that the InitiatingUserId, which the documentation describes as the "user who started the pipeline", would be actually propagated to each plugins' chain level. Also observing plugin ParentContext the value isn't the expected one
- Actual plugin context: EntityName = "Brand Data", InitiatingUserId = "SYSTEM"
- Parent plugin context: EntityName = "Interest", InitiatingUserId = "SYSTEM" -> this is against point 2
I thought i understood how InitiatingUserId works, but it's clear i'm missing something.
Can please someone explain the current behaviour of this property and user impersonation in a plugin chain like this?
Thanks in advance,
DT
PS. The environment is a Dynamics 365 v9.1 online.