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 62,742 Super User 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 5,231 Super User 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 4,075 Super User 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 247 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

Helpful resources

Quick Links

Community Spotlight of the Month

Kudos to Mohamed Amine Mahmoudi!

Blog subscriptions now enabled!

Follow your favorite blogs

TechTalk: How Dataverse and Microsoft Fabric powers ...

Explore the latest advancements in data export and integration within ...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 284,753 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,302 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,146

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans