Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

How to catch event of add or update of 'Item Ledger Entry ' table ?

(0) ShareShare
ReportReport
Posted on by 977

Hi expert ,

    I  have added one column (UpdateFlag)  in table Item . Now i want to update this column by 'U' when insert or update of quantity in ledger entry table . Please any one tell me how can i catch this event and write code for update column ?

Thanks

Surajit

*This post is locked for comments

  • Verified answer
    surajitkundu Profile Picture
    surajitkundu 977 on at
    RE: How to catch event of add or update of 'Item Ledger Entry ' table ?

    Hi Jens,

     Thanks a lot .I have added my code in CU(22)   InsertItemLedgEntry(). Its working fine.

    Thanks

    Surajit

  • Suggested answer
    Jens Glathe Profile Picture
    Jens Glathe 6,092 on at
    RE: How to catch event of add or update of 'Item Ledger Entry ' table ?

    Hi Surajit,

    I'm afraid it's a little more complicated than this. As Erik Ernst points out here, it is important to know the business logic behind the tables. This defines where your addition to the business logic has to be fitted.

    You want to get a notifier when the item shifts or (possibly) changes its value.

    The inventory of an item lives in the Item Ledger Entries table. Ledger entries are never inserted/modified/deleted directly in a form or page. So, putting code on the quantity field of the entry wouldn't have the desired effect. They will be created by a posting process, always utilizing T83 (Item Journal Line) and CU 22 (Item Jnl. - Post Line). So you could add your code in there, preferably in InsertItemLedgEntry(). When you also need a notification when the value changes (or something happens that needs a re-calculation of the value), then you also need to consider the Value Entries (T5802) and Item Application Entries (T339). Looking at this, you'll notice it's quite a lot of complicated code. For the Adjust Cost Item Entries batch job, NAV also needs a handle to know which items need to be adjusted. As I wrote in my previous post, this flag has at least a similar property like what you require. A quick search with Stati-Cal Prism shows the occurrences of this flag in NAV. So, that's where you need to put your code in.

    with best regards

    Jens

  • surajitkundu Profile Picture
    surajitkundu 977 on at
    RE: How to catch event of add or update of 'Item Ledger Entry ' table ?

    Hi Jens ,

      I have little bit confusion that how to update my flag

             if i write below code  On 'Item Ledger Entry' quantity   insert / Modify .is it wright code ? yes then how to get ItemNo value

                Item.SetCurrentkey("Item No.",ItemNo);

                Item.SETRANGE("UpdateFlag",TRUE);

    Thanks

    Surajit

  • surajitkundu Profile Picture
    surajitkundu 977 on at
    RE: How to catch event of add or update of 'Item Ledger Entry ' table ?

    Hi Jens,

      Thanks for the reply . I can do it on Quantity insert or modify .

    Thanks

    Surajit

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to catch event of add or update of 'Item Ledger Entry ' table ?

    How do you clear the "u" once you're done looking at the update flag?

    Do you have a function of processing report to reset them?

    else eventually they will all get filled up.

    I would have focused on "Last Date Modified" or a similar field.

    With a field like this it doesn't require clearing and you can run reports and/or filter a range of dates if you wanted.

  • Suggested answer
    Jens Glathe Profile Picture
    Jens Glathe 6,092 on at
    RE: How to catch event of add or update of 'Item Ledger Entry ' table ?

    Hi Surajit,

    there is something similar already. The Item table has the field "Cost is adjusted" which is always reset when new item ledger entries or value entries or item applications are posted, and set when the adjustment batch has run successfully.

    So, if you want your own field, these are the places to insert your code.

    with best regards

    Jens

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,489 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans