Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding/Removing PreImage on RegisterPluginStep<T> does not update plugin registration #44

Open
bo-stig-christensen opened this issue May 19, 2020 · 3 comments
Assignees
Labels

Comments

@bo-stig-christensen
Copy link
Member

Adding or removing a PreImage using RegisterPluginStep.AddImage(ImageType.PreImage) does not trigger an update of the plugin registration, which results in a NullReferenceException if using the PreImage entity.

Although not tested, the same is most likely the case for PostImage.

@TomMalow
Copy link
Member

TomMalow commented May 19, 2020

Seems similar to #19?

After Reading it again, it seems like a different issue.

@bo-stig-christensen
Copy link
Member Author

bo-stig-christensen commented May 19, 2020

I just did another test and there is only a bug if you do not specify attributes on the image.

Initial registration without image:

            RegisterPluginStep<T>(
                EventOperation.Update,
                ExecutionStage.PostOperation,
                Execute)
                .AddFilteredAttributes(x => x.dg_SomeField);

Updated registration that triggers bug:

            RegisterPluginStep<T>(
                EventOperation.Update,
                ExecutionStage.PostOperation,
                Execute)
                .AddFilteredAttributes(x => x.dg_SomeField)
                .AddImage(ImageType.PreImage);

Updated registration that triggers Daxif to update in D365:

            RegisterPluginStep<T>(
                EventOperation.Update,
                ExecutionStage.PostOperation,
                Execute)
                .AddFilteredAttributes(x => x.dg_SomeField)
                .AddImage(ImageType.PreImage, x => x.dg_SomeFieldOrSomeOtherField);

I ran into this at some point in the past, but it disappeared again, probably due to wondering about "why the null exception" and then changing filtering attributes... maybe ;-)

@mlRosenquist
Copy link

I can replicate the bug. The PreImage is indeed not available when following the described steps.

I've looked into daxif's behaviour and it creates and updates the sdkmessageprocessingstep and sdkmessageprocessingstepimage entities correctly in the scenario.

I crosschecked daxif's behaviour with the Plugin Registration tool in XrmToolBox for the scenario. It shows that doing the equivalent steps results in the same bug. It seems to be a platform error.

@mlRosenquist mlRosenquist self-assigned this Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants