If you're in an environment where you have multiple companies setup and each company uses the same items, you might be tempted to share the item table across all companies.
In versions prior to 5.0, you can get away with this since the Adjust Cost process are done using the Item Ledger and Item Application Entry table. When inventory is taken out, it'll use the proper average cost when the Adjust Cost process is ran.
However, in version 5.0, they introduced the Avg. Cost Adjmt. Entry Point table and the Cost is Adjust field on the item card. This means that if if you just share the tables and adjust cost is ran for Company A, it'll mark the Cost Is Adjusted to true. This means that the Adjust Cost process will never be ran for Company B. In addition, when transactions are posted for Company B, it'll look at the Avg. Cost Adjmt. Entry Point table and detect that the cost has not been adjusted and mark it for adjustment again.
The best solution to this problem is to suggest the users to update item information for both companies. However, if the business requirement is to share the Item table, it's recommended that you keep the tables separate. And write a batch process to update items at the end of day or if it needs to be real time, write code to something like:
ItemCompanyB.CHANGECOMPANY('Company B'); IF ItemCompanyB.GET("No.") THEN BEGIN CostPostedGL := ItemCompanyB."Cost is Posted to G/L"; CostAdj := ItemCompanyB."Cost is Adjusted"; UnitCost := ItemCompanyB."Unit Cost"; ItemCompanyB.TRANSFERFIELDS(Rec); ItemCompanyB."Cost is Posted to G/L" := CostPostedGL; ItemCompanyB."Cost is Adjusted" := CostAdj; ItemCompanyB."Unit Cost" := UnitCost; IF NOT ItemCompanyB.INSERT THEN ItemCompanyB.MODIFY; END;
You can probably write a better code, but you should be able to get the idea. This will also require that all the item master information be entered into one company.
FWIW, Avg. Cost Adjmt. Entry Point table has been around since at least 4.0 SP1
Gotcha, thanks for the update. Then this will apply to version 4.0 SP1 and forward.
We actually never share the Item table, to be honest .
When it is necessary to have the items in two are more companies, we set up some kind of synch process with the "integration framework" we created... .
Yeah, now it's not a good idea. But sharing table (in the short term) is a lot easier than developing an integration framework. :)
Actually sharing the item table (or any of the master tables) has never been a good idea in ANY version of Navision. You should always be synchronizing the items across companies.
I hope people reading this blog don't get the idea that this is possible in earlier versions.