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)

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

(0) ShareShare
ReportReport
Posted on by 989

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

I have the same question (0)
  • Suggested answer
    Jens Glathe Profile Picture
    6,092 on at

    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

  • Community Member Profile Picture
    on at

    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.

  • surajitkundu Profile Picture
    989 on at

    Hi Jens,

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

    Thanks

    Surajit

  • surajitkundu Profile Picture
    989 on at

    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

  • Suggested answer
    Jens Glathe Profile Picture
    6,092 on at

    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

  • Verified answer
    surajitkundu Profile Picture
    989 on at

    Hi Jens,

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

    Thanks

    Surajit

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)

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans