web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Adjust inventory to 0

(0) ShareShare
ReportReport
Posted on by

Hi all

I am trying to adjust all items to 0 via the revaluation journal, but it does not seem to work proberly. I end up with several item ledger entries with actual cost <> 0. If I run the code again afterwards new revaluation lines are created. Also I would like to know if there is another way to do this or if I am doing it the right way.

My code looks like this. 

OnRun()
ItemJournalLine2.SETRANGE("Journal Template Name",'VÆRDIJUST');
ItemJournalLine2.SETRANGE("Journal Batch Name",'STANDARD');
ItemJournalLine2.DELETEALL;
Item.FIND('-');
REPEAT
ItemLedgerEntry.SETRANGE("Item No.",Item."No.");
ItemLedgerEntry.SETRANGE(Positive,TRUE);
ItemLedgerEntry.SETRANGE("Completely Invoiced",TRUE);
IF(ItemLedgerEntry.FIND('-')) THEN BEGIN
REPEAT
ItemLedgerEntry.CALCFIELDS("Cost Amount (Actual)");
IF(ItemLedgerEntry."Cost Amount (Actual)" <> 0) THEN
InsertRevaluationLine(ItemLedgerEntry);
UNTIL ItemLedgerEntry.NEXT = 0;
END;
UNTIL Item.NEXT = 0;

LOCAL InsertRevaluationLine(ItemLedgerEntryRec : Record "Item Ledger Entry")
LineNo += 10000;
CurrentJnlBatchName := 'STANDARD';

ItemJournalLine.INIT;
ItemJournalLine.VALIDATE("Value Entry Type",ItemJournalLine."Value Entry Type"::Revaluation);
ItemJournalLine.VALIDATE("Source Code",'VÆRDIRGKLD');
ItemJournalLine."Journal Template Name" := 'VÆRDIJUST';
ItemJournalLine."Journal Batch Name" := 'STANDARD';
ItemJournalLine."Line No." := LineNo;
ItemJournalLine.VALIDATE("Document No.",'T04001');
ItemJournalLine.VALIDATE("Item No.",ItemLedgerEntryRec."Item No.");
ItemJournalLine.VALIDATE("Applies-to Entry",ItemLedgerEntryRec."Entry No.");
ItemJournalLine.VALIDATE("Unit Cost (Revalued)",0);
ItemJournalLine.INSERT(TRUE);

Thanks in advance!

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    You should do like this.

    Follow these steps.

    1) complete all the pending transactions like purchase order received not invoiced, sales order shipped not invoiced, transfer order shipped not invoiced etc.

    2) run adjust cost item entries batch job.

    3) Go to revaluation journal. run the suggest item lines at Revaluation Journal and post the revaluation journal

    4) run adjust cost item entries batch job again.

  • Suggested answer
    Alexander Ermakov Profile Picture
    28,096 on at

    Do you want to keep the quantity in stock, but just make it of zero value, or do you want to get rid of the items completely?

  • Community Member Profile Picture
    on at

    I want to keep the quantity in stock and revaluate them to 0. Thereafter I am going to revaluate them to standard cost price. I am testing and just want to set the inventory to zero value first

  • Suggested answer
    Community Member Profile Picture
    on at

    Revaluation Journal would not change your quantity. It would only change the value.

    Follow these steps.

    1) complete all the pending transactions like purchase order received not invoiced, sales order shipped not invoiced, transfer order shipped not invoiced etc.

    2) run adjust cost item entries batch job.

    3) Go to revaluation journal. run the "Calculate Inventory Value" at Revaluation Journal and post the revaluation journal. You can enter the value as Zero in Inventory Value (Revalued) field.

    4) run adjust cost item entries batch job again.

  • Community Member Profile Picture
    on at

    @Vishal

    thanks for the help

    I have followed your steps and ran the inventory valuation report afterwards. I now have an inventory value of 400k compared to 8mill before.

    When I look at the item ledger entries there are still a lot of entries with cost amoun actual <> 0. That should not be the case right?

  • Suggested answer
    Community Member Profile Picture
    on at

    Run again Revaluation Journal for specific Item (having Cost) and see if it reduce the cost to zero.

    Do you have any open transactions?

    What is your Item Costing Method?

  • Anita Spirax Profile Picture
    351 on at

    I too am trying to do this in my system. Want to change value in inventory Unit cost to zero. Our costing method is average. When I try and run the Revaluation Journal  on the 'calc inventory value - test' I keep getting error text "you must fill in a location filter and variant filter or select the By location field and the By Variant field, if you revalue items with Costing Method Average, and if Average cost Calc. type is item & location & variant in inventory setup." We do have our inventory setup this way but don't use variants. in answer to the queries I am putting calculate per "item", by location, show results with my item number and limit totals to my location.  Any suggestion as to what I am doing wrong.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans