Triggering Change Log

myanilkumarmyanilkumar Member Posts: 108
Hi All,

I am trying to insert or modify records by some process functions. I need to trigger change log during insertion or modification happen.

But change log will trigger only we manually changing the records. I need to update change log when a insertion or modification happens through my process routine. Please let me know how to handle this.

Cheers,
Anil Kumar Kurra

Comments

  • bbrownbbrown Member Posts: 3,268
    You just need to call the LogModification function in "Change Log Management" and pass the original and new records. I recently did this to track users reopening/releasing sales orders.
    There are no bugs - only undocumented features.
  • myanilkumarmyanilkumar Member Posts: 108
    Hi brown,

    Thanks for the reply. If you any sample code how you are calling?

    Please share with me.

    Thanks,
    Anil
  • bbrownbbrown Member Posts: 3,268
    I add this function to the table I want to track. Then I call the function from the OnValidate trigger of the field. There may be a few other details depending on exactly what and where you are tracking. But I need to leave you something to do. :)

    Change = "Change Log Management" codeunit.
    CallChangeLog()
    Change.LogModification(CurRecord, OldRecord);
    
    There are no bugs - only undocumented features.
  • myanilkumarmyanilkumar Member Posts: 108
    Thanks a lot brown for your help.
Sign In or Register to comment.