Building the Browse for Folder lookup
Folder browsing lookups can be used when the user is required to specify a local or network folder, for storing or retrieving external files. Such lookups are generated outside of Dynamics AX, by using Windows API.
In this recipe, we will learn how to create a lookup for folder browsing. As an example, we will create a new field and control named Documents in the General ledger parameters form, which will allow us to store a folder path.
How to do it...
1. In the AOT, open the LedgerParameters table, and create a new field with the following properties:
Property
Value
Type
String
Name
DocumentPath
Label
Documents
ExtendedDataType
FilePath
2. Add the newly created field to the bottom of the table's General field group.
3. In the AOT, open the LedgerParameters form, and create a new method with the following code:
public str filePathLookupTitle() { return "Select document folder"; }
4. To test the results, open General ledger ...