Skip to main content
Version: 11.2

$.udb(ds).hasChild()

note

This article is about the hasChild() function of the DataSourceContainer object.

$.udb(ds).hasChild()

Detects whether a given data source is a direct child data source in the current scope, or a descendant data source at any level.

Returns a boolean.

Syntax

$.udb( *ds* ).hasChild( *data-source*, [recursive] )

*recursive* ::= { true | [false] }

The required ds is a data source selector.

The required data-source identifies the data source to search for. Use data source path syntax to refer to data sources.

If the optional recursive is set to false (the default), the search is for direct children only. If recursive is true, the search is for children at any descendant level, for example, grandchildren.

Example

if ($.udb('COMP').hasChild('DEPT')) {
$.udb('COMP').forEach((ds) => {
//...
});
}