Setting dataport to only import data which is not zero

asemberengasembereng Member Posts: 220
I want to import data from an excel sheet to a navision database but i want to import only the data were the fourth column is not zero. It should only import the records without zero in the fourth column. can someone help me on this please?
Thank you.

Comments

  • SavatageSavatage Member Posts: 7,142
    input your data into variables.

    then onafterimportrecord.

    if "Yourvariableforthe4thfield" := 0 then CurrDataport.SKIP;
  • asemberengasembereng Member Posts: 220
    How do you put the data into variables i am new to Navison. Can you please explain that to me?
    Thanks
  • asemberengasembereng Member Posts: 220
    the data is in this form

    A6073 07/01/99 31/07/99 89
    A6073 08/01/99 31/08/99 0
    A6073 09/01/99 30/09/99 0
    A6073 10/01/99 31/10/99 34
    A6073 11/01/99 30/11/99 0
    A6073 12/01/99 31/12/99 0
    A6073 01/01/00 31/01/00 45
    A6073 02/01/00 28/02/00 0
    A6073 03/01/00 31/03/00 0
    A6073 04/01/00 30/04/00 66
    A6073 05/01/00 31/05/00 78
    A6073 06/01/00 30/06/00 56
  • SavatageSavatage Member Posts: 7,142
    edited 2008-01-07
    There is a section in the Application Designers Guide on your product CD about dataports. this will help you tremendously. @nd if you don't have it it can be downloaded. let me know if you need a link.

    3rd (this will be brief)
    once in the dataport ->view Globals
    Create 4 Variables (by the looks of it)
    Var1 type code
    var2 type date
    Var3 type date
    Var4 type Integer

    now when you go to view->dataport fields instead of entering the Nav Fields you enter these variables 1 thru 4.

    once done close that & view->C/al Code
    on the OnAfterImportRecord() trigger you map your variable fields back to their proper navision fields.

    Example/
    If Var4 := 0 
     Then Begin
      CurrDataport.SKIP;
    End
     Else Begin
      "No." := Var1;
      "Start Date" := Var2;
      "End Date" := Var3;
      "Quantity" := Var4;
    End;
    
  • asemberengasembereng Member Posts: 220
    Thank you.
    Can have the link to the designer's guide please.
  • SavatageSavatage Member Posts: 7,142
    emiel still has this link up
    I suggest you save it to your hard drive :D
    http://emiel.romein.googlepages.com/w1w1adg.pdf
  • DenSterDenSter Member Posts: 8,305
    Check your product CD disk 1. There is a folder called 'Doc', and you will find all documentation in there.
Sign In or Register to comment.