VishalMistry
29th January 2016, 13:51
Hi all,

I need help regarding below scenario:

I have a form field : hold.client.file. When the user zooms from this field, local file selector dialog box should open. which allows to select input csv file.

The executable file which opens on zooming, is not actually a session so I have setup zoom related settings for hold.client.file as given in attachment:

I know the reason behind the error. It is actually because I have choose to zoom from hold.client.file but not given any session code, hence I am getting the error.

The code works perfectly if I write local file selection logic in check.input but fails if written in before.zoom section.

I am required to open file selection dialog box on zooming only. Can anybody guide on what to tweak in the code ?

Vishal

VishalMistry
29th January 2016, 18:39
Hello Everyone,

Suppose I have a form field and zooming on that field opens another session. Is it possible that when user clicks on the zoom button, I cancel zooming on the session and open local file selector dialog box ?

Please guide.

Vishal

mark_h
29th January 2016, 19:53
Why not just make a session that all is does is open the file location executable? Then any session that needs something like this just zooms and runs the new session.

bhushanchanda
30th January 2016, 06:12
Hi,

One workaround here is to add the same session code in the Zoom Session. Now in the script just write the following code -

zoom.from.all:
on.entry:
exit()


This code will kill the session if its zoomed from anywhere. In case if you want to exit only for this session you can add the condition.

Now, in after.zoom or before.zoom section you can call the local file selector function.

VishalMistry
1st February 2016, 09:18
Hi all,

Thank you all for your suggestions. Is it possible to assign a shortcut key (like CTRL + O) so that when the control is on the field, if the user presses the shortcut field, the file selector dialog just opens.

Thank you all once again,
Vishal

Hi,

One workaround here is to add the same session code in the Zoom Session. Now in the script just write the following code -

zoom.from.all:
on.entry:
exit()


This code will kill the session if its zoomed from anywhere. In case if you want to exit only for this session you can add the condition.

Now, in after.zoom or before.zoom section you can call the local file selector function.

bhushanchanda
2nd February 2016, 09:12
Hi,

Follow these steps -

1. Create a session and name it tcibd9199m000(dummy)
2. Add a form field through DFE say file.f, domain tcmcs.str100
3. Add Zoom session as tcibd9199m000 and keep return field as blank
4. Write the following Code in the script -

declaration:

extern domain tcmcs.str100 file.f
string file.name(100)

#include <bic_desktop>

zoom.from.all:
on.entry:
exit()


field.file.f:
after.zoom:
seq.open.dialog.local (false, "test", "C:\Temp\", "*.*", file.name)

Now, if you go on this field and use Ctrl+B or just click on zoom, it should open the file selector dialog.

Another way is

1. Create a session and name it tcibd9199m000(dummy)
2. Add a form field through DFE say file.f, domain tcmcs.str100
3. Add a form command say - open.dialog
4. Put some shortcut key available(Due to internal reasons, Ctrl+O is not available, so you can use Ctrl+Shift+O)

Description -
Description of Ctrl+O standard shortcut given here (http://www.baanboard.com/programmers_manual_baanerp_help_functions_generic_browser_frameworkf_standard_menu_items_and_function_keys)
Open all
Ctrl+O
Open all interior nodes whose children have already been read before (so do not read what is not yet there, see read all)


5. Write the below code -

declaration:

extern domain tcorno file.f
string file.name(100)
string field.name(30)
#include <bic_desktop>

functions:
function extern open.dialog()
{

if trim$(fattr.currfld$) = "file.f" then
seq.open.dialog.local (false, "test", "C:\Temp\", "*.*", file.name)
endif
}