sporadic activity in Change Log from same process

jversusjjversusj Member Posts: 489
hello,
I have already read a lot of threads about how the change log only tracks manual changes (out of the box), but I am seeing a puzzling situation.

From what i learned from the other threads, the following scenario should never record a change log entry, but it is recording the change for maybe 5% of sales orders. weird!

our users have to click a button to call the Order Release functionality. there is no way around this - no backdoor, no keyboad shortcut, etc. this button fires a codeunit that checks for mandatory fields and stops them from proceeding if they left any important fields blank. it also does A LOT of manipulations to the order and lines (a real ugly omnibus of code!). Anyhow, the release call will change the status from Open to Released and other code also sets a boolean field True on the sales header. this boolean field is used for downstream effects.

in any case, all this is being set be C/AL code - yet for a seemingly random set of headers the change log is recording the change to status field (old value Open, New value Released) and the change to the boolean field (No --> Yes). any ideas off the top of your heads how it could work in some cases but not others (in light of the fact that it probably should not work at all)?
kind of fell into this...

Comments

  • matttraxmatttrax Member Posts: 2,309
    Run code coverage while you do this. The Change Log may not get hit, but you'll at least see all the objects (hopefully) that come into play. You can filter on '@*change*' or something and likely find all the changelog variables. Not the best way probably, but it might give you a start.
  • jversusjjversusj Member Posts: 489
    i already ran this for a series of test orders and could not get any of them to pass through the ChangeLog, yet if i look in the change log entry table, i can see evidence of other orders where it worked.

    for those where it did not work, i did confirm that CU1 is never calling the OnGlobalModify trigger, which launches the ChangLogMgt.LogModification function.

    like i said, it is only working for a small % of orders - today we've released hundreds of orders, for example, but only 13 show the change in the log entry. we so far have not seen any pattern (yet) with the orders that do get processed.
    kind of fell into this...
  • kinekine Member Posts: 12,562
    1) Is there another field modified in same time on the same record when this change is registered?
    2) If yes, the change of the status is registered, because it is "side effect" of change of another field in the table. Changelog catch the change made by the user on the header, and because this change lead to change of status, the change of status is registered too, because change log compare xRec with Rec and register all changed fields which are set to be tracked...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.