Doing a superdataport

FranklinFranklin Member Posts: 253
Good afternoon everyone.

I am a bit lost and need your help.

The five files have different names.

I wish I could use a dataport to import them all at once but I can not CurrFile variable renaming so go changing the name of different file.

I would also like to launch this dataport from an only process report but I can´t launch it from an integer type DataItem. It gives me an error.

Any suggestions? :-k :-k

EDIT: For example,

Dataport 50001
Dataitem 1 -- Table 50001 -- Import the file c:\users\me\folder\file50001.txt
Dataitem 2 -- Table 50002 -- Import the file c:\users\me\folder\file50002.txt
Dataitem 3 -- Table 50003 -- Import the file c:\users\me\folder\file50003.txt

Comments

  • matttraxmatttrax Member Posts: 2,309
    Back in Navision 3.7 we did this by changing the CurrDataport.FILENAME in the OnPredataItem trigger for each of the tables we were importing into.
  • FranklinFranklin Member Posts: 253
    Thx matttrax it worked.

    Now I have another question, how can i do the file is imported or not based on a parameter of the request form for example, if a variable is true the file will be imported but if it is false jumps.

    I have write... IF vTipo = vTipo :: Exportacion THEN EXIT in all triggers but it always import the file.
  • matttraxmatttrax Member Posts: 2,309
    EXIT just leaves the current trigger / function and jumps to the next one. So when you leave OnPreDataItem you just move to OnBeforeImportRecord.

    Look up the functions associated with CurrDataport. You will find the one you are looking for. You can find them using F5, the Symbol Menu, when you're in the code.
  • FranklinFranklin Member Posts: 253
    Thx again. The function was .BREAK. I didn´t know this function. \:D/
  • matttraxmatttrax Member Posts: 2,309
    You got it. Nice to see I can point someone in the right direction and they don't just back saying "Just tell me the answer!!" :D Well done.
Sign In or Register to comment.