Struggling to Bulk Upload “Item Revaluation Entries”? Here’s What Could Be Going Wrong - CloudFronts

Struggling to Bulk Upload “Item Revaluation Entries”? Here’s What Could Be Going Wrong

In this blog, one of our clients had made some small mistakes while providing the data for their opening balances, which caused the item costs to be wrong. After a lot of back-and-forth, we finally got a list of 100+ items with the correct costs.


We thought it would be easy to fix using Edit in Excel but then we ran into an error:
“Quantity must have a value in Item Journal Line.”

But this is odd as when we are creating the entries manually, we don’t need to set the Quantity from anywhere.

In fact, the Quantity field isn’t even editable, it is populated when the “Applies-to Entry” field is updated.

We tried using Configuration Package.. same thing!

We tried to create an excel import, that uploads data in the journal.. same thing!

So what’s going on?

Details

After a bit of debugging we found this piece of code to be the problem – 

And this ->

When you update the “Unit Cost (Revalued)” field in Business Central, it also updates the “Inventory Value (Revalued)” field automatically. This part is simple. But the system also tries to update “Unit Cost (Revalued)” again based on the value you just changed—almost like it’s going in circles.

To avoid this, the system checks which field is currently being updated. If it’s not “Unit Cost (Revalued)”, the update is allowed.

When you make changes from the Business Central screen, the system knows which field you’re changing, thanks to something called CurrFieldNo. But when you use Edit in Excel, Config Packages, or AL code, this info is missing. That confuses the system and can cause it to divide by zero, which leads to an error.

Also, there’s a rule that checks quantity in the “Applies-to Entry” field. This check only happens if the “Value Entry Type” is not set to “Revaluation”.

This was raised back in 2018 on Github as a bug but it was closed as intended system design.

At the end, we had to bypass the validation and assign the values directly to the fields.

To conclude, what seemed like a simple task updating revalued costs turned into a deep dive into Business Central’s internal logic. 

The issue stemmed from how the system handles field updates differently depending on the entry method. 

While the manual interface sets background values like CurrFieldNo to help Business Central track changes properly, external methods like Edit in Excel or Config Packages don’t provide that context.

If you need further assistance or have specific questions about your ERP setup, feel free to reach out for personalized guidance.

We hope you found this blog useful, and if you would like to discuss anything, you can reach out to us at transform@cloudfronts.com.


Share Story :

SEARCH BLOGS :

FOLLOW CLOUDFRONTS BLOG :


Secured By miniOrange