We help IT Professionals succeed at work.

Domino R5 Parent Form needs a field which calculates total from field in each in each child response

a98pelle-expert
on
I have a Parent form in Domino R5 and it uses the web. Users create projects and the response is used for entering server requirements.    

I have NumberServers field in child response document.  I need a field in the Parent form to Calculate Total number of Servers from all responses.    I want to show a field at the parent level that can add it.  

Or can this be shown in a view somehow?  I have been grappling with this.

Comment
Watch Question

Author

Commented:
Only one response level under the parent.
Sjef BosmanGroupware Consultant
CERTIFIED EXPERT

Commented:
Make a view of the responses only, no response hierarchy, the first column should be sorted by the key of the parent (must also be present in the response document), and put the number of servers in a column.

In the parent form, you can create a computed-for-display field with a formula like

list:= @DbLookup("":"NoCache"; ""; "TheNewView"; parentkey; "NumberServers");
tot:= @Sum(list);
@if(@IsError(list); 0; @IsError(tot); "Non-numeric NumberServers!"; tot)

Author

Commented:
Thanks I will give this a try and let you know this morning if I get it working.

Author

Commented:
Is the parent key, the document ID of the parent which is passed down to the response?
Groupware Consultant
CERTIFIED EXPERT
Commented:
That's for you to decide. Normally, it is a data field present in both documents, unique for the parent but shared for the response. If there is no such field, then Notes provides you with one: the parent has @DocumentUniqueID and the response has the field $Ref.

The view with the response documents could therefore have a first column with formula
@Text($Ref)

The lookup would then be
list:= @DbLookup("":"NoCache"; ""; "TheNewView"; @Text(@DocumentUniqueI); "NumberServers");
tot:= @Sum(list);
@if(@IsError(list); 0; @IsError(tot); "Non-numeric NumberServers!"; tot)

Or something similar to that.

Author

Commented:
Thank you. I really appreciate your help.  

Explore More ContentExplore courses, solutions, and other research materials related to this topic.