Data Import via NAS

Soumyadip
Soumyadip Member Posts: 209
Hi All,

I want to run two different dataports automatically after a given time period. I was thinking of useing NAS for that. Is it possible to run dataport from NAS (may be via codeunit)

Thanks in Advance

Soumyadip

Comments

  • ara3n
    ara3n Member Posts: 9,258
    No, you can't run dataports with NAS. You have to write a CU that will do the work of a Dataport.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • kine
    kine Member Posts: 12,562
    1) If you will search for dataport and NAS on this forum, there will be many posts with answers for you...

    2) Shortly - you cannot run Dataport under NAS in any way. You can use XMLPort or write the code to read the file directly in codeunit or report...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Stardust77
    Stardust77 Member Posts: 95
    In fact, you can. The NAS should trigger a Codeunit, from which you can launch the Dataport. In the codeunit, you can use something like this:
    CLEAR(ExpSalesDoc);
    ExpSalesDoc.FILENAME := STRSUBSTNO('%1Document.txt','C:\');
    ExpSalesDoc.RUN;
    

    Where the ExpSalesDoc is your dataport. :D
  • kine
    kine Member Posts: 12,562
    Did you tried that? It is not possible because NAS will complain that Dataport object cannot be run under NAS (same message like when Form or Dialog is used...) 8)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Stardust77
    Stardust77 Member Posts: 95
    :oops: I'm going to test this right now, and let you know the outcome.
  • Stardust77
    Stardust77 Member Posts: 95
    Hi Kine, you're right, I'm wrong. :-#