Wednesday, July 27, 2022

Disable The Annoying Dialog After Posting in Business Central

by Steve Endow

Why does this dialog appear by default after EVERY document posting in Business Central?

This is an annoying dialog

I was recently on a call with my colleague Tanya Henderson to review some accounts payable payment processes in Business Central.

After I posted a purchasing invoice, she told me to click No on this useless dialog, saying that she has to train all of her customers to click no, and she wished she could get rid of it.  

Can this dialog be turned off?  If not, can a PTE suppress it after posting?

Challenge accepted!

I don't know anything about that dialog or how it works, so I started my research by looking at the BC code to look for clues.

Since I always have a local copy of the BC Code History repository by Stefan Maron, I opened File Explorer and navigated to BaseApp -> Source -> Base Application and found the PurchaseInvoice.Page.al file.

Purchase Invoice Page Located

I opened that AL file in VS Code and searched for "the invoice is posted".  And there we see the message defined as a Label variable.

A Clue

I then searched for OpenPostedPurchaseInvQst.  What do we have here?

So it's optional?

That appears to be a procedure that looks like the dialog is optional.  "if InstructionMgt.ShowConfirm()" seems to imply it's checking something to see if it should display the confirmation dialog.

But what is InstructionMgt?  I don't know. Back to Stefan's BC Code History repo!

Getting warmer...

The InstructionMgt codeunit was more difficult to interpret--I didn't understand exactly what it was doing, or how it was doing it.  But as I scrolled through the Codeunit.al file, I noticed some clues.

UserPreference Record

I saw these procedures that referenced a UserPreference record.  That sounds promising.

But I am still pretty new to Business Central, so I didn't know what "User Preferences" are, or where they are.

I knew about the "My Settings" menu, so that's where I started to search.

Start with My Settings

Well, nothing obvious, but what is this "Notifications" option?  

Notifications?

Whoa.  That's quite a list.  But the names of the notifications look promising.

Lots Of Notifications

Let's try to search for "posting"...


Well, this one looks promising:  "Confirm after posting documents"

Let's see what happens when that Notification is UNchecked.

I then posted a new purchase invoice...and no more annoying "Do you want to open the posted invoice?" dialog!

Based on what I'm seeing in the Instruction Mgt codeunit, it looks like the "after posting" dialog is controlled exclusively by the "user preference" notification setting--meaning that it must be disabled for every user.

I haven't found any clues in the code to indicate that the dialog can be disabled by company--which would be nice.

I also didn't see anything to indicate that the dialog can be disabled for certain modules or document type.  So it appears that turning off this notification will disable the "after posting" dialog for ALL document types.

So you may need to ask users whether they ever want to view any posted documents after posting.

If you have any other info or tips related to this "after posting" dialog, or a way to manage these notifications for all users in a company, post a comment below!


Steve Endow is a Microsoft MVP in Los Angeles.  He works with Dynamics 365 Business Central and related technologies.

You can also find him on Twitter and YouTube, or through these links:  links.steveendow.com

No comments:

Post a Comment

All comments must be reviewed and approved before being published. Your comment will not appear immediately.

How many digits can a Business Central Amount field actually support?

 by Steve Endow (If anyone has a technical explanation for the discrepancy between the Docs and the BC behavior, let me know!) On Sunday nig...