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
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:
Code After BC Update 24:
Expected behavior
1-Create an Assembly Order
2-Create a custom function to prevent Assembly Order deletion after posting
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
3-Post Assembly Order
=>Assembly Order is deleted
Additional context
No response
I will provide a fix for a bug
[X] I will provide a fix for a bug
Internal work item: AB#539664
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](https://github.com/microsoft/ALAppExtensions/assets/16858172/21343b6c-b307-4e87-8e8d-a3e5b3ae2994)
Code After BC Update 24:![image](https://github.com/microsoft/ALAppExtensions/assets/16858172/eec11861-1cdb-4d98-a913-6940db2a4bac)
Expected behavior
1-Create an Assembly Order
2-Create a custom function to prevent Assembly Order deletion after posting![image](https://github.com/microsoft/ALAppExtensions/assets/16858172/bb6b78b9-47e6-4c63-9243-b1b6564ac79c)
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](https://github.com/microsoft/ALAppExtensions/assets/16858172/c45209b0-83d2-4b41-b701-8e4bb46351f8)
3-Post Assembly Order =>Assembly Order is deleted
Additional context
No response
I will provide a fix for a bug