12
The page trigger OnQueryClosePage exposes a CloseAction parameter. This allows code to only process when the CloseAction = Action::OK.

The integration event OnQueryClosePageEvent does NOT expose the CloseAction so a codeunit subscribing to that event cannot tell if the page was being canceled or not. Obviously, most of the time you don't want any code to run if the page is being canceled.

The kludgy work around is to do a PageExtension for a given page and trap trigger OnQueryClosePage and then call an event subscriber codeunit procedure to set it up. It would then available to the codeunit when the OnQueryClosePage is subscribed.

A cleaner and simpler solution is to expose the CloseAction in the integration event OnQueryClosePageEvent. Then a subscriber codeunit could directly determine whether or not its code should run.
Category: Development
STATUS DETAILS
Needs Votes
Ideas Administrator

Thank you for this suggestion! Currently this is not on our roadmap. We are tracking this idea and if it gathers more votes and comments we will consider it in the future.

Best regards,
Business Central Team

Comments

G

The 'OnQueryClosePage' in 6057 - Contract Line Selection never resets the OkButton.. so when there's an error within the associated code - we end up in a loop - and are stuck.Have attempted to use a page extension that also has the 'OnQueryClosePage' event.. to attempt to force the update.. but trigger on the standard page is the event which is called first - so the extension event becomes redundant, as soon as the error occurs then we are consigned to a life of looping.I did think that maybe selecting an alternative line may help.. but all entries are already used, we are still stumped.The sooner that this can be implemented the better - unless you have a workaround for me.Thanks

Category: Development

G

Surely the event needs to expose everything it possibly can.. not to expose the Action is, frankly, ludicrous.It's not often that there's any requirement on closing the page, but when it is the action that has been selected has to be the primary parameter!!!We're now in May 2023 and this still hasn't been done... how simple is the fix???

Category: Development

G

Yes, we need Pass CloseAction as parameter in OnQueryClosePageEvent

Category: Development