Auto name file on dataport

Hi… Is it possible create (file.txt)name auto on dataport, let say’s on order form I added a button, table that I choose sales header & sales line, all i want just doing only export and the file I want to name like current order no. (1001.txt), thanks for the solution… Regards’ AKO

Try the following with in your dataport : CurrDataport.FILENAME := FORMAT(SalesHeader.“Document Type”) + ’ ’ + SalesHeader.“No.” + ‘.txt’; I guess that it should work, give it a shot! tarek_demiati@ureach.com

Before running the dataport you have to pass the filename to the dataport. You can do that using a function in your dataport. There you pass the filename-parameter to a global. Then running the dataport you can set the filename with CurrDataport.FILENAME using the value of your global.

If you want to call a function in a dataport, you have to declare the dataport as a global variable and following properties of the dataport must be set otherwise it wont work Import = No UseReqForm = No Then use the following code to run the dataport. CLEAR(Dataport); Dataport.AssignFileName(FileName); Dataport.RUN; It works fine! Rubina Durrani