It has been a very long time since I last created a Dataport and this week I had to create one for a customer who’s running on version Dynamics NAV version 5…
No problem, I created it and to make it flexible for the user I added some textboxes with lookups on the request form of the Dataport. But then suddenly, when I ran the Dataport, I was no longer able to select the file name.
Appareantly, when you don’t fill the FileName dataport property, then you can select one when you run it, except if you put something in the request form…
No worries, there’s a little trick I remembered. What you need to do is create a text box on the request page, and link it to a text variable via the SourceExpr.
Then, give the textbox ID = 1, and in the textbox triggers you can write code that assigns the value of the variable to the FileName property of the Dataport:
And because the textbox has ID=1, it can be used at run time to select a file:
without the need for any ‘special’ programming.