Skip to main content

Notifications

Announcements

No record found.

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 64,237 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,528 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 5,108 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 263 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

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,420 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,672 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans