@DocChildren (Formula Language)

In a column or window title formula, returns the number of child documents or categories belonging to the current document or category. Only immediate responses count as children. For example, the responses to a main document are its children, but the responses to a response document are not.

Syntax

@DocChildren @DocChildren( defaultString ) @DocChildren( zero-string ; defaultString ) @DocChildren( zero-string ; one-string ; defaultString )

Parameters

defaultString

Text. Optional. The text to return. If a "%" is used in the string, it will be replaced with the number of children documents or categories. Example: "% Responses."

zero-string

Text. Optional. The text to return if the document or category has no children, such as "No Responses."

one-string

Text. Optional. The text to return if the document or category has just one child, such as "One Response."

Return value

The return value depends on how you call @DocChildren:

numChildren

Special text. If @DocChildren is called with no parameters, then the number of child documents belonging to the current document or category is returned. You cannot convert special text to a number.

childString

Special text. If @DocChildren is called with one or more parameters, it returns the appropriate string, based on the number of child documents belonging to the current document or category. You cannot convert special text to a number.

Usage

Use @DocChildren in window title and column formulas, when you want to indicate how many top-level responses a particular document has, or how many main documents are within a particular category. This function does not work in any other formula.

This @function is calculated when the document is opened. Results are undefined in cases where the document is not opened, such as printing from a view.

You cannot use this function in Web applications, except in column formulas.

Examples

  1. This example returns 3.
     @DocChildren
  2. This example returns 3 Responses. Domino® substitutes the appropriate number for %. If the document doesn't have any responses, this formula returns 0 Responses.
    @DocChildren("% Responses")
  3. This example returns 3 Responses. This time, if the document doesn't have any responses, the formula returns the message No Responses.
    @DocChildren("No Responses";"% Responses")
  4. This example returns There are 3 Responses. If the document has one response, the message is 1 Response; if the document has no responses, the message is No Responses.
    @DocChildren("No Responses";"1 Response";
    "There are % Responses.")