mibuso.com

Microsoft Business Solutions online community
It is currently Sun May 26, 2013 2:20 am

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Run XMLport in a processing report without file open dialog
PostPosted: Mon Aug 20, 2012 2:56 am 
Offline

Joined: Sat Nov 04, 2006 3:39 am
Posts: 1
Location: California
Country: United States (us)
Hi

I have an old mod (Navision 3.7) which we are upgrading to NAV 2009 R2 RTC. I want to run XMLport (dataport was used in Navision 3.7) in a processing report without file open dialog box.

The files which are required to be processed are csv files and are sitting in a folder on network. File paths are stored in UNC convention. NAV Server and RTC User both have full permission to the folder and files. In RTC, user runs a processing report. The Processing report locates the folder and reads the file(s) in a repeat until loop. For each file located in the repeat until loop, Name of the file is parsed to decide if the data in file needs to be loaded in NAV table, and uses an XMLPort (it was using a dataport in older version). File name passed to XMLpoprt by setting FILENAME property of XMLport.

In classic when the report (which uses dataport) is run, no file open dialog box appears. Everything works fine

The problem is in RTC.

In RTC when the report is run, file open dialog box appears, with Open and cancel button. Correct folder is selected and I can see the correct file in the dialog box. Selecting Open runs the XMLport properly and data is also loaded correctly. The problem is that we need to run the XMLport in silent mode (without any file open dialog boxes), without user pressing open buttons all the time. As file names are passed on by the processing report to XMLport, is there any way to run the XMLport without showing File Open Dialog Box, instead of re-writing the file import funnction?


XMLport properties set:
Direction: Import
Format: Variable Text
UseReqForm: No

Code snippet below. EDIImport is a dataport where as EDIImportXML is the XMLport.
Code: Select all
EDIFiles.SETRANGE(Path, EDISetup."EDI File Location");
EDIFiles.SETRANGE("Is a file", TRUE);
IF EDIFiles.FIND('-') THEN REPEAT
...

  IF NOT ISSERVICETIER THEN
    CLEAR(EDIImport)
  ELSE
    CLEAR(EDIImportXML);
...
            IF NOT ISSERVICETIER THEN BEGIN
              EDIImport.FILENAME := EDIFiles.Path + EDIFiles.Name;
              EDIImport.IMPORT := TRUE;
              EDIImport.RUNMODAL;
              CLEAR(EDIImport);
            END ELSE BEGIN
              EDIImportXML.FILENAME := EDIFiles.Path + EDIFiles.Name;
              EDIImportXML.RUN;
              CLEAR(EDIImportXML);
            END;
...

UNTIL EDIFiles.NEXT = 0;

Chandra :-k


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Evert-Jan and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: