JSRelationItem

Constants Summarized

TypeNameSummary

Constant for using literals in solution model in relations.

Properties Summarized

TypeNameSummary

The name of the column from the destination table that this relation item is based on.

The operator that defines the relationship between the primary dataprovider and the foreign column.

The name of the column from the source table that this relation item is based on.

Get the literal.

Methods Summarized

TypeNameSummary

Returns the comment of this component.

Returns the UUID of this component.

Constants Detailed

LITERAL_PREFIX

Constant for using literals in solution model in relations. Strings must be passed as quoted value to make a distinction between string '5' and number 5.

Type String

Sample

relation.newRelationItem(JSRelationItem.LITERAL_PREFIX + "'hello'",'=', 'mytextfield');

Properties Detailed

foreignColumnName

The name of the column from the destination table that this relation item is based on.

Type String

Sample

var relation = solutionModel.newRelation('parentToChild', 'db:/example_data/parent_table', 'db:/example_data/child_table', JSRelation.INNER_JOIN);
var criteria = relation.newRelationItem('parent_table_id', '=', 'child_table_parent_id');
criteria.primaryDataProviderID = 'parent_table_text';
criteria.foreignColumnName = 'child_table_text';
criteria.operator = '<';

operator

The operator that defines the relationship between the primary dataprovider and the foreign column. Each key pair expression is evaluated using a single operator. Certain operators are only applicable to certain data types. Below is a list of all available operators and the data types for which they are applicable.

OperatorDescriptionData Types

=

Equals

Text, Integer, Number, Datetime, UUID, Array (in)

>

Greater Than

Text, Integer, Number, Datetime

<

Less Than

Text, Integer, Number, Datetime

>=

Greater Than or Equal To

Text, Integer, Number, Datetime

<=

Less Than or Equal To

Text, Integer, Number, Datetime

!=

NOT Equal To

Text, Integer, Number, Datetime, UUID, Array (not in)

like

SQL Like use with '%' wildcards

Text

not like

SQL Not Like use with '%' wildcards

Text

Type String

Sample

var relation = solutionModel.newRelation('parentToChild', 'db:/example_data/parent_table', 'db:/example_data/child_table', JSRelation.INNER_JOIN);
var criteria = relation.newRelationItem('parent_table_id', '=', 'child_table_parent_id');
criteria.primaryDataProviderID = 'parent_table_text';
criteria.foreignColumnName = 'child_table_text';
criteria.operator = '<';

primaryDataProviderID

The name of the column from the source table that this relation item is based on.

Type String

Sample

var relation = solutionModel.newRelation('parentToChild', 'db:/example_data/parent_table', 'db:/example_data/child_table', JSRelation.INNER_JOIN);
var criteria = relation.newRelationItem('parent_table_id', '=', 'child_table_parent_id');
criteria.primaryDataProviderID = 'parent_table_text';
criteria.foreignColumnName = 'child_table_text';
criteria.operator = '<';

primaryLiteral

Get the literal.

Type Object

Sample

var relation = solutionModel.newRelation('parentToChild', 'db:/example_data/parent_table', 'db:/example_data/child_table', JSRelation.INNER_JOIN);
var criteria = relation.newRelationItem(JSRelationItem.LITERAL_PREFIX + "'hello'",'=', 'myTextField');
criteria.primaryLiteral = 'literal_text';
//criteria.primaryLiteral = number;
var primaryLiteral = criteria.primaryLiteral;

Methods Detailed

getComment()

Returns the comment of this component.

Returns: String

Sample

var comment = solutionModel.getForm("my_form").getButton("my_button").getComment();
application.output(comment);

getUUID()

Returns the UUID of this component.

Returns: UUID

Sample

var button_uuid = solutionModel.getForm("my_form").getButton("my_button").getUUID();
application.output(button_uuid.toString());

Last updated