microsoft / AL

Home of the Dynamics 365 Business Central AL Language extension for Visual Studio Code. Used to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central.
MIT License
728 stars 241 forks source link

Currpage.close in fields OnValidate crash client after lookuppage selection #7615

Closed thellMa closed 8 months ago

thellMa commented 8 months ago

Please include the following with each issue:

1. Describe the bug After a User picks a row from an Lookup page the page breaks if it have an Currpage.Close() statement in its OnValidate Trigger. It works fine if only the dropdown list is used instead.

2. To Reproduce

Recording of issue. https://www.youtube.com/watch?v=ecBfPL6iJKQ

In short, when user is selecting a row on an Lookup list client crashes if an CurrPage.Close is executed afterwards in fields. OnValidate Trigger.

See attached source example. CurrpageCloseBreak.zip

3. Expected behavior Current Page closes. (This is behaviour is used to reload current page to change columns visibilities, works fine with DropDown selection.)

4. Actual behavior Web Client crashes.

5. Versions:

Final Checklist

Please remember to do the following:

thellMa commented 8 months ago

Here is the callstack from my docker container.

PS C:\Run> Get-EventLog -LogName Application -Newest 10 | Select-Object -ExpandProperty message
Category: Microsoft.Dynamics.Framework.UI.WebBase.ClientExceptionStateProcessingStrategy
EventId: 0
ConnectionId: 0HMVMEHD2BA46
RequestId: 0HMVMEHD2BA46:00000012
RequestPath: /BC/csh
TransportConnectionId: NQ-jQ5nfIQLSad0Jc9eUzw
MemberName: TryToSendToTelemetry
FilePath: s:\repo\src\Platform\Client\Web\Prod.Client.WebBase\Exception\ClientExceptionStateProcessingStrategy.cs
LineNumber: 88
ExceptionType: System.NullReferenceException

Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Dynamics.Framework.UI.LookupProvider.LogicalForm_FormClosed(Object sender, FormClosedEventArgs e) in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Communication\LookupProvider.cs:line 59
   at Microsoft.Dynamics.Framework.UI.LogicalFormCloseMainHandler.DoMarkClosed(FormClose formClose) in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Forms\LogicalFormCloseMainHandler.cs:line 90
   at Microsoft.Dynamics.Framework.UI.LogicalFormCloseController.MarkClosedFormsThisAndChildForms(FormClose formClose) in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Forms\LogicalFormCloseController.cs:line 148
   at Microsoft.Dynamics.Framework.UI.LogicalForm.PerformClose(FormClose formClose) in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Forms\LogicalFormClosePart.cs:line 112
   at Microsoft.Dynamics.Framework.UI.CloseAction.InvokeCore(LogicalControl logicalControl, Object state, UISession uiSession) in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Actions\FormAction.cs:line 196
   at Microsoft.Dynamics.Nav.Client.Actions.ExitActionBase.InvokeCore(LogicalControl logicalControl, Object state, UISession uiSession) in s:\repo\src\Platform\Client\Shared\Prod.Client.UI\Actions\FormActions\ExitActionBase.cs:line 46
   at Microsoft.Dynamics.Nav.Client.Actions.ExitAction.InvokeCore(LogicalControl logicalControl, Object state, UISession uiSession) in s:\repo\src\Platform\Client\Shared\Prod.Client.UI\Actions\FormActions\ExitAction.cs:line 219
   at Microsoft.Dynamics.Framework.UI.LogicalAction.InvokeCoreWithErrorHandling(LogicalControl logicalControl, Object state, UISession uiSession) in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Actions\LogicalAction.cs:line 585
   at Microsoft.Dynamics.Framework.UI.LogicalAction.DoInvoke(LogicalControl logicalControl, IDictionary state, UISession uiSession) in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Actions\LogicalAction.cs:line 497
   at Microsoft.Dynamics.Framework.UI.ActionControl.Invoke(IDictionary state) in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Forms\ActionControl.cs:line 435
   at Microsoft.Dynamics.Framework.UI.InvokeActionInteraction.InvokeCore(InvokeActionInteractionInput invokeActionInteractionInput) in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Interactions\LogicalInteractions\InvokeActionInteraction.cs:line 136
   at Microsoft.Dynamics.Framework.UI.InteractionInvoker.InvokeCore[T](String interactionName, Func`2 invokeMethod, T input) in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Interactions\InteractionInvoker.cs:line 59
   at Microsoft.Dynamics.Framework.UI.LogicalInteraction`1.Invoke(T logicalInteractionInput) in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Interactions\LogicalInteraction.cs:line 46
   at Microsoft.Dynamics.Framework.UI.InteractionManager.<>c__DisplayClass8_2.<InvokeInteractions>b__4() in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Interactions\InteractionManager.cs:line 157

Error accessing Website BC
Type: System.NullReferenceException
Message: Object reference not set to an instance of an object.
Source: Microsoft.Dynamics.Framework.UI
HResult: -2147467261
StackTrace:
     at Microsoft.Dynamics.Framework.UI.LookupProvider.LogicalForm_FormClosed(Object sender, FormClosedEventArgs e) in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Communication\LookupProvider.cs:line 59
     at Microsoft.Dynamics.Framework.UI.LogicalFormCloseMainHandler.DoMarkClosed(FormClose formClose) in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Forms\LogicalFormCloseMainHandler.cs:line 90
     at Microsoft.Dynamics.Framework.UI.LogicalFormCloseController.MarkClosedFormsThisAndChildForms(FormClose formClose) in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Forms\LogicalFormCloseController.cs:line 148
     at Microsoft.Dynamics.Framework.UI.LogicalForm.PerformClose(FormClose formClose) in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Forms\LogicalFormClosePart.cs:line 112
     at Microsoft.Dynamics.Framework.UI.CloseAction.InvokeCore(LogicalControl logicalControl, Object state, UISession uiSession) in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Actions\FormAction.cs:line 196
     at Microsoft.Dynamics.Nav.Client.Actions.ExitActionBase.InvokeCore(LogicalControl logicalControl, Object state, UISession uiSession) in s:\repo\src\Platform\Client\Shared\Prod.Client.UI\Actions\FormActions\ExitActionBase.cs:line 46
     at Microsoft.Dynamics.Nav.Client.Actions.ExitAction.InvokeCore(LogicalControl logicalControl, Object state, UISession uiSession) in s:\repo\src\Platform\Client\Shared\Prod.Client.UI\Actions\FormActions\ExitAction.cs:line 219     at Microsoft.Dynamics.Framework.UI.LogicalAction.InvokeCoreWithErrorHandling(LogicalControl logicalControl, Object state, UISession uiSession) in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Actions\LogicalAction.cs:line 585
     at Microsoft.Dynamics.Framework.UI.LogicalAction.DoInvoke(LogicalControl logicalControl, IDictionary state, UISession uiSession) in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Actions\LogicalAction.cs:line 497
     at Microsoft.Dynamics.Framework.UI.ActionControl.Invoke(IDictionary state) in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Forms\ActionControl.cs:line 435
     at Microsoft.Dynamics.Framework.UI.InvokeActionInteraction.InvokeCore(InvokeActionInteractionInput invokeActionInteractionInput) in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Interactions\LogicalInteractions\InvokeActionInteraction.cs:line 136
     at Microsoft.Dynamics.Framework.UI.InteractionInvoker.InvokeCore[T](String interactionName, Func`2 invokeMethod, T input) in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Interactions\InteractionInvoker.cs:line 59
     at Microsoft.Dynamics.Framework.UI.LogicalInteraction`1.Invoke(T logicalInteractionInput) in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Interactions\LogicalInteraction.cs:line 46
     at Microsoft.Dynamics.Framework.UI.InteractionManager.<>c__DisplayClass8_2.<InvokeInteractions>b__4() in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Interactions\InteractionManager.cs:line 157
StackTrace:
     at Microsoft.Dynamics.Framework.UI.LookupProvider.LogicalForm_FormClosed(Object sender, FormClosedEventArgs e) in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Communication\LookupProvider.cs:line 59
     at Microsoft.Dynamics.Framework.UI.LogicalFormCloseMainHandler.DoMarkClosed(FormClose formClose) in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Forms\LogicalFormCloseMainHandler.cs:line 90
     at Microsoft.Dynamics.Framework.UI.LogicalFormCloseController.MarkClosedFormsThisAndChildForms(FormClose formClose) in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Forms\LogicalFormCloseController.cs:line 148
     at Microsoft.Dynamics.Framework.UI.LogicalForm.PerformClose(FormClose formClose) in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Forms\LogicalFormClosePart.cs:line 112
     at Microsoft.Dynamics.Framework.UI.CloseAction.InvokeCore(LogicalControl logicalControl, Object state, UISession uiSession) in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Actions\FormAction.cs:line 196
     at Microsoft.Dynamics.Nav.Client.Actions.ExitActionBase.InvokeCore(LogicalControl logicalControl, Object state, UISession uiSession) in s:\repo\src\Platform\Client\Shared\Prod.Client.UI\Actions\FormActions\ExitActionBase.cs:line 46
     at Microsoft.Dynamics.Nav.Client.Actions.ExitAction.InvokeCore(LogicalControl logicalControl, Object state, UISession uiSession) in s:\repo\src\Platform\Client\Shared\Prod.Client.UI\Actions\FormActions\ExitAction.cs:line 219     at Microsoft.Dynamics.Framework.UI.LogicalAction.InvokeCoreWithErrorHandling(LogicalControl logicalControl, Object state, UISession uiSession) in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Actions\LogicalAction.cs:line 585
     at Microsoft.Dynamics.Framework.UI.LogicalAction.DoInvoke(LogicalControl logicalControl, IDictionary state, UISession uiSession) in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Actions\LogicalAction.cs:line 497
     at Microsoft.Dynamics.Framework.UI.ActionControl.Invoke(IDictionary state) in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Forms\ActionControl.cs:line 435
     at Microsoft.Dynamics.Framework.UI.InvokeActionInteraction.InvokeCore(InvokeActionInteractionInput invokeActionInteractionInput) in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Interactions\LogicalInteractions\InvokeActionInteraction.cs:line 136
     at Microsoft.Dynamics.Framework.UI.InteractionInvoker.InvokeCore[T](String interactionName, Func`2 invokeMethod, T input) in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Interactions\InteractionInvoker.cs:line 59
     at Microsoft.Dynamics.Framework.UI.LogicalInteraction`1.Invoke(T logicalInteractionInput) in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Interactions\LogicalInteraction.cs:line 46
     at Microsoft.Dynamics.Framework.UI.InteractionManager.<>c__DisplayClass8_2.<InvokeInteractions>b__4() in s:\repo\src\Platform\Client\Shared\Prod.ClientFwk\Interactions\InteractionManager.cs:line 157
SBalslev commented 8 months ago

Let's get the issue to a team who will fix and backport it, as this repository is only for issues related to the AL compiler in latest developer preview environment for Dynamics 365 Business Central. We suggest that you open a support case or file a bug in Collaborate, to ensure that all Business Central users benefit from your catch as soon as possible.

To open a support case, you can:

If you file the bug in Collaborate, remember to include steps to reproduce the issue, and the Business Central build number and country version you're using.