jholdrid
13th November 2002, 19:47
I have a form with a Rework Source Code XX. I would like to zoom to a list of Main Cause Codes and only see a simple list of those codes related to the Source.
When I zoom to the Display of Main Cause Codes, I see multiples of the allowable valid main cause code selections because there are multiple allowable detail cause code selections associated with each. I see the following:
Main Cause 1 Detail 1
Main Cause 1 Detail 2
Main Cause 1 Detail 3
Main Cause 1 Detail 4
Main Cause 2 Detail 1
I would like to see only
Main Cause 1
Main Cause 2
Main Cause 3
Is there any way that I can see only the simple list of related main cause codes.
Thank you for your help.
jholdrid
14th November 2002, 18:03
Thanks for any coding help !
I have a Main table tcqms905, QMS Code Structure, in my zoomed to display session:
Tcqms905.srce - source
Tcqms905.dept - Department
Tcqms905.sdept Sub-Department
Tcqms905.mcsc Main Cause Code
Tcqms905.dcsc Detail Cause Code
My script is:
| ****Variables
extern domain tcstr.12 zoom.srce
extern domain tcstr.12 zoom.dept
extern domain tcstr.12 zoom.sdept
extern domain tcstr.12 zoom.mcsc
|*****Script
zoom.from.all:
on.entry:
import(zoom.srce, tcqms905.srce)
import(zoom.dept,tcqms905.dept)
import(zoom.sdept,tcqms905.sdept)
after.program:
zoom.mcsc = tcqms905,mcsc
export(zoom.mcsc, tcqms905.mcsc)
------------------------------------------------------------------------------
I display a heading with the imported variables from the main session:
Source 0010 Department 0030 Sub-department 0040
0010 Part Number
0010 Part Number
0010 Part Number
0040 Hardware
0040 Hardware
0040 Hardware
0060 Finish
The list is correct for the "Source", "Department", and "Sub-department" combination (there is an entry for each cross referenced "Detail Cause Code") but
I would like to only see:
0010 Part Number
0020 Hardware
0030 Finish
I would like the user to individually select the "detail Cause code"
from another display.
What do I need to change in my script to accomplish this?
Thanks
mark_h
14th November 2002, 19:25
What I did in one of my zoom sub-sessions was to use skip.io in the maintable section.
|****************************** MAIN TABLE SECTION ***************************
main.table.io:
after.read:
if(tdilc501.orno = old.orno) then
skip.io("")
else
old.orno = tdilc501.orno
endif
So in your case you could check both of your fields.
Mark
baanprog
14th November 2002, 19:35
Obviously in BaanIVc4 query.extend functions will NOT work,we can use the pre-defined variable query.extension or skip records in main.table.io sections.
I dont have access to Baan, so i suggest you can try the following:
I dont know the index of your table, so from what you have written I have to assume that you want to display only one Detail cause code for one Main cause code.(if both Main and Detail cause codes are part of the index, then we have a unique record identifier)
You should import all variables required in the before.program section.
Also declare a variable in the Main session(Zoom From) and import it into
Sub session(Zoom To) to allow these actions only when zoomed to this session from the main session.
Say extern domain tcbool special.zoom and based on that you have to fire these actions below .
In the main.table.io section and function section do the following:
main.table.io:
after.read:
if special.zoom then
on.main.table(filter.records.based.on.detail.cause.code())
if tcqms905.dcsc = hold.dcsc then |declare hold.dcsc in declaration section
skip.io("")
endif
endif
functions:
function filter.records.based.on.detail.cause.code()
{
select tcqms905.*
from tcqms905
where tcqms905.mcsc = : tcqms905.mcsc
order by tcqms905.mcsc
as set with 1 rows
selectdo
hold.dcsc = tcqms905.dcsc
endselect
}
By doing this, for one Main cause code , you will display only one Detail cause code and ignore others, assuming that is want you want to do.
if you need anymore help, start a conversation here, we can post and repost.
Regards
jholdrid
15th November 2002, 18:38
The " skip.io("") " functionality worked.
Thank you for your help !!
:)