ben.kansas
15th March 2016, 15:40
Hello All,

I have two custom sessions and am zooming from a field on one to the other to return data. The zoomed-to session when run separately has navigation buttons at the top of the session (next record, next group, etc.). However, when being zoomed to, it does not display the navigation buttons.

When zooming to the second session how can I display the navigation buttons?

Thanks,
Ben

Ajesh
16th March 2016, 06:50
I guess this is the default behavior of the called session or the zoomed session. If you want to change the default behavior then what you need to do is



zoom.from.<Table_Field>: |Used to specify the field from which the current session is zoomed to
on.entry:
enable.commands(first.view,next.view,prev.view,last.view,first.set,next.set,prev.set,last.set)

ben.kansas
16th March 2016, 17:27
Hi Ajesh,

Thanks for your help.

I added your suggested code, but although the line executes I can see no effect on the session; none of the Navigation buttons are visible.

Thanks,
Ben

NPRao
16th March 2016, 18:03
Ben,

Please post your custom code here if you want others to help you out than trying to guess. I don't think the navigation buttons are enabled for a Dialog and zoom sessions.

Refer to the function usage - start.session() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_starting_and_stopping_programs_start_session)

benito
16th March 2016, 18:31
i think you need to tell the group what you are trying to achieve. i don't think you would be able to see the buttons in the zoomed session. the standard program converts it to a different form type, just enough for you to select a record to pass to your main form.

ben.kansas
16th March 2016, 19:30
Hi all,

Thanks for your replies.

I am attempting to zoom from a field on a form to another session. I use an Item number to find a partial index within the zoomed session. The zoomed session then returns a full index to the calling session (Item num, supplier code, producer code, position number).

The issue is that when zooming to the session the user wants to select a different supplier/producer/position than the one that is initially opened.

I've attached my two script files, tdcgs4561.bc is the calling session and tdcgs4161.bc is the zoom-to session.

Thank you,
Ben

Ajesh
16th March 2016, 19:59
Hi Ben

I thought you dont need to do execute(find.data), the zoomed session does it automatically. This code i find it redundant.Is it really required?


if not isspace(item.in) then
select tdcgs601.*
from tdcgs601
where tdcgs601._index1 = {:item.in}
selectdo
|if the item is found, display the first record for that item
execute(find.data)
endselect
endif



Regarding your main question, emm Let me think;)

benito
16th March 2016, 21:58
ben, please look at the sample session. it has a zoom field going into a sub-session. you should be able to have a multi-occurence sub- session with a find button. this should work for you.

ben.kansas
17th March 2016, 23:14
Hi Benito,

I apologize for the tardy reply. Busy putting out fires at work the last two days.

I do have a find button. And yes it is a good work-a-round. But it does require you to know the BP code to get to the correct index. It is easier for the end user to open to the correct item and then navigate a group or two to the correct supplier.

I've attached a screen shot of my session for clarification.

Thanks,
Ben

NPRao
18th March 2016, 21:57
Ben,

Based on the screenshots, that's the standard behavior of the zoom session. You can use the predefined variable -
long attr.zoomindex 4 Number of table-index to start session zoomed to from a field.
Also refer to the thread, to assign some key field to make the search efficient -
zoom to session and find record automatically (http://www.baanboard.com/baanboard/showthread.php?t=62134)