I have a dataport that I want to run dynamically from a form. The form knows the file name I want to import. I do not want the dataport request form to pop up where I have to enter the filename.
The dataport properties I think are significant are as follows:
Import: <Yes>
FileName: C:\default.txt (I read that leaving it blank will cause the request form to appear)
UseReqForm: No
All other properties are default values.
The OnPush event for the button looks like this:
ImportFile.IMPORT(TRUE);
ImportFile.FILENAME(vFileName);
ImportFile.RUN;
This brings up the request form with a blank filename. I've added message commands to show that vFileName does in fact have a value before the the ImportFile.FILENAME(vFileName); command. I've also set message commands to show me that the value of ImportFile.FILENAME is what I want after this command is run.
Alternately I have used: DATAPORT.RUN(DATAPORT::"The dataport", FALSE); This successfully avoids the request form, however the correct filename is not set so I get an error.
How do I make this all come together so that it works right?
0
Comments