Automatic Assign Item Tracking on Production Order Line

andy76andy76 Member Posts: 616
Good morning,


I have to develop a report that scrolls all production order lines having an item with item tracking code (and a flag that I already manage) to assign automatically to them lot no or serial no. in
table reservation entry 337 with a method similar to form 6510 - menu Item ID 51 Assign &Serial No. and menu Item ID 52 Assign &Lot No.

NAV 5.0

I want to know wich is the better way as I cannot call the trigger/function of the form and manage the tmp table Tracking Specification.
I only would like to call functions to populate correctly the table 337 Reservation Entry. Is there something or do I need to develop all?

Thank you

Andy

Comments

  • kinekine Member Posts: 12,562
    Of course there are some functions you can use... something like:

    CreateReservEntry.SetNewSerialLotNo(...);
    CreateReservEntry.SetDates(...);
    CreateReservEntry.CreateReservEntryFor(...);
    CreateReservEntry.CreateEntry(...);
    CreateReservEntry.GetLastEntry(...);

    If you fill the parameters correctly, it will do the job for you...

    Or you can look into codeunit 99000837 Prod. Order Line-Reserve...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • andy76andy76 Member Posts: 616
    The variable CreateReservEntry of what type is it?

    Thank you very much
  • andy76andy76 Member Posts: 616
    I found it :
    CreateReservEntry Codeunit Create Reserv. Entry
  • kinekine Member Posts: 12,562
    Yes... ;-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • andy76andy76 Member Posts: 616
    I have a lot of difficult about these objects.

    I don't understand if:
    -99000837 Prod. Order Line-Reserve.CreateReservation can be used by my report and when it is called in standard NAV code, for which aim
    - what is the aim/difference of function :

    CreateReservEntryFor(ForType : Option;ForSubtype : Integer;ForID : Code[20];ForBatchName : Code[10];ForProdOrderLine : Integer;ForRefNo

    and



    CreateReservEntryFrom(FromType : Option;FromSubtype : Integer;FromID : Code[20];FromBatchName : Code[10];FromProdOrderLine : Integer;Fr

    Thank you again
  • kinekine Member Posts: 12,562
    All the functions are part of the process of creating the entry. ...For is the target and From is the source of the reservation... (in standard reservations are between two things. E.g. Item Ledger and Sales Line, Prod. order line and Sales line, Prod. Order Component and Item Ledger etnry etc...).

    If you do not know the From part (you are just assigning Lot/Serial no. to the line which will produce the item), you just use the For function to select for which target you want to create the reservation...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • selece28selece28 Member Posts: 316
    Hi i have the same probelms,
    I create a codeunit to insert into Journal Line, then Insert Temporary table Tracking Specification.
    Then i call function :
    - CreateReservEntry.SetDates(
    - CreateReservEntry.CreateReservEntryFor(
    - CreateReservEntry.CreateEntry(

    from CU "Create Reserv. Entry"

    Then i open the Item Journal, i can see my item journal is already inserted.
    and when i check table 337 "Reservation Entry" its already filled.
    The problem is when i Open Item Journal, then click on [Line] - [Item Tracking Lines] it didn't show my tracking specifications.

    Where did i go wrong? When i do it manually, the result in table 337 is the already the same with the one that i run with my codeunit.

    Is there any other table that i need to insert?

    Thanks in advance
    ______________

    Regards,
    Steven
  • kinekine Member Posts: 12,562
    Compare the manually (through the forms) created entry with the one created by code. It seems that you are creating entry with wrong Reservation status.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • selece28selece28 Member Posts: 316
    Yep Thanks Kine,
    I already find out the problems. Its the "Source Ref. No." field that i got it wrong.

    And also Thanks for everyone in this thread :)
    ______________

    Regards,
    Steven
Sign In or Register to comment.