App/Extension to track ‘Adjust Cost — Item Entries’ batch job (Elapsed Time, used filters)

In this blog post I am showing a small extension for Dynamics 365 Business Central.
App/Extension add possibility to track 'Adjust Cost - Item Entries' batch job (Elapsed Time, used filters).
+ the feature that add some sales orders/purchase orders (work for sandbox only, for test purpose).

As first step I need to create Dynamics 365 Business Central Development Sandbox Environment.
More about Sandbox Environment
I decide to use Azure VM (Container Sandbox).

Use specific template for create Azure VM (need to have Azure subscription). Template link:

As result you should see on your Azure portal some VM:

After running VM wait 30-40 mins… scripts are creating all necessary installs/tools, as result desktop should be like this:

Well, now stop a bit and try to dream about what our application should do.
App should save Start Time before run code in 'Adjust Cost - Item Entries' batch job and save End Time after run code in 'Adjust Cost - Item Entries' batch job.
+ would be great to save which the Item filters has been set for this batch job.
And, of course we need to have some feature to build a bunch of documents (for sandbox only). This is allowing to us do some tests not for a few documents only.

AL App/Extension based on events. We need to have some events in object Report 795 (Adjust Cost - Item Entries).
More about events
Microsoft has done (and it is doing continuously) work on adding events to the standard code base.
If you see that standard code do not have necessary events just create new request (create new issue) via (need to have GitHub account)
Something like this:

You could see 2 fresh requests for Report 795 events:

In case if fresh event requests not yet include in Azure VM Sandbox Environment, you could just add events (use DEV license and Object Designer).
All real SaaS tenants updates time-to-time and after some time period (~ a month or more) after GitHub request – real tenants should have your events and you could try to install your app on production.

In my case I add fresh events via Object Designer:

Well, Microsoft Dynamics 365 Business Central is not yet exposing all the controls that you’re used to have from Microsoft Dynamics NAV pages.
In D365BC, many controls on pages are tagged with the #Advanced application area, that not active / not assigned today (September 2018).
Most of the #Advanced controls will be exposed in a coming update, October 2018.
Some links about it:

I need to use some hidden fields (“Automatic Cost Posting”, “Automatic Cost Adjustment”) from ‘Inventory Setup’ during my App test.
Okay, just activate Advanced via Object Designer:


Now, some key pictures from Visual Code:
The good book for answer your questions:

And… App pictures:

// ~ 15 minutes for 1000 documents, not so bad (I create documents one by one, save header and lines (10 lines per document) in different commits… use random)


Comments (1)

Skip to main content