Impotring a .csv file

lavakumarlavakumar Member Posts: 21
edited 2004-07-06 in Navision Attain
Hi

I have a comma saperated file containing shipment information of goods shipped against a particular sales order. This file is generated as and when the goods are shipped at warehouse.

the file looks like this

DateOFShipment, salesOrderNo, ItemID, Quantity

There are several lines like this for different sales order,ItemId and quantity

I want to import this file into Navisio and update respective tables.

Can any body help me through and let me know which tables are to be updated taking care of validation triggeres and other constarints for updating shipment information to avoid manual entry in navision.

Thank and regards

Kumar

Comments

  • RobertMoRobertMo Member Posts: 484
    you should update "Qty. To Ship" in "Sales Line". And then call posting codeunits for posting "shipment only"
               ®obi           
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  • lavakumarlavakumar Member Posts: 21
    Thank you very much RobertMO. I am very encouraged by your reply. Can you slightly eloberate your reply with sample code and posting codeunit details.

    I know this is too much to ask from you but I shall be extremely grateful for the help. I am a beginer to Navision and your guidence will be a great help.

    Thanks and regards

    Kumar
  • RobertMoRobertMo Member Posts: 484
    I wold be faster to do the job then to descibe it here in details. I'll try to give you most important hints. I think you should try and then we will see. This also asumes that only 1 order is found in your csv.

    1. Make a dataport for importing csv. you can have table "Integer" as data item and define varibles that will hold you csv values (order,item ,date,qty).
    2. clear all vars on "OnBeforeImportRecord"
    3. On "OnAfterImportRecord" find "Sales Line" according to salesOrderNo, ItemID (and if necessary Quantity) . Additional :?: What if you have two or more equal Items on same sales order ?
    4. Update field "Qty tp ship" with qty that was shipped.
    5. modify sales line.
    6. put a code in "OnPostDataItem" that will post shipment after processing all entries in your csv
    6a. find "Sales Header" according to salesOrderNo
    6b. set "Ship" to TRUE (like in CU 81)
    6c. call SalesPost.RUN(SalesHeader); like a call in CU 81.
               ®obi           
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  • lavakumarlavakumar Member Posts: 21
    Thank you very much Robert. Your solution worked. You are really a super Navision expert. Thanks and obliged

    Kumar
Sign In or Register to comment.