ravi99
29th September 2012, 16:49
Hi,
I have a following requirement:
I have a custom table. I want to create a display session which should show header data (unit set, warehouse on half of the form) and when clicked on each header record it should all the line records in below half of the screen. How to do it? Is there any standard Baan session which does this, please let me know.
Thanks
Venkat
mark_h
1st October 2012, 14:31
Yes - this can be done, not something I recommend, but it is possible. You can search on things like sattr.combined = COMBINED.BOTTOM(combined.top), switch.to.process or synchronized sessions. As far as I know baan does not do this - and I do not blame them. What you do is create the lines session as the driving session - then you have to code all of the options in both of the sessions on what should take place - switching between the two sessions. You have to control all of this while switching sessions - it can be done, but not always very easily. At least with a display session you need less commands than the one I had to do - mine was a maintain session where they could insert headers and lines.
Example code from header session(combined.top)
form.1:
init.form:
|disable.resize()
if background then
while true
|import("tisfc001.pdno",tisfc010.pdno)
import("instruction", instruction)
import("hold.rfq",hold.rfq)
import("hold.rfqline",hold.rfqline)
tdexi001.rfqnum = hold.rfq
on case instruction
case find.data:
case last.set:
case first.set:
case next.set:
case prev.set:
case mark.delete:
| execute(prev.set)
execute(find.data)
if (instruction = prev.set or instruction = last.set)
and tdexi001.status <> tdexi.stat.new then
select tdexi001.rfqnum
where tdexi001.rfqnum<:tdexi001.rfqnum
and tdexi001.status = tdexi.stat.new
order by tdexi001.rfqnum desc
as set with 1 rows
selectdo
endselect
execute(find.data)
endif
if instruction = first.set
and tdexi001.status <> tdexi.stat.new then
select tdexi001.rfqnum
where tdexi001.rfqnum>:tdexi001.rfqnum
and tdexi001.status = tdexi.stat.new
order by tdexi001.rfqnum
as set with 1 rows
selectdo
endselect
execute(find.data)
endif
hold.rfq = tdexi001.rfqnum
export("hold.rfq",hold.rfq)
break
case resize.frm:
execute(resize.frm)
break
case start.set:
input.error = false
get.rfq.number()
while appl.set("tdexi001 " & str$(rfq.num), APPL.EXCL) > 0
rfq.num = rfq.num +1
endwhile
execute(add.set)
execute(update.db)
|insert.line.zero()
hold.rfq = tdexi001.rfqnum
export("hold.rfq",hold.rfq)
export("input.error",input.error)
appl.delete("tdexi001 " & str$(rfq.num))
break
case modify.set:
execute(modify.set)
hold.rfq = tdexi001.rfqnum
export("hold.rfq",hold.rfq)
execute(update.db)
break
case user.1:
execute(user.1)
break
case user.2:
execute(user.2)
break
case user.4:
execute(user.4)
execute(find.data)
break
case user.5:
execute(user.5)
break
case recover.set:
execute(recover.set)
break
case 34:
| tisfc951.pdno = tisfc010.pdno
| ticst001.pdno = tisfc010.pdno
| import("zoom.prog", zoom.prog)
| zoom.to$(zoom.prog,z.session,"","",0)
break
default:
display.all()
endcase
switch.to.process(parent, SWITCH.SAME.SIZE)
endwhile
endif
Second sample calling code from lines session(combined.bottom)
choice.next.view:
after.choice:
hold.rfq = tdexi010.rfqnum
export("hold.rfq", hold.rfq)
instruction = next.set
switch.to.process(process.exi0109,SWITCH.SAME.SIZE + SWITCH.WITHOUT.INTERACTION)
import("hold.rfq", hold.rfq)
tdexi010.rfqnum = hold.rfq
get.header.text()
execute(find.data)
execute(first.set)
shah_bs
8th October 2012, 18:38
I agree with Mark - not recommended.
My suggestion would be to create a session with a type 3 form based on the detail table as the main-table. The required fields from header can then always be read and displayed in the space above what is occupied by the detail lines. Simplest example that can be used as a starting skeleton: Maintain Currency Rates.