microsoft / ALAppExtensions

Repository for collaboration on Microsoft AL application add-on and localization extensions for Microsoft Dynamics 365 Business Central.
MIT License
749 stars 600 forks source link

[Bug]: The "IsHandled" Parameter in the "OnBeforeDeleteAssemblyDocument" Event of the "Assembly-Post" Codeunit Doesn't Allow Skipping the Execution of the DeleteAssemblyDocument Function #26746

Closed Khoubaib1 closed 2 weeks ago

Khoubaib1 commented 2 weeks ago

Describe the issue

The IsHandled parameter in the OnBeforeDeleteAssemblyDocument event of the "Assembly-Post" codeunit does not allow skipping the execution of the DeleteAssemblyDocument function. Consequently, even when the IsHandled is set to true by the event subscriber to prevent the deletion of the assembly order after posting, the deletion still occurs. The issue is reported in the last update of BC 24, and it caused by a change in the standard code, so now the IsHandled parameter affect only one line of code which is the reset filter.

Code Before BC Update 24: image

Code After BC Update 24: image

Expected behavior

1-Create an Assembly Order

2-Create a custom function to prevent Assembly Order deletion after posting image

3-Post Assembly Order =>Assembly Order should not be deleted

Steps to reproduce

1-Create an Assembly Order

2-Create a custom function to prevent Assembly Order deletion after posting image

3-Post Assembly Order =>Assembly Order is deleted

Additional context

No response

I will provide a fix for a bug

tomasevicst commented 2 weeks ago

Hi,

This is fixed, and old logic should be available from 24.2.