Partager via


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).
GitHub: https://github.com/finn777/ALF_Tracker_for_Adjust_Cost_Item_Entries

===
Update 28-Nov-2018
Today I’ve received message that my test SaaS tenant already updated to fresh [Update 20 (CU1)] build.
// about setup e-mail for notification and etc.. read Business Central Admin Center: /en-us/dynamics365/business-central/dev-itpro/administration/tenant-admin-center
Well, my additional event ([Event Request] Report 795 Adjust Cost - Item Entries, OnAfterPreReport) now in real SaaS tenant.
I’ve updated GitHub project.
.app file (Alexey Finogenov_ALF_Tracker_for_Adjust Cost - Item Entries_1.1.26046.0.app): https://github.com/finn777/ALF_Tracker_for_Adjust_Cost_Item_Entries/blob/master/AL/ALF_Tracker_for_Adjust%20Cost%20-%20Item%20Entries/Alexey%20Finogenov_ALF_Tracker_for_Adjust%20Cost%20-%20Item%20Entries_1.1.26046.0.app
As result the extension:

+
Some key pictures from Visual Code:

P.S.
Use for version 13.1 or higher:

===

 

As first step I need to create Dynamics 365 Business Central Development Sandbox Environment.
More about Sandbox Environment /en-us/dynamics365/business-central/dev-itpro/developer/devenv-sandbox-overview
I decide to use Azure VM (Container Sandbox).

Use specific template for create Azure VM (need to have Azure subscription). Template link: https://aka.ms/BCSandboxAzure

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 /en-us/dynamics365/business-central/dev-itpro/developer/devenv-events-in-al
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 https://github.com/Microsoft/AL/issues (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:
---
/en-us/dynamics365/business-central/across-faq#why-are-some-ui-elements-that-i-used-in-dynamics-nav-not-visible-in- https://demiliani.com/2018/06/11/microsoft-dynamics-365-business-central-and-advanced-applicationarea/ https://demiliani.com/2018/05/01/microsoft-dynamics-365-business-central-and-the-problems-with-the-applicationarea-tag/ https://blogs.technet.microsoft.com/alexef/2018/05/22/how-to-add-a-field-to-item-card-in-business-central/
---

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: https://www.packtpub.com/business/dynamics-365-business-central-development-quick-start-guide

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