Follow the below step to add Browse Functionality in Form
Step1:- Create a Form
> Add a StringEdit in Design
>Assign a EDT Property as FilenameOpen
Step 2:-
Add the below Methods to the form in order to complete the functionality
FilenameFilter filenameLookupFilter()
{
#file
return [WinAPI::fileType(#xpo), #allfilesName+#xpo, #allFilesType, #allFiles];
}
-----------------------------------------------------------------------------------------------------------
str filenameLookupTitle()
{
return "Select a trade agreement to import";
}
------------------------------------------------------------------------------------------------------------
str filenameLookupInitialPath()
{
return "";
}
-------------------------------------------------------------------------------------------------------------
str filenameLookupFileName()
{
return "";
}
----------------------------------------------------------------------------------------------------------------
All Done !!!!!!!!!
Now you can browse the file in Form
Method 2 :-
Step 1:- Create a Form
> Add a StringEdit in Design
>Assign a EDT Property as FilenameOpen
Step 2:- Override the Lookup method on StringEdit Control.
public void lookup()
{
FilenameOpen file;
Filename path;
Filename name;
Filename type;
#File
file = WinAPI::getOpenFileName(element.hWnd(),[WinAPI::fileType(#xlsx),#AllFilesName + #xlsx],path,'Select ...',"",name + type);
if(file)
{
StringEdit.text(file);
}
}
Step1:- Create a Form
> Add a StringEdit in Design
>Assign a EDT Property as FilenameOpen
Step 2:-
Add the below Methods to the form in order to complete the functionality
FilenameFilter filenameLookupFilter()
{
#file
return [WinAPI::fileType(#xpo), #allfilesName+#xpo, #allFilesType, #allFiles];
}
-----------------------------------------------------------------------------------------------------------
str filenameLookupTitle()
{
return "Select a trade agreement to import";
}
------------------------------------------------------------------------------------------------------------
str filenameLookupInitialPath()
{
return "";
}
-------------------------------------------------------------------------------------------------------------
str filenameLookupFileName()
{
return "";
}
----------------------------------------------------------------------------------------------------------------
All Done !!!!!!!!!
Now you can browse the file in Form
Method 2 :-
Step 1:- Create a Form
> Add a StringEdit in Design
>Assign a EDT Property as FilenameOpen
Step 2:- Override the Lookup method on StringEdit Control.
public void lookup()
{
FilenameOpen file;
Filename path;
Filename name;
Filename type;
#File
file = WinAPI::getOpenFileName(element.hWnd(),[WinAPI::fileType(#xlsx),#AllFilesName + #xlsx],path,'Select ...',"",name + type);
if(file)
{
StringEdit.text(file);
}
}
Thanks for your help!!!!!
ReplyDeletehttps://www.youtube.com/playlist?list=PLWSxgDbjVWTjxvgnaAZ0iK8o5dYHAYhrq
ReplyDeleteCollection of Microsoft ERP Clips || ERP Licensing, Technical, Functional ,Manager Learning Videos Listing