Dataport problem

Hi all, I want to pass a filename to a dataport. This Dataport will be an objectID in a table. You can only run this with RUNMODAL and not being set as a variable because the dataportID will be read from a special setup table. The filename is modified just before the import, to set a lock on the importfile, so I can’t use the filename from the setuptable in the dataport. How can I do this? Roelof

Hi Roelof, Try to use filename from the setup table in PreDataport trigger of Dataport.

Roelof, As a last resort, you could make a SingleInstance codeunit, which has a function that returns the file name. The codeunit might prepare the file (as you described) itself, or it simply “receives” the filename from another object through yet another function. Every dataport that can be run (i.e. that can occur in your special setup table) should call your SingleInstance codeunit to retrieve the file name.

Also you can add a field in User table and save the filename there. On Dataport run you can easily read from that table.