Importing Serial no from text file using dataport

FreeksterFreekster Member Posts: 5
edited 2004-03-10 in Navision Attain
Since this is my first visit - hi all!

Problem:
I'm importing a text file with Orderno;Lineno;Itemno;Qty;Serialno
If there's a serialno, I want to assign that serialno to the item on the sales line and then the user should Post (Ship or Ship/Invoice) the order.
I've come so far that the serial no is assigned to the line (I see it on from 6510) and everything looks OK. BUT when I try to post it (Ship) it breaks in CU 22 function CheckItemTracking. The error message is Text015 (Serial no is required for item XX...).
I've checked out the code on form 6510 and it seems to me that assigning a serial no is quit a complicated operation. I've tried to replicate the functions used in form 6510 and CU 9900832 in my dataport but without result. There's a lot of varibles declared as temporary records and I'm not sure I've done it right.
If you guys have any input that could help me solve this problem I would be very thankful.

Cheers / fredrik

Comments

  • fredefrede Member Posts: 80
    Hi,

    :( I'm sorry to say, one of my colleagues has been trying the same without success...?

    Would like to hear if You find a solution...
    Regards,

    Henrik Frederiksen, Denmark
  • StephenGStephenG Member Posts: 99
    Hi you will need to enter the Serial No. directly into the "Reservation Entry"
    Table (337)
    ReservEntry.RESET;
    ReservEntry.LOCKTABLE;
    ReservEntry.FIND('+');
    NextEntryNo := ReservEntry."Entry No." + 1;
    
    
    ReservEntry.INIT;
    ReservEntry."Entry No." := NextEntryNo;
    ReservEntry."Creation Date" := WORKDATE;
    ReservEntry."Source Type" := DATABASE::"Sales Line";
    ReservEntry."Source Subtype" := "Sales Line"."Document Type";
    ReservEntry."Source ID" := SalesLineLine."Document No.";
    ReservEntry."Source Ref. No." := SalesLine."Line No.";
    ReservEntry."Reservation Status" := ReservEntry."Reservation Entry"::Surplus;
    ReservEntry."Item No." := SalesLine."Item No.";
    ReservEntry."Serial No." := SerialNo;
    ReservEntry."Location Code" := SalesLine."Location Code";
    ReservEntry.Quantity := SalesLine.Quantity;
    ReservEntry."Quantity (Base)" := SalesLine."Quantity (Base)";
    ReservEntry."Qty. to Handle" := SalesLine."Qty. to Ship";
    ReservEntry."Qty. to Handle (Base)" := SalesLine."Qty. to Ship (Base)";
    ReservEntry."Qty. to Invoice" := SalesLine."Qty. to Invoice";
    ReservEntry."Qty. to Invoice (Base)" := SalesLine."Qty. to Invoice (Base)";
    ReservEntry."Qty. Per Unit of Measure" := SalesLine."Qty. Per Unit of Measure";
    ReservEntry.INSERT;
    NextEntryNo := NextEntryNo + 1;
    

    This should help point you in the right direction.
    Answer the question and wait for the answer.
  • FreeksterFreekster Member Posts: 5
    Thanks Stephen, it looks like it works,

    //
    Fredrik
Sign In or Register to comment.