BigJohn
2nd May 2004, 20:37
Hi,
In Baan 4, for a field in the foprm layout i can specify the zoom session for the field along with auto zoom checked.
I don't seem to find the Auto zoom functionality in Baan 5.
Please advice.
Thanks.
Cheers,
BigJohn
lbencic
3rd May 2004, 18:09
I never noticed that, but it does appear to be gone. If you check in the documentation, that functionality has specifically been removed.
IE: Baan IV Documentation on the attr.zoomcode predefined variable:
long attr.zoomcode Field zoomcode.
Possible values are:
0
z.session
z.session + z.autozoom
z.session + z.autoaccept
z.session + z.autozoom + z.autoaccept
z.menu
z.menu + z.autozoom
z.menu + z.autoaccept
z.menu + z.autozoom + z.autoaccept
Baan V Documentation:
long attr.zoomcode Field zoomcode.
Possible values are:
0 (no zoom)
Z.SESSION
Z.MENU
I tried putting the Baan IV method into the Baan V script, like this:
before.field:
attr.zoomcode = z.session + z.autozoom
This compiles in V, but does not do the trick. In Baan IV, that would activate the autozoom on that field, even if the Form did not have that checked. So, it's gone I fear. Why? I don't know, maybe security reasons...?
On the plus side, while researching, I found this cool option that may be of some use (or no use at all...)
Auto Complete (http://www.baanboard.com/programmers_manual_baanerp_help_functions_form_and_form_field_operations_fields_autocomplete)
Good luck!
Here is a sample code for BaaN-V version to implement Auto-Zoom-
field.stg.vers:
before.zoom:
get.stg.vrc()
before.input:
if isspace(stg.vers) then
get.stg.vrc()
endif
function get.stg.vrc()
{
string sdum
attr.zoomcode = Z.SESSION
ttadv111.cpac = "tc"
sdum = start.session(MODAL, "ttadv1511m000", prog.name$, "ttadv111._index1")
stg.vers = ttadv111.vers
stg.rele = ttadv111.rele
stg.cust = ttadv111.cust
attr.zoomcode = 0
}
I also enable the zoom in the form editor, so that I get the zoom ">" array on the form, but it wouldnt be executed due to this code.
I am not sure why its removed but my guess is it due to the new Integrated Session or Webtop compatiblity issues.
I have also found this in one of our latest porting set notes-7.3.a.04
MaintReger: # 19704 (BDNT12843): Error 518 when starting more then 250 sessions
Date: Wed, 13 Aug 2003 10:52:40 +0200
Created on: MaintReger
Type: bugfix
Problem Description (Customer terms)
When starting to much Baan sessions (or zooming to much times), that is more then about 250 times,
the following error occurs (And several other errors):
Env corelli (d:\corelli)
Prog bshell file \db\lib\dbc\C_OPEN.C # 823
Keyword Invalid transaction
Username kvddool type S language 2
Process 0x107c
ProcessSet kvddool@CNL08696:3984
Lasterror 997 (Overlapped I/O operation is in progress.)
Errno 0
bdberrno 518 (Invalid session code specified)
Message Invalid transaction id 0 specified.
fied).
Because of this error you are going to think something is wrong in the session code of the Baan session,
and the actual problem is not clear. To save support time in analyzing the problem, a more nice message should appear.
E.g.: maximum number of session reached.
Problem Description (Technical terms)
To start a new db session, bdb_start_session is done. This function reserves a global transaction,
which appears to the bdb user as a session. The number of transactions is limited by MAX_PROC_SLOTS.
When starting more the MAX_PROC_SLOTS, no new bdb session can be created.
But there is no error generated informing the enduser that this is the case.
Also execution of the calling function is not stopped in case bdb_start_session cannot start a new session.
Workaround
Do not start more then 250 (zoom)sessions, or use multiple Baan logins.
Test Procedure
Log in Baan and start more then 250 sessions.
Motive source
DF:139257
Lisa,
Auto-complete is a good feature and we use it.
Please note the bold section-
Auto-complete is automatically executed by the 4GLE for fields that have a reference path to another table and have a zoom session and has no button and is not segmented. With this function auto-complete can be turned off ( try.autocomplete = FALSE ) and on again ( try.autocomplete = TRUE ).
lbencic
3rd May 2004, 20:26
ok, gotcha, thanks NP. You can simulate an 'auto zoom' by calling the zoom in the code.
(edited for clarity)
Baan IV had z.autozoom and z.autoaccept, these took the form of options on the form fields in Maintain Forms. Baan V no longer seems to support those options in the zoom.code mask, and they no longer appear on the forms.
You can program the z.autozoom by programming a zoom.to$ in the script. Again, kind of bad because you can no longer do that straight from the form.
I suppose the z.autoaccept would be programmed by doing a to.field when you return from the zoom.to$, or... maybe use the new try.autocomplete for that somehow, I have not played with it.
I'm glad you said it's working for you, because I got some emails saying it was not working in Vc. I'll need to test that out for sure, out of time today though. If anyone has that already working in Baan Vc let us know, otherwise I'll run some test and post tomorrow or soon. Sounds handy, I would like to use :)
Lisa,
Alternatively you can also use this code-
on case zmmig201.cmptype
case zmcomponent.session:
query.extend.where.in.zoom("ttadv200.cpac = " &
quoted.string(zmmig201.pckg)& " and " &
"ttadv200.vers = " & quoted.string(version)& " and " &
"ttadv200.rele = " & quoted.string(release) & " and " &
"ttadv200.cust = " & quoted.string(customer))
attr.zoomsession$ = "ttadv2500m000"
attr.zoomreturn$ = "ttadv200.cmod"
attr.zoomreturn$ = "ttadv200.cses"
attr.zoomcode = z.session
#pragma used session ttadv2500m000
break
Also refer to the manual - zoom.to$() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_starting_and_stopping_programs_zoom_to) for Notes -
This function is supported for backward compatibility only. In new applications, use start.session() instead.