Skip to main content

updateDefinition

Updates subforms (nested forms) in a definition. This function iterates through the whole definition to find occurrences of the supplied subform. Subforms are matched using their reference. So you can only update subforms that have a reference set. When a subform is found in the definition, that form, together with the name of the subform and the (new) version number are updated in the definition.

tip

You can run this function at server-side using Node.js.

Signature

updateDefinition(
definition: IDefinition,
nestedDefinition: INestedDefinition,
allowDeepUpdates?: boolean,
version?: string
): number

Parameters

NameTypeOptionalDescription
definitionIDefinitionNoSpecifies the definition to update.
nestedDefinitionINestedDefinitionNoSpecifies the new version of the subform to update.
allowDeepUpdatesbooleanYesSpecifies if subforms that are located in other subforms (that have a reference set) should be updated (default is false).
versionstringYesSpecifies the version of the nested definition that should be updated. When omitted all versions of the nested definition are updated (which is the default behavior).

Return value

Returns the number of updated subforms in the definition or 0 when nothing was updated.