How to make the parent doc to be refreshed or in edit mode?

Hi,I have notes parent document with one or many response documents in the embedded view of parent doc. there is total amount computed field on parent doc which is the calculated total amount of one or many its response docs.

When I open open one response doc and change its amount, I want to total amount on its parent doc updated accordingly when the response doc closed(at this time,its parent doc is still open in uidoc),

The total amount field on parent is calculated if I press F9 key which is doing the refresh, but I can not let always to press F9 key to refresh. I have to build function to work as when response doc closed, its parent doc automatically refreshed and the Total amound getting updated.

Anybody know how to do it?

Thanks a lot in advance.

Subject: How to make the parent doc to be refreshed or in edit mode?

Hi Peter,

if your problem is still unsolved, try this code in the total amount field:

key := DocID;

totaldoc := 0;

var := @DbLookup( “” : “NoCache” ; “” ; “(ItemsCreated)” ; key ; “Number” ; [FailSilent]);

@For(n := 1;n <= @Elements(var);

n := n + 1;

totaldoc := totaldoc+ var[n]);

totaldoc

Subject: How to make the parent doc to be refreshed or in edit mode?

You are looking for NotesUIDocument.Refresh.

Subject: RE: How to make the parent doc to be refreshed or in edit mode?

Not really,When response doc as closing that mement, its parent doc is not current uidoc yet.

So basically, I am looking for when response is closing, and the same time, its parent doc(not uidoc yet) is refreshing.

The problem is that refresh is only happeneding on uidoc, and parent is not uidoc yet.

Any ideas? Thanks

Subject: RE: How to make the parent doc to be refreshed or in edit mode?

You can always make it an uidoc by using NotesUIWorkspace.EditDocument/OpenDocument.