Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Poll
When will you move your ERP to the cloud?
We are on the cloud already!
30%
Next year
0%
from 2-3 years
7%
from 4-5 years
23%
Never!
40%
Total votes: 30

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 27th August 2002, 06:12
Ruskin's Avatar
Ruskin Ruskin is offline
Unconfirmed User
 
Join Date: Feb 2002
Location: New Zealand
Posts: 91
Ruskin is on a distinguished road
Baan: All - DB: MS-SQL, Informix, Oracle - OS: UNIX and NT Server
synchronizing different occurrences on parent session from child

Hmmm..... I have come across something strange, using choice sections, in a session that has a synchronized dialog and was wondering if any one else had encountered the same problem and what they did to resolve it...

In the before.program section, there is a statement similar to;
set.synchronized.dialog("ppmmmxxxxs000")

Thus, when an occurrence is double-clicked (to modify), or is duplicated, or inserted, this sub session is started. The occurrence on the main session, is then updated when the sub session values are inserted, or modified (as the main session is now synchronized with the occurrence being edited in the sub session).

I have done the following;

choice.modify.set:
before.choice:
message("START MODIFY")

and I get a "START MODIFY" message when I double click an occurrence. However, if I add;

after.choice:
message("END MODIFY")

I do not get the message "END MODIFY". Putting in Debug, also shows, that the after.choice sub section is not run. This is causing an issue, as the sub session that is activated, updates other records in the code (based on values entered in this sub session). When the sub session is closed, the other occurrences in the main session, do not reflect the changes made in the sub session. The after.choice section does not seem to be running, so I can't perform an execute(find.data) or some other refresh. The only work around I have found, is when the sub session closes a message is displayed to the user telling them to push F5 to refresh the main session.

Is there a way to capture that the synchronized dialog session has been started and closed, from the main session? Alternatively, is there a way to refresh all occurrences on the main session, from the sub session?
Reply With Quote
  #2  
Old 27th August 2002, 09:58
jaapzwaan's Avatar
jaapzwaan jaapzwaan is offline
Member
 
Join Date: Jul 2002
Location: Amersfoort, NL
Posts: 98
jaapzwaan is on a distinguished road
Baan: None - DB: None - OS: Win XP
refresh.parent(-1)

Please try calling the function refresh.parent(-1). I know it is not in the manual, but that's an error in the manual , not because it is unsupported.
The omission in the manual has been logged and will be corrected in the next version.

Regards,
Jaap
Reply With Quote
  #3  
Old 27th August 2002, 10:09
rupertb's Avatar
rupertb rupertb is offline
Senior Member
 
Join Date: Jun 2002
Location: Port Elizabeth, South Africa
Posts: 192
rupertb is on a distinguished road
Baan: T2.2, BIVb2, BIVc4 - DB: INFORMIX - OS: AIX WIN2000
I've tried this logic - with no joy at all I think the modify.set option is expecting an event like save or save&exit or <esc> before it'll jump from the before.choice to after.choice section - can you not use the standard field zooming and then execute the refresh code in the after.zoom portion of the field.all section?

Happy zooming,
Rupert
Reply With Quote
Sponsored Links
  #4  
Old 27th August 2002, 11:33
jaapzwaan's Avatar
jaapzwaan jaapzwaan is offline
Member
 
Join Date: Jul 2002
Location: Amersfoort, NL
Posts: 98
jaapzwaan is on a distinguished road
Baan: None - DB: None - OS: Win XP
refresh.parent(1)

You should use the function refresh.parent(1) in the synchronized dialog , not in the parent itself (hence its name).
This function causes the parent to reread the data and get latest information from the child.

Regards,
Jaap
Reply With Quote
  #5  
Old 27th August 2002, 23:26
Ruskin's Avatar
Ruskin Ruskin is offline
Unconfirmed User
 
Join Date: Feb 2002
Location: New Zealand
Posts: 91
Ruskin is on a distinguished road
Baan: All - DB: MS-SQL, Informix, Oracle - OS: UNIX and NT Server
thanks....

Thanks Jaap,

I used the refresh.parent(-1) option and it work perfectly (refreshed all occurences on the parent). Just a quick question, but since this is not documented, do you know the parameters that can be passed. The reason I ask, is that refresh.parent(1) did not work, but passing -1 did, but caused the occurrences on the parent, to scroll up to the occurrence selected (if that makes sense).


