Using FilePath on a form
When you want a filebrowser on your form and you only added a field that extends from the Extended Data Type FilePath, you wil get a stack-trace/error message when you click on the folder icon. Don’t panic, there is nothing wrong with your AX. Like the error explains you just need to provide the form with the method filePathLookupTitle.
1 2 3 4 | public LabelString filenameLookupTitle() { return "Select Import File"; } |
Normally this should solve your problem.
There are some more methods you can add to control the file lookup:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | public LabelString filenameLookupFilename() { return ""; } public FileNameFilter filenameLookupFilter() { FileNameFilter filter; filter = ['All FIles','*.*']; return filter; } public LabelString filenameLookupInitialPath() { return ""; } public LabelString filePathLookupTitle() { return "Select Document Path"; } |
Tags: Ax 5.0 (2009), Data Types, Dynamics AX, FilePath, Programming, Tips & Tricks, X++
This entry was posted on Thursday, June 25th, 2009 at 17:17 and is filed under Ax 5.0 (2009), Dynamics AX. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.


August 28th, 2009 at 16:26
Great !
filePathLookupTitle !! How could I not think about this immediatly !?
Many thanks Jeroen, you help me to solve my problem in a very short time.
Very nice site btw ! ^^
Kindest regards
°J°c