We have one of our plugins on Create of Account.
During Manual account creation the plugin is triggering and throwing exception as expected.
During data import plugin is not triggering
Like Bipin Kumar said, you can remove the Depth validation.
Reason is, Depth can help to prevent loops in recursive calls but it is not only used for that, it lets you know where you are in the execution path.
It works when you manually trigger it because you (the user) triggers the "create" request so, the execution path of this action that was manually/directly created is Depth = 1.
In your scenario, you (the user) starts an import job (Depth = 1), and then that process (import job) is sending the "create" request (Depth = 2).
In a hypothetical scenario where you trigger a Workflow or Plug-in (Depth = 1), then that process starts an import Job (Depth = 2), then you will have a "create" message with Depth = 3.
Hope this makes sense.
Hi,
If your plugin is only registered on create message then you don't need to check for depth property.
Depth is used For update plugin
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156