shuzheng
15th December 2005, 04:16
:confused: :( hi:
lg: when I start a session B from a session A,and in session B , I have update the session A's data in database directly. then ,I want to refresh session A's data in view by trigger a event in session B or after session B is exit. How can I bring it to pass!
thanks everybody

v_chandra
15th December 2005, 05:44
Hi

Does your control goes back to Session A, if yes then may be you can use refresh(). Or even we have used execute(find.data) this will refresh current records in session A with the index key value available.

Note: if you have any code written in choice.find.data: then you will have to check that also.

Thanks & Regards

Youp2001
15th December 2005, 14:46
Hi,

If you want to have your session A updated before session B ends, you could try to use the bms functions. I used this for a little different situation (Session A is an overview session; B is the single occ. session (sessions are synchronized) and from B I started a session C that changed data for B and thus for A (in my case the original record was replaced by another record with different key in session C. In session B this record was displayed after C had ended and I wanted to have A in sync with B)).

This is what I did:

In session A:

before.program:
set.synchronized.dialog("tdalx3100s000")
bms.add.mask("mm.parent.refresh")
choice.bms:
before.choice:
event.bucket = bms.receive$()
string.scan(event.bucket,
"%s^%s^%s",
new.cwar,
new.sopi,
new.sopn)
read.new.record.after.transfer()
execute(find.data)
refresh()
after.choice:
synchronize.child.session()

function synchronize.child.session()
{
long event(EVTMAXSIZE)

evt.type(event) = EVTBUCKETMESSAGE
evt.bms.sender(event) = pid
bms.send("", event, "mm.child.refresh", 0)


In sessoin B:
before.program:
bms.add.mask("mm.child.refresh")

choice.bms:
before.choice:
event.bucket = bms.receive$()
execute(find.data)
enable.disable.fields()

In session B, just after session C is called (so executed after session C has ended):

e.message = concat$("^", tdalx300.cwar, tdalx300.sopi, tdalx300.sopn)
evt.type(event) = EVTBUCKETMESSAGE
evt.bms.sender(event) = pid
bms.send(e.message, event, "mm.parent.refresh", parent)

Hope this helps,

Youp

NPRao
16th December 2005, 02:32
Please use the search for already discussed topics -

synchronizing different occurrences on parent session from child (http://www.baanboard.com/baanboard/showthread.php?t=6419&highlight=refresh.parent)

Synchronize parent (http://www.baanboard.com/baanboard/showthread.php?t=24920&highlight=refresh.parent)

Rita Kotecha
26th December 2005, 07:22
Hi

1. in Session - A

a. extern domain tcbool new.record.entered
b. function extern new.record()
{
new.record.entered = true
export("new.record.entered",new.record.entered)
execute(end.program)
}
function refresh.SesionB()
{
long event(EVTMAXSIZE)

evt.bms.command(event) = PRTCL
evt.bms.argument(event) = PRTCL.EXECUTE
bms.send("7",event, "", parent)
}
c. choice.end.program:
before.choice:
refresh.SesionB()


2. in Session B
a. extern domain tcbool new.record.entered
b. before.program:
new.record.entered = false
c. before.display.object:
suspend(3)
import("new.record.entered",new.record.entered)
if new.record.entered = true then
new.record.entered = false
execute(add.set)
endif


This is what we have used to insert a new record and refresh the details of the new record in the parent-display session.

Hope this helps.

shuzheng
30th December 2005, 04:53
happy new year,everybody!