Skip to main content

Notifications

Business Central forum
Answered

How to update the item ledger entries in the database ?

Posted on by 73
Hello,
 
Unfortunately our item ledger entries have been created with the wrong "Posting Date" and I would like to update them with the "SystemCreatedAt" Date. Is there a way to update the value stored in the database not simply for the reports?
 
Thanks in advance,
Ludovic
  • Verified answer
    YUN ZHU Profile Picture
    YUN ZHU 69,162 Super User 2024 Season 2 on at
    How to update the item ledger entries in the database ?
    This may cause data inconsistency if you modify it directly from the code.
    But technically, it is possible.
    As with the standard, you only need to add the Permisions property to the executed code.
     
    Hope this helps as well.
    Thanks.
    ZHU
  • Verified answer
    Jun Wang Profile Picture
    Jun Wang 7,045 Super User 2024 Season 2 on at
    How to update the item ledger entries in the database ?
    the proper way is create a credit memo to reverse it and then create a new one with correct posting date
     
    Jun Wang
  • LLEV Profile Picture
    LLEV 73 on at
    How to update the item ledger entries in the database ?
    Thanks you both for your prompt answer.
    GR: This is a great post and I'll definitely keep it in my marks, but in my case I was looking for a mass update solution like Gokulnath proposed even though I understand it is definitely not recommended.
  • gdrenteria Profile Picture
    gdrenteria 9,201 Most Valuable Professional on at
    How to update the item ledger entries in the database ?
    Hi
    In this case you need to reverse the operation, we are not only talking about the item ledger entry table.
    Please revise.
    BR
    GR
  • Suggested answer
    Tech_BC_Gokul Profile Picture
    Tech_BC_Gokul 267 on at
    How to update the item ledger entries in the database ?
    Hi, 

    If your are a developer, 

    Create a processOnly report 
    Select dataItem as Item Ledger Entry. 
     
     trigger OnAfterGetRecord()
     
    use this trigger write a code for updating the posting date as system created date 
    item ledger entry modify. 
    provide permission for item ledger entry in the Permission property. 
    but changing this will impact the difference between ledger and subledger. 

    Correct way to do this reversing and posting the document again. 

    Thanks 
    Gokulnath

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

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

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

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,445 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,334 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans