How tos

How To enter filename when modifying the request form of a dataport?

Author
Luc Van Dyck
Date
03/03/2003
Size
2,83 KB
Downloads
2572
Rating
432150
Popularity
Downloaded 5 times in the last two weeks
When creating a dataport using the wizard, the request form contains the controls "File Name" and "Direction". In design-mode, the request form is empty, so these controls are added by Navision at run-time.

When controls are added to the request form, you loose the ability to choose a filename for the dataport.

Steps to add the filename control
  • Define a global variable txtFilename of type Text[250]
  • Place a Label and TextBox control on the request form
  • Modify the following properties of the TextBox control:
      ID: 1
      Caption: File Name
      SourceExpr: txtFilename
      AssistEdit: Yes
  • Modify the following property of the Label control:
      ParentControl: 1
  • Put this code in the OnPreDataport-trigger: CurrDataport.FILENAME := txtFilename;

Note: It is essential that the ID of the TextBox control is set to 1. Otherwise, you can't browse for the file when pressing the AssistEdit button.