Item tracking copy document

BeliasBelias Member Posts: 2,998
hi everyone, does someone have a clue on how the item tracking lines (that is, reservation entries) are populated when using the copy document feature (in cu 6620)?i can't find where nav sets the field values, especially "serial no." field.
Thanks in advance for your help, if i find something, i'll post it
-Mirko-
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog

Answers

  • ara3nara3n Member Posts: 9,256
    turn on codecoverage. (Tools->debugger->CodeCoverage)
    Click on Start.
    run copy document
    Stop CodeCoverage.
    click on code
    remove all filters
    Filter on *Serial No.*
    Find lines that have been executed.
    Put a break point
    run copy document again.
    look at callstack from where it is called.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • BeliasBelias Member Posts: 2,998
    i don't like code coverage a lot...i don't think it's 100% reliable...anyway, i just found the code snippet i need, here it is!:
    codeunit: Item tracking management
    functions:
    -CopyItemLedgEntryTrkgToSalesLn
    ...
        REPEAT
          LinkThisEntry := "Entry No." > 0;
          ReservEntry.INIT;
          ReservEntry."Item No." := "Item No.";
          ReservEntry."Location Code" := "Location Code";
          ReservEntry."Serial No." := "Serial No.";
          ReservEntry.VALIDATE("Serial No. Code","Serial No.");   //@MHC1.MM 06.07.10
          ReservEntry."Qty. per Unit of Measure" := "Qty. per Unit of Measure";
    
    -CopyItemLedgEntryTrkgToPurchLn
    ...
        REPEAT
          LinkThisEntry := "Entry No." > 0;
          ReservEntry.INIT;
          ReservEntry."Item No." := "Item No.";
          ReservEntry."Location Code" := "Location Code";
          ReservEntry."Serial No." := "Serial No.";
          ReservEntry.VALIDATE("Serial No. Code","Serial No.");  //@MHC1.MM 06.07.10
          ReservEntry."Qty. per Unit of Measure" := "Qty. per Unit of Measure";
    
    Thanks for the help!

    EDIT: why i don't think that codecov is 100% reliable? because if i filter for No. of hits, i receive unexpected results, such as skipped "if" lines... :-k
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • ara3nara3n Member Posts: 9,256
    don't filter on No of hits. Filter on *Serial No* and it will show you the code and then you can put a breakpoint in that section.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • BeliasBelias Member Posts: 2,998
    sorry, i've not explained myself completely.
    In this particular case, i would have probably spared some time by using the code coverage, you're right.
    i've already used the "searching method" you told a lot of times (i usually add '@' too :wink: ). The limit of this method, in my opinion is that for big procedures (like order posting for example) it's hard to find what is the instruction(s) you really need, because it has been probably used a lot of times, and some of them are not even touched by the procedure. To solve this issue i usually used no. of hits field for filter, too, but as i said, it's not 100% reliable in my opinion.

    With this topic, i was only asking if someone has already found the point for modification during some of their projects...
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
Sign In or Register to comment.