Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
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
Categories:
  • Verified answer
    YUN ZHU Profile Picture
    YUN ZHU 73,698 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,443 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 12,183 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 295 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans