monica1
27th September 2004, 13:47
I want to switch company before zoom to item session, but it zoom automatically and I can´t switch the company. How can I do that?
In the form field I haven´t zoom session, I write it in program script.

field.casls404.itema:
before.zoom:
ret = switch.to.company(500)
attr.zoomcode = Z.SESSION
attr.zoomsession$ = "tcibd0501m000"
attr.zoomreturn$ = "tcibd001.item"

after.zoom:
ret = switch.to.company(404)

malutz
27th September 2004, 15:29
Hej,

what is the returnvalue of


ret = switch.to.company(500)


Maybe it would be possible to write a specifiy query.expand.where()-clause in the Item-Session when you zoom from your program.

monica1
27th September 2004, 16:59
The problem is that if I compile the programm with debugger it doen´t stop in before.zoom. The zoomed session appears and doesn´t stop in.

mark_h
27th September 2004, 17:13
You might want to double check that automatic zoom is turned off on that field in the form.

Mark

monica1
27th September 2004, 17:33
Where can I see the automatic zoomed in the table?
In the field definition I haven´t see anything like this.

mark_h
27th September 2004, 17:38
It would be on the form for that field. When you bring up the field you have zoom, zoom to and right below that is automatic zoom. This would be on the form - of course I am assuming Baan V and 4c4 would be the same for this aspect. I could be wrong.

Mark

monica1
27th September 2004, 18:10
In Baan V may be different becase in zoom section of the form I have zoom, zoom to and zoom return and nothing more.
I attach a document with the form datails.

mark_h
27th September 2004, 18:24
Try not to put screen shots in word documents - takes up too much space on the server. Yes it looks like baan they are different. I do not have a clue now - it sounds just like what this field does.

Mark

mark_h
27th September 2004, 18:26
Just noticed the zoom on this field in your snap shot is no. In Baan 4c4 when I want to set the zoom fields I set zoom to session or menu on the form. Then I can control it in the script. Just a thought.

Mark

NPRao
27th September 2004, 20:21
Monica,

As Mark suggested you can change the form field options.

Here is my piece of code which works -

field.job.f:
before.zoom:
curr.comp = get.compnr()
e = compnr.check(comp.f)
if check.table.present("tttaad500") <= 0 then
set.input.error("zmamds0033", get.compnr())
|* No Jobs defined for Company %1$d
endif
after.zoom:
e = compnr.check(curr.comp)
check.input:
if isspace(job.f) then
set.input.error("zmadms0009", "From Job")
|* Please enter the value for - %1$s
endif

Also, refer to the thread -
Equivalent of Auto zoom in Baan 5 (http://www.baanboard.com/baanboard/showthread.php?t=15204&highlight=zoom)

kevobr
28th September 2004, 12:31
I seem to remember there being a bug in tools in Baan 5C early on that stopped individual field zoom sections working, but worked in field.all section.
So try something like this:

field.all:
before.zoom:
if fattr.currfld$(1;14) = "casls404.itema" then
ret = switch.to.company(500)
attr.zoomcode = Z.SESSION
attr.zoomsession$ = "tcibd0501m000"
attr.zoomreturn$ = "tcibd001.item"
endif


If this works then you have same problem we had a couple of years ago. Can't remember if there was a known case for this or if it just rectified itself on our system.

monica1
28th September 2004, 12:56
Thank you very much. When I see the result of fattr.currfld$. I see my field's name was casls404.itema.segment.2.
I change the program and now works fine.


The definition of the automatic zoom is in ttgfd4122m000.

Thank you,