View Single Post
  #15  
Old 20th December 2016, 13:59
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,125
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
So each session has the same 7 forms - so all the session point to the same forms. And yes some are type 1's and some are type 3's. So lets take form 5 - maintain items. Besides the normal session code for its table the parent session code is:
Code:
form.5:
before.form:
	chld.proc = wait.and.activate("tifix0101s00a")
	check.return.from.sessions()
	to.form(some.form)
functions:
function check.return.from.sessions()
{
	import("some.form",some.form)
	import("abrt.code",abrt.code)
	if abrt.code>0 then
		execute(end.program)
	endif
	import("zoom.cprj",ticpr951.cprj)
	import("zoom.item",ticpr951.item)
	import("zoom.mbcs",ticpr951.mbcs)
	ticpr951.item = zoom.item
	ticpr951.cprj = zoom.cprj
	ticpr951.mbcs = zoom.mbcs
	ticpr951.trdt = 0
	execute(find.data)
}

So now the subsession tifix0101s00a is activated.
Code:
form.1:
before.form:
	set.exit.variables()
	
init.form:
	to.form(5)

form.2:
before.form:
	set.exit.variables()
	
form.3:
before.form:
	set.exit.variables()
	
form.4:
before.form:
	set.exit.variables()
	
form.5:
init.form:
	max_window()
	import("ticpr951.item",ticpr951.item)
	import("ticpr951.cprj",ticpr951.cprj)
	import("ticpr951.mbcs",ticpr951.mbcs)
	tiitm001.item = ticpr951.item
	execute(find.data)

form.6:
before.form:
	set.exit.variables()
	
form.7:
before.form:
	set.exit.variables()
	
|****************************** field section *********************************
field.ticpr951.item:
before.display:
	get.all.totals()
|****************************** choice section ********************************	
choice.end.program:
before.choice:
	abrt.code = 1
	export("abrt.code",abrt.code)
	exit()
	
choice.abort.program:
before.choice:
	abrt.code = 2
	export("abrt.code",abrt.code)
	exit()
functions:
function set.exit.variables()
{
	abrt.code = 0
	some.form = form.curr
	export("some.form",some.form)
	export("abrt.code",abrt.code)
	zoom.item = ticpr951.item
	zoom.cprj = ticpr951.cprj
	zoom.mbcs = ticpr951.mbcs
	export("zoom.item",zoom.item)
	export("zoom.cprj",zoom.cprj)
	export("zoom.mbcs",zoom.mbcs)
	exit()
}

Now what I did not post is some of the code for the normal session use. Which was not a whole lot - I only allowed certain fields to be modified - mainly quantity fields.

library code -
Code:
function extern max_window()
{
	long My.Win
	My.Win = current.mwindow()
	change.object(My.Win,DsNx,0,DsNy,0)
	update.object(My.Win)
}
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.

Last edited by mark_h : 20th December 2016 at 14:26. Reason: Add library code
Reply With Quote