How to automatically update average cost

A new client was hit by ransomware about a month ago, and their IT director had left shortly before that. The NAV environment was then reconstructed. The client had called me in for a SQL DBA type role, not as a NAV specialist. But now I am being asked to solve NAV specific problems and I am trying to get up to speed as quickly as possible.

I have been told that there was a sql script that ran automatically to update average cost, on a regular basis, but it was lost after the ransomware hit, and only the IT director knew the details about it. Is there a way to do this inside NAV, or would it be straightforward to write a sql script to do it?

I have been told also that average cost doesn’t update automatically in NAV, which is surprising to me because in other ERP systems I have worked with it is updated in real time.

Thanks

Well, to answer your question, it would be good to know the NAV version you are running. But no matter the version, SQL script is not something you should be looking for.

If the version is not really old, job queues should be available:

https://docs.microsoft.com/en-us/dynamics-nav-app/admin-job-queues-schedule-tasks

What you need is to schedule report 795 “Adjust Cost - Item Entries” in the job queue.

It is also possoble to run cost adjustment automatically when any cost-related document is posted, but this can have negative impact on system performance. This is well described, for example, in this post:

https://www.archerpoint.com/blog/Posts/effects-inventory-setup-microsoft-dynamics-nav

Thanks! Sorry I forgot to put the version, I put it in the tags, but forgot to put in the subject. It is NAV 5. Are there job queues in NAV 5?

I am not sure whether this was actually done by script before - there is a lot of information about the environment that is now unknown since the IT Director left

I looked and there is a job queue but it is a “codeunit” not a report and it is labeled 50001 Auto Run Adjust Ccst ILE. And the last run date was 3/8/2019 before the ransomware - looks like it normally has been running in the first week of the month. So does this sound like the right job to run?

I never really tried to run job queues in Navision 5, but Microsoft blog tells us that these are available since version 4:

https://blogs.msdn.microsoft.com/microsoft_dynamics_nav_sustained_engineering/2007/12/19/how-to-set-up-job-queue-in-microsoft-dynamics-nav-5-0/

This sounds like some custom object that was, probably, created by a previous NAV developer. Object ID range 50000…59999 is for custom development. Codeunuit name looks like it has something to do with cost adjustment, but who knows what’s inside it.

OK. Thanks. I will discuss with the ERP Manager.