regards...
Ruskin
Reply With Quote
  #6  
Old 29th August 2002, 14:30
jaapzwaan's Avatar
jaapzwaan jaapzwaan is offline
Member
 
Join Date: Jul 2002
Location: Amersfoort, NL
Posts: 98
jaapzwaan is on a distinguished road
Baan: None - DB: None - OS: Win XP
arguments

The function refresh.parent requires only one argument (type long). This is the occurrence number of the child that should be send to the parent.
In normal circumstances, this is a 1 because the synchronized dialog normally is a single occurrence view.
If (for whatever reason) the synchronized child is a multi-occ, you can specify the occurrence of the changed object. This way you can update the parent with data of the child that has not yet been written to the database.
A -1 causes a simple reread of the database in the parent process.

Regards,
Jaap
Reply With Quote
  #7  
Old 18th March 2008, 09:43
kiran kumar kiran kumar is offline
Member
 
Join Date: Dec 2007
Location: Bangalore
Posts: 64
kiran kumar is on a distinguished road
Baan: ERP LN (Gemini) - DB: DB2 - OS: AIX
hi i am kiran

can any body give me idea or send me sample code to how to add two forms in single session like( purchse order lines or sales order lines with header n detail)?

bi
__________________
KIRAN KUMAR kiran.kolluri82@gmail.com
Reply With Quote
  #8  
Old 18th March 2008, 15:33
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,798
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Look at help on sattr.combined and switch.to.process(). Below are snippets of code that I use. I did not post all the code, because the only time I did this I really had to reverse how baan does it. Baan usually has like the lower single occurance session being the parent and the upper session being a multi-occurance session. But the below should give you an idea and the Baan help should explain further.
Code:
| Parent Session
before.program:
	sattr.combined = COMBINED.TOP
|****************************** ZOOM FROM   SECTION ***************************
|****************************** FORM	     SECTION **************************
form.1:
init.form:
	get.screen.defaults()
	disable.resize()
before.form:
	process.udi9510 = activate("tiudi9510s002")
	switch.to.process(process.udi9510)
	
|****************************** CHOICE      SECTION ***************************
choice.end.program:
before.choice:
	kill.subprocesses()

choice.abort.program:
before.choice:
	kill.subprocesses()

choice.find.data:
before.choice:
	hold.osta = tisfc001.osta
	
after.choice:
	export("instruction",instruction)
	status.off()
	switch.to.process(process.udi9510, SWITCH.SAME.SIZE)
	status.on()


|From child session
before.program:
	disable.resize()
	|get.screen.defaults()
	sattr.combined = COMBINED.BOTTOM
	fattr.toplines = 1
	wait.for.switch()

form.1:
init.form:
	slash = "/"
	if background then
	while true
		import("tisfc001.pdno",tisfc010.pdno)
		tisfc010.opno = 0
		inputfield.invisible("tisfc010.pdno")
		import("instruction", instruction)
		on case	instruction
		case find.data:
			execute(find.data)
			break
		case last.set:
			execute(last.set)
			break
		case first.set:
			execute(first.set)
			break
			break
		case next.set:
			execute(next.set)
			break
		case prev.set:
			execute(prev.set)
			break
		case resize.frm:
			execute(resize.frm)
			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
__________________
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.
Reply With Quote
  #9  
Old 18th March 2008, 18:56
MilindV's Avatar
MilindV MilindV is offline
Senior Member
 
Join Date: Feb 2008
Location: Hyderabad, India
Posts: 107
MilindV is on a distinguished road
Baan: LN, BaaN-IVc4, BaaN-Vc - DB: SQL Server - OS: Windows, Unix
Exclamation Multi main table.

I dont know whether i undestand ur problem exactly. But According to me. solution to ur problem is session of type multi-main table. But This type is available in LN only(I think). in this type of session there is one main session and others are sub-sessions of that session called as satellite sessions.
I hope this is the ans to ur question.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to delete child table if the parent table has only 1 index with 3 fields? juhiasg Tools Development 4 12th February 2004 05:51
Parent - Child Relationship Agreements in CMS ramakrish Distribution, Transportation & Warehousing 0 28th June 2003 13:43
parent session code (without parent source) mbdagla Tools Development 2 11th October 2002 10:25


All times are GMT +2. The time now is 00:52.


©2001-2017 - Baanboard.com - Baanforums.com