BaBernd
11th February 2016, 18:11
Hello to All,
I use the Dynamic Forms Editor (DFE) in the worktop to design a print session for a classic report.
In the DFE I've created a new mask with several fields as shown in the attached screenshots. Especially the fields country (Land) and postal code (Postleitzahl) are important. In the field country I'd like to select a country out of the country-session. Afterwards the zoomed session for the postal code should only show the codes for the preselected country.
How can I realize it in the DFE zoom-properties? Or do I have to create code in the Program script for this print session? And how should this code looks like (programming example)?
Thanks in Advance
Best Regards
Bernd
bhushanchanda
11th February 2016, 20:34
Hi,
Yes, you need to add the filtering in your script.
e.g. It I want to display items in tcibd0501m000 for item group "01" only, I can write -
field.item.f:
before.zoom:
tcibd001.citg = "010"
Or
You can use query extension in your selection.filter
e.g.
selection.filter:
query.extend.select("tcibd001.*")
query.extend.from("tcibd001")
query.extend.where.in.zoom("tcibd001.citg = " & "001")
BaBernd
12th February 2016, 10:32
Hi Bhushan,
thanks for quick help. I've tried it. And it works fine first. But then I recognized the following:
my field section looks like:
|********************* field section *********************
|*** Country *****
field.ccty.s:
before.display:
ccty.s = "DE" |Predefinition of the country field
|*** Postal Code *****
field.pstc.f:
when.field.changes:
pstc.t = pstc.f
before.zoom:
tccom136.ccty = ccty.s |Predefined country variable to Postal Code table
field.pstc.t:
before.zoom:
tccom136.ccty = ccty.s |Predefined country variable to Postal Code table
|*** City *****
field.cty.f:
when.field.changes:
cty.t = cty.f
before.zoom:
tccom130.ccty = ccty.s |Predefined country variable to address table
field.cty.t:
before.zoom:
tccom130.ccty = ccty.s |Predefined country variable to address table
During runtime, when I open the selection mask, and change the ccty.s variable from "DE" to "AT" (German/Austria) then the value was taken correctly to zoom into the postal code table.
It is the field right behind the country field (you can see it in the screenshots).
But when I try to zoom into the address table for the city field then there will be still taken "DE" as ccty.s and not the new value "AT".
In other words:
ccty.s = DE
tccom136.ccty = DE
tccom130.ccty = DE
but when changing to AT during runtime:
ccty.s = AT
tccom136.ccty = AT
tccom130.ccty = DE
Have I missed a definition?
Best Regards
Bernd
bhushanchanda
12th February 2016, 11:15
Hi,
You can try this -
field.cty.f:
when.field.changes:
cty.t = cty.f
before.zoom:
query.extend.where.in.zoom("tccom130.ccty=""ed.string(ccty.s))
field.cty.t:
before.zoom:
query.extend.where.in.zoom("tccom130.ccty=""ed.string(ccty.s))
BaBernd
12th February 2016, 18:40
Hi Bhushan,
I've misinterpreted this error/problem.
the value for tccom130.ccty during runtime was also ="AT".
The problem is the "zoom to" session in the field property. I zoomed to session "tccom4530m000". But within this session the field tccom130.ccty is not changeable (it is fixed with a chain-symbol in the form editor). So I believe that's the reason why I can't change the tccom130.ccty for that session from "DE" to "AT" or another value.
Now I use the session tccom4539m000 (city by country) as zoom to session.
Thanks a lot again for additional research.
Best Regards
Bernd
bhushanchanda
13th February 2016, 03:04
Hi,
There will be a problem when you use before.zoom for non-index fields. Hence, in those cases, you need to go with selection filter as shown above.