web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

BypassCustomPluginExecution question

(0) ShareShare
ReportReport
Posted on by 10

Hi,

I have a question regarding the use of the BypassCustomPluginExecution option.

The scenario is the following:

- I have a custom entity called nc_test. This entity has one custom field nc_enddate.

- I have created a post-operation plugin for this entity that does something (for this case it's not relevant what it does, only that it exists)

- The created plugin triggers on all attributes (no filtering attributes)

- Dynamics 365 On-Premise V9.1.7.5

Test 1 (works as expected)

Now when I perform the following code to update a record of the specified entity, I have verified that the plugin is indeed being bypassed.

var existingRecord = new Entity("nc_test", new Guid("E101261B-623C-E911-8FDF-1860247C2220"));
existingRecord["nc_enddate"] = new DateTime(2022, 8, 4);

var updateReq = new Microsoft.Xrm.Sdk.Messages.UpdateRequest();
updateReq.Target = existingRecord;
updateReq.Parameters["BypassCustomPluginExecution"] = true;
crmContext.Execute(updateReq); //crmContext is an IOrganizationService object

Test 2 (plugin is not bypassed)

- I change the plugin to set the filtering attributes to nc_enddate, so it will only trigger when that field has changed.

- Then perform the exact same code as above:

var existingRecord = new Entity("nc_test", new Guid("E101261B-623C-E911-8FDF-1860247C2220"));
existingRecord["nc_enddate"] = new DateTime(2022, 8, 4);

var updateReq = new Microsoft.Xrm.Sdk.Messages.UpdateRequest();
updateReq.Target = existingRecord;
updateReq.Parameters["BypassCustomPluginExecution"] = true;
crmContext.Execute(updateReq); //crmContext is an IOrganizationService object

This time however the BypassCustomPluginExecution option does not seem to work.

Does anyone know why this option only seems to work for plugins that have no filtering attributes?

And what would you recommend as a solution for this?

Thanks in advance.

Best regards,

Chris

I have the same question (0)
  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at
    RE: BypassCustomPluginExecution question

    Hi,

    You should lodge Microsoft support ticket to get answer from Product Engineers

  • cf-nnek Profile Picture
    10 on at
    RE: BypassCustomPluginExecution question

    My plugin is synchronous. I do see the bypass working, just not when there is a FilteringAttribute set on the plugin.

    There is only 1 plugin set to trigger on nc_enddate.

    Duplicate triggers are not the issue here. In this case, the desired effect is that it is not triggered at all when setting BypassPluginExecution

  • Ray Profile Picture
    1,537 on at
    RE: BypassCustomPluginExecution question

    Does your plugin step on async mode? - Bypass only take effect on sync mode.

    Is there any other plugin/workflow trigger on "nc_enddate"? - Bypass only take effect on the first trigger plugin/workflow.

    If you want to avoid duplicate trigger of plugin, you may use depth to avoid it.

  • cf-nnek Profile Picture
    10 on at
    RE: BypassCustomPluginExecution question

    Hi,

    Thank you for your suggestion. Unfortunately this doesn't seem to change the outcome.

    I've played around with package versions, but even when using the newest packages, this still occurs.

    Plugin

    using package "Microsoft.CrmSdk.CoreAssemblies" v 9.0.2.45

    Console app (updating the record while setting BypassPluginExecution param)

    using package "Microsoft.CrmSdk.XrmTooling.CoreAssembly" v9.1.1.1

    As soon as I set a FilteringAttribute to my plugin, BypassPluginExecution seems to be completely ignored.

  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at
    RE: BypassCustomPluginExecution question

    Hi,

    There was a bug with this in previous versions of the Microsoft.CrmSdk.XrmTooling.CoreAssembly package – make sure you’re using at least version 9.1.0.68 or you’ll still find your plugins are executed even when BypassPluginExecution is true.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 258

#2
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 182

#3
Tom_Gioielli Profile Picture

Tom_Gioielli 125 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans