Automatic Item Tracking

chadharajanchadharajan Member Posts: 9


Hi,

How can we do automatic item tracking innavision. i,e.

in item journal i will enter the Serial No and quantity and on pressing of a button system should automatically create reservation enteries.

thanks,
_________________
Rajan Chadha

Comments

  • Revolution1210Revolution1210 Member Posts: 161
    Hi,

    You need to develop a piece of code which will populate the Reservation Enty table.

    The best way to get a handle on the fields you need to populate is to manually track a journal line, look at the records generated in the Reservation Entry table, then replicate this in your code.

    Your code would maybe look something like this:
    IF ReservationEntry.FINDLAST THEN
      EntryNo := ReservationEntry."Entry No." + 1
    ELSE
      EntryNo := 1;
    
    ReservationEntry.INIT;
    ReservationEntry."Entry No." := EntryNo;
    ReservationEntry."Source Type" := DATABASE::"Item Journal Line";
    ReservationEntry."Source Subtype" := 0;
    ReservationEntry."Source ID" := "Journal Template Name";
    ReservationEntry."Source Batch Name" := "Journal Batch Name";
    ReservationEntry."Source Ref. No." := "Line No.";
    ..
    ..
    ..
    ..
    ..
    ..
    ReservationEntry.INSERT;
    
    Ian

    www.NextEqualZero.com
    A technical eye on Dynamics NAV
  • chadharajanchadharajan Member Posts: 9
    Actually i was looking for some kind of pre-defined functions.. which can be called from the form and they in turn populate the reservation entry.
    Rajan Chadha
  • Revolution1210Revolution1210 Member Posts: 161
    There are none. Standard tracking functionlaity is built around the Item Tracking Lines form. What you want to do is subvert this process and create the tracking on the fly without opening the Item Tracking lines form.

    The best approach would be to create your own function(s) to handle your requirements.
    Ian

    www.NextEqualZero.com
    A technical eye on Dynamics NAV
  • ayhan06ayhan06 Member Posts: 210
    There are none. Standard tracking functionlaity is built around the Item Tracking Lines form. What you want to do is subvert this process and create the tracking on the fly without opening the Item Tracking lines form.

    The best approach would be to create your own function(s) to handle your requirements.


    1. in item tracking window, the lot no.s and the quantities are stored in a temporary table.. find out that how this temporary record are filled as the user enters lot and quantity information..
    2. in item tracking form, look into onquerycloseform trigger (or in oclosefrom trigger, i dont remember which one is correct). in it, the system calls a function (its name must be "WriteToDatabase or something like that") and that function writes the well-formatted values to the reservation entry table by using the values in the temporary table..copy this function to your own codeunit.


    so, you need to fill in a temporary t336 with your values and call standart "WriteToDatabase" function in your codeunit. i DO recommend to use standart functions to fill in revervation entry table.. NEVER fill in that table by your own code..

    hope this helps.
  • Revolution1210Revolution1210 Member Posts: 161
    ayhan06 wrote:
    NEVER fill in that table by your own code..

    Not really a big issue, as long is you do it correctly.
    Ian

    www.NextEqualZero.com
    A technical eye on Dynamics NAV
Sign In or Register to comment.