Problem Description: stack trace after adding FileNmeOpen Extended Data Type to a form
After having added a StringEdit control to a Dynamics AX form with as ExtendedDataType FileNameOpen, you get a stack trace upon clicking the open icon: Error executing code: FormRun object does not have method ‘filenameLookupInitialPath’.
The same could happen if you add one with as ExtendedDataType FilePath.
Solution: add some form methods
To fix this, you should add some methods to your form.
str fileNameLookupFilename()
{
return '';
}
str fileNameLookupTitle()
{
return "@SYS53008";
}
str fileNameLookupInitialPath()
{
return '';
}
container fileNameLookupFilter()
{
return ['All files','*.*'];
}
An example can be found on form CompanyImage.
You could replace the fileNameLookupFilter to show only files of a certain type, for example only *.txt files. An example could be in this case:
container fileNameLookupFilter()
{
return ['All *.txt files','*.txt'];
}
Post a Comment