Options

Item Tracking Lines

misadministratormisadministrator Member Posts: 11
Evening!

I've had the request to add serial numbers to the delivery note and sales invoice reports. This was fairly straight forward for the delivery note: just map fields to the Item Entry Relation table.

However, I can't work out where Navision stores the serial number info for the item tracking lines of a posted sales invoice. I've found some info in the Item Ledger Entry table, but this doesn't map line numbers...

Can someone please put me out of my misery... Which table is holding the serial number data for the posted sales line - item tracking lines?

Many, many thanks.

- Rowan

Comments

  • ara3nara3n Member Posts: 9,258
    edited 2006-09-21
    Hello Mis Administrator.


    I will try to put it in worlds. SalesInvoice line has a function called RowID1
    which returns a string. That string is used to filter in valueEntryRelattion table to find the associated value entry. Once you have the value entry, then you can relate to Item Ledger, which has the serial no.

    I have a Integer as dataitem
    OnPreDataItem()
    
    InvoiceRowID := TempSalesInvoiceLine.RowID1;
    ValueEntryRelation.RESET;
    ValueEntryRelation.SETCURRENTKEY("Source RowId");
    ValueEntryRelation.SETRANGE("Source RowId",InvoiceRowID);
    NumSerialLines := ValueEntryRelation.COUNT;
    AGSerialNo := 5;
    IF (NumSerialLines MOD AGSerialNo) = 0 THEN
      SETRANGE(Number,1,NumSerialLines/AGSerialNo)
    ELSE BEGIN
      NumSerialLines := ROUND(NumSerialLines/AGSerialNo,1,'<')+1;
      SETRANGE(Number,1,NumSerialLines);
    END;
    
    The code above and below print the data. It basically prints 5 serial no on one line.

    SerialNo - OnAfterGetRecord()
    IF Number = 1 THEN
      ValueEntryRelation.FIND('-');
    CLEAR(SerialText);
    AGInt := 0;
    
    REPEAT
      AGInt += 1;
      ValueEntry.GET(ValueEntryRelation."Value Entry No.");
      ItemLedgEntry.GET(ValueEntry."Item Ledger Entry No.");
      SerialText[AGInt] := ItemLedgEntry."Serial No.";
    
    UNTIL (ValueEntryRelation.NEXT = 0) OR  (AGInt = AGSerialNo);
    
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • ara3nara3n Member Posts: 9,258
    edit.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • misadministratormisadministrator Member Posts: 11
    Rashed,

    Thanks for your help. Just wondering if I can pick your brains again - having trouble with the following line:

    SerialText[AGInt] := ItemLedgEntry."Serial No.";

    ILE --> Serial No. is type Code. I've set SerialText to Code, but get the error Char := Code

    Where am I going wrong??

    Thanks

    - Rowan
  • ara3nara3n Member Posts: 9,258
    SerialText is of type Code and it's an Array. To make a variable an array you need to go to global. Find the variable. and lick on properties. Change the Dimension Property to 10.


    SerialText[AGInt]


    In the sections you will have 5 text boxes. Souce expression for the first box will be SerialText[1], second will be SerialText[2] etc.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • misadministratormisadministrator Member Posts: 11
    Fantastic! Thanks!!
Sign In or Register to comment.