shellybabber
17th March 2010, 08:58
Hi All,

I am facing problem with before.zoom.I dont know how to use it.I want to zoom session tsmdm1541m000 and want to return employee code but there is no employee field in table.
I want run my session like,if user selects Service Center in the service center field,the service engineer fileld should only show engineer linked to that service center.Please help.Many thanks in advance.

Regrds
Shelly

king1980
17th March 2010, 09:20
Hi,

You need to create a new session to display the service engineer with service center.
And in this session write extension query in before program section to filter the diplay as per service center.

Regards
king1980

mark_h
17th March 2010, 13:48
king is correct. I actually find it easier sometimes to generate my own zoom sub-sessions versus using a standard session. Of course I am assuming baan 5 works the way I use baan 4. As king mentioned I would generate a subsession on the table that has the information you want to zoom to. Then from the calling session you can set a zoom filter - then when the subsession comes up in something like the zoom sections you can set the table filter so the user only sees those records. The reason I like the before zoom sections is it allows you to use the session a couple of different ways - without zoom, the session starts with no filter and can be used to browse through. Then when you zoom to the session you can set a filter.

zoom.from.all:
on.entry:
import("zoom.rfq",zoom.rfq)
tdexi020.rfqnum = zoom.rfq
execute(find.data)

In reality you can do the same with the before program - below is some sample code where I build a query extension in a subroutine.

before.program:
if background then
import("item.filter",item.filter)
import("buyer.filter",buyer.filter)
import("suno.filter",suno.filter)
import("quote.filter",quote.filter)
import("date.filter",date.filter)
import("rfq.filter",rfq.filter)
build.qry.ext()
else
buyer.filter = 0
item.filter = ""
suno.filter = ""
date.filter = 0
rfq.filter = 0
quote.filter = empty
query.extension = "tdexi060.rfqnum > 0 "
endif

function build.qry.ext()
{
query.extension = ""
if rfq.filter <> 0 then
query.extension = "tdexi060.rfqnum = " & str$(rfq.filter)
endif
if not isspace(item.filter) then
query.extension = isspace(query.extension)?" ": query.extension & " and "
query.extension = query.extension & "tdexi060.item = " & chr$(34) & item.filter & chr$(34)
endif
if not isspace(suno.filter) then
query.extension = isspace(query.extension)?" ": query.extension & " and "
query.extension = query.extension & "tdexi060.suno = " & chr$(34) & suno.filter & chr$(34)
endif
if date.filter > 0 then
query.extension = isspace(query.extension)?" ": query.extension & " and "
query.extension = query.extension & "tdexi060.rtndte = " & str$(date.filter)
endif
if etol(quote.filter)>0 then
query.extension = isspace(query.extension)?" ": query.extension & " and "
query.extension = query.extension & "tdexi060.quotstat = " & str$(quote.filter)
endif
}


Just thought I would toss out some samples and then you can search on query.extension, zoom.from, etc. and you will probably find more examples and more answers.

wiggum
18th March 2010, 12:30
I don't have access to Baan 5 code at the moment but looking into LN code i think that you can restrict the selection to a specified service center if you create an external field named "service.center" in your script an fill it in before.zoom.

If this will not work try to rename the external field to "mdm.service.center" as this is used in current LN code.