Skip to main content
Version: 11.2

Cols.getForeignKey()

note

This article is about the getForeignKey() function of the Cols object.

Cols.getForeignKey()​

Gets column references to the foreign key(s) that the first column in scope refers to, if that column is of a lookup data source.

Returns a Cols object.

Syntax​

$.udb( *ds* ).cols( [columns] ).getForeignKey()

The required ds parameter is a data source selector.

The optional columns is a column selector. If omitted, all columns in scope are selected.

Example​

if ($.udb(dsId).isLookup()) {
let isMandatory = $.udb(dsId).cols(column).getForeignKey()[0].isMandatory();
}