Importing same Doc. No's data in two different tables

Hi Guys,

I have a a question in NAV Classic Client dataport.

Using one dataport, I need to import data into two different tables.

I need to insert records from a CSV file into NAV Purchase Journals (Gen. Journal Line table). This part is working fine. In CSV file, I have a two columns named Line Narration and Voucher Narration. I need to differentiate those columns and insert into Line Narration and Voucher Narration field in Gen. Journal Narration table.

Hint: In Gen. Journal Narration table, there are two fields Gen. Journal Line No. (for Line Narration) and Line No. (for Voucher Narration)

Example: Gen. Journal Narration

lpstv1n9pa8k.jpg

Can anyone explain how to do this task? Let me know if you need more clarification.

Regards,
Aarvi

Answers

  • postsauravpostsaurav Member Posts: 708
    Hi Aarvi,

    You answered your question yourself.

    Just create a variable of table "Gen. Journal Narration". Just do an init and Insert with values of all these fields -
    Journal Template Name
    Journal Batch name
    Document No.
    Gen. Journal Line No.
    Line No.
    Narration.

    What is the problem. How system Differs between Line Narration and Voucher Narration using "Gen. Journal Line No.". If its "0" that means its a voucher narration.

    Let me know if any question.

    Thanks & Regards,
    Saurav Dhyani

    Do you Know this About NAV?


    Connect - Twitter | Facebook | Google + | YouTube

    Follow - Blog | Facebook Page | Google + Page
  • Aravindh_NavisionAravindh_Navision Member Posts: 258
    Thanks Saurav for your reply.

    Please find the below screenshot. This is how the CSV file looks. Using this file, I need to insert values in two different tables: "Gen. Journal Line" table and "Gen. Journal Narrtion" table.

    si16kb8sa0f6.jpg

    Line Narration and Voucher Narration will be given in CSV file by the user. For few lines, Voucher Narration will not be given (for this we need to change the "Gen. Journal Line No." to 0, if I am correct). How to determine the importing value is null or with value? It might be simple, but got struck up there :(

    Could you please throw me some logic on this?

    Regards,
    Aarvi
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    you can import the values to variables and not to fields directly.
    you can check whether variables are blank or having data before proceeding?
  • postsauravpostsaurav Member Posts: 708
    Hi Aarvi,

    As Mohanan Suggested You can proceed with same approach.

    While Inserting a Line It should be something like -
    If "Line Narration" <> '' THEN
     InsertNarration(TemplateName,BatchName,DocumentNo,GenLineNo,LineNo,"Line Narration");
    
    If "Voucher Narration" <> '' THEN
     InsertNarration(TemplateName,BatchName,DocumentNo,GenLineNo,0,"Line Narration");
    

    Where InsertNarration is a function which actually insert record. Hope it make sense.

    Thanks & Regards,
    Saurav Dhyani

    Do you Know this About NAV?


    Connect - Twitter | Facebook | Google + | YouTube

    Follow - Blog | Facebook Page | Google + Page
Sign In or Register to comment.