assassinator
29th December 2011, 14:51
Combine two forms in one, but when I choice next.set, next.view or others options didn't work. The bottom form which is multi-occ would take effect. But the top form can not sync.
I copied tdsls4102 and tdsls4503's form and made over into what I want tables and fields. Is this cause errors?
I wrote choice.first.set, choice.next.set etc in bottom form like these:
choice.find.data:
after.choice:
instruction = find.data
sync.sub()
choice.first.set:
after.choice:
instruction = first.set
sync.sub()
......
choice.last.view:
after.choice:
instruction = last.view
execute(first.set)
sync.sub()And wrote these in the top form:
before.program:
sattr.combined = COMBINED.TOP
sattr.slave = true
fattr.scrollbar = true
fattr.toplines = 0
wait.for.switch()
|*********** FORM SECTION **************
form.1:
init.form:
while TRUE
import("tivxw099.runn", tivxw100.runn)
import("instruction", instruction)
if instruction > 0 then
execute(instruction)
endif
switch.to.process(parent)
endwhile
Hitesh Shah
29th December 2011, 17:04
In SLS interactive order line session bottom one is single occ and top one is multi-occ . In your case it's different .
Such a case also can/may work but interactive program sessions may need to be different additional programming keeping in view the functionality u have planned for in the interactive session.
mark_h
29th December 2011, 23:52
This can be brutal. Not just so easy to switch the way a session like these work. All kinds of coding you have to do and I do not recommend it. If possible use a mainsession for the header and a button to call a subsession. Again, from my experience, I do not recommend this. Maybe I did something wrong, but it was anything but easy. The baan method of making the top a multi-occurence session has to be easier.
Again, I have done this once from scratch and it was not easy. I am still not positive I got all the kinks in it out. In my case the bottom session was multi-occurence, the top session was the single occurence header. The bottom session was the controlling session and even worse - it had multiple forms. I also turned off resizing the forms - boy did it get ugly if I left that on. I also had to maintain header text in this session. So you start tdexi0110m000(lines) and it used tdexi0109m000(header). You last chance to run away. :)
bottom session code tdexi0110m000:
before.program:
sattr.combined = COMBINED.BOTTOM
process.exi0109 = 0
form.1:
init.form:
max_window()
if process.exi0109 = 0 then
hold.rfq = tdexi010.rfqnum
instruction = find.data
switch.to.child.process()
endif
display.all()
before.form:
disable.resize()
form.2:
init.form:
hold.rfq = tdexi010.rfqnum
export("hold.rfq", hold.rfq)
instruction = find.data
switch.to.process(process.exi0109,SWITCH.SAME.SIZE + SWITCH.WITHOUT.INTERACTION)
display.all()
before.form:
disable.resize()
|Just one of the view item functions which would get the next header.
|You have to program all the view sections including find etc.
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)
function:
function switch.to.child.process()
{
export("instruction",instruction)
status.off()
process.exi0109 = activate("tdexi0109m000")
status.on()
switch.to.process(process.exi0109,SWITCH.SAME.SIZE + SWITCH.WITHOUT.INTERACTION)
}
Now for the single occurence session(tdexi0109m000):
efore.program:
sattr.combined = COMBINED.TOP
wait.for.switch()
|****************************** ZOOM FROM SECTION ***************************
|****************************** FORM SECTION **************************
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
The choice.user sections zoomed to other subsessions.
mark_h
29th December 2011, 23:55
I hope you have better luck that I did. I did not include all the different pieces of code I had to use to maintain the data for these sessions.