Child pages
  • JSRelation

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
{div:style=}
Wiki Markup
Div
styledisplay:none

DO

NOT

EDIT

THE

CONTENT

OF

THIS

PAGE

DIRECTLY

(EXCEPT

INSIDE

THE

DIV

BELOW

WITH

ID=DESCRIPTION),

UNLESS

YOU

KNOW

WHAT

YOU'RE

DOING.


THE

STRUCTURE

OF

THE

CONTENT

IS

VITAL

IN

BEING

ABLE

TO

AUTO

UPDATE

THE

CONTENT

THROUGH

THE

DOC

GENERATOR.

\\ \\ Enter additional information related to this



Enter additional information related to this 'class'

inside

the

\

{div}

macro

with

'id=description'

{div} {div:id=description}For more information see [Relations]{div}\\ {table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Constants Summary{th}{tr}{tbody}{tr}{td}[Number]{td}{td}[#FULL_JOIN] Constant for the joinType of a Query Builder join.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#INNER_JOIN] Constant for the joinType of a JSRelation.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#LEFT_OUTER_JOIN] Constant for the joinType of a JSRelation.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#RIGHT_OUTER_JOIN] Constant for the joinType of a Query Builder join.{td}{tr}{tbody}{table}\\ {table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Property Summary{th}{tr}{tbody}{tr}{td}[Boolean]{td}{td}[#allowCreationRelatedRecords] Flag that tells if related records can be created through this relation.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#allowParentDeleteWhenHavingRelatedRecords] Flag that tells if the parent record can be deleted while it has related records.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#deleteRelatedRecords] Flag that tells if related records should be deleted or not when a parent record is deleted.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#foreignDataSource] Qualified name of the foreign data source.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#initialSort] A String which specified a set of sort options for the initial sorting of data retrieved through this relation.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#joinType] The join type that is performed between the primary table and the foreign table.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#name] The name of the relation.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#primaryDataSource] Qualified name of the primary data source.{td}{tr}{tbody}{table}\\ {table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[JSRelationItem]\[]{td}{td}[#getRelationItems]\() Returns an array of JSRelationItem objects representing the relation criteria defined for this relation.{td}{tr}{tbody}{tbody}{tr}{td}[UUID]{td}{td}[#getUUID]\() Returns the UUID of the relation object{td}{tr}{tbody}{tbody}{tr}{td}[JSRelationItem]{td}{td}[#newRelationItem]\(dataprovider, operator, foreinColumnName) Creates a new relation item for this relation.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#removeRelationItem]\(primaryDataProviderID, operator, foreignColumnName) Removes the desired relation item from the specified relation.{td}{tr}{tbody}{table}\\ {table:id=constant|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Constants Details{th}{tr}{tbody:id=FULL_JOIN}{tr:id=name}{td}h6.FULL_JOIN{td}{tr}{tr:id=des}{td}{div:class=sIndent}Constant for the joinType of a Query Builder join.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Number]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}

Div
iddescription
For more information see Relations

HTML Table
id
classservoy sSummary
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Constants Summary
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#FULL_JOIN
Constant for the joinType of a Query Builder join.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#INNER_JOIN
Constant for the joinType of a JSRelation.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#LEFT_OUTER_JOIN
Constant for the joinType of a JSRelation.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#RIGHT_OUTER_JOIN
Constant for the joinType of a Query Builder join.

HTML Table
id
classservoy sSummary
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Property Summary
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#allowCreationRelatedRecords
Flag that tells if related records can be created through this relation.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#allowParentDeleteWhenHavingRelatedRecords
Flag that tells if the parent record can be deleted while it has related records.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#deleteRelatedRecords
Flag that tells if related records should be deleted or not when a parent record is deleted.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#foreignDataSource
Qualified name of the foreign data source.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#initialSort
A String which specified a set of sort options for the initial sorting of data
retrieved through this relation.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#joinType
The join type that is performed between the primary table and the foreign table.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#name
The name of the relation.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#primaryDataSource
Qualified name of the primary data source.

HTML Table
id
classservoy sSummary
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSRelationItem[]
Table Cell (td)
#getRelationItems()
Returns an array of JSRelationItem objects representing the relation criteria defined for this relation.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
UUID
Table Cell (td)
#getUUID()
Returns the UUID of the relation object
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSRelationItem
Table Cell (td)
#newRelationItem(dataprovider, operator, foreinColumnName)
Creates a new relation item for this relation.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#removeRelationItem(primaryDataProviderID, operator, foreignColumnName)
Removes the desired relation item from the specified relation.

HTML Table
idconstant
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Constants Details
Table Body (tbody)
idFULL_JOIN
Table Row (tr)
idname
Table Cell (td)
FULL_JOIN
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Constant for the joinType of a Query Builder join.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

/** @type {QBSelect<db:/example_data/orders>} */
	var query = databaseManager.createSelect('db:/example_data/orders')
 /** @type {QBJoin<db:/example_data/order_details>} */
	var join = query.joins.add('db:/example_data/order_details', JSRelation.RIGHT_OUTER_JOIN, 'odetail')
	join.on.add(join.columns.orderid.eq(query.columns.orderid))

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idINNER_JOIN
Table Row (tr)
idname
Table Cell (td)
INNER_JOIN
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Constant for the joinType of a JSRelation. It is also used in solutionModel.newRelation(...)

...

and

...

in

...

the

...

QueryBuilder.

...

Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var relation = solutionModel.newRelation('parentToChild', 'db:/example_data/parent_table', 'db:/example_data/child_table', JSRelation.INNER_JOIN);
relation.joinType = JSRelation.LEFT_OUTER_JOIN;

 /** @type {QBSelect<db:/example_data/orders>} */
	var query = databaseManager.createSelect('db:/example_data/orders')
 /** @type {QBJoin<db:/example_data/order_details>} */
	var join = query.joins.add('db:/example_data/order_details', JSRelation.INNER_JOIN, 'odetail')
	join.on.add(join.columns.orderid.eq(query.columns.orderid))

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idLEFT_OUTER_JOIN

...

Table Row (tr)

...

id

...

name

...

Table Cell (td)
LEFT_OUTER_JOIN

...

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Constant for the joinType of a JSRelation. It is also used in solutionModel.newRelation(...)

...

and

...

in

...

the

...

QueryBuilder.

...

Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var relation = solutionModel.newRelation('parentToChild', 'db:/example_data/parent_table', 'db:/example_data/child_table', JSRelation.INNER_JOIN);
relation.joinType = JSRelation.LEFT_OUTER_JOIN;

 /** @type {QBSelect<db:/example_data/orders>} */
	var query = databaseManager.createSelect('db:/example_data/orders')
 /** @type {QBJoin<db:/example_data/order_details>} */
	var join = query.joins.add('db:/example_data/order_details', JSRelation.INNER_JOIN, 'odetail')
	join.on.add(join.columns.orderid.eq(query.columns.orderid))

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idRIGHT_OUTER_JOIN

...

Table Row (tr)

...

id

...

name

...

Table Cell (td)
RIGHT_OUTER_JOIN

...

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Constant for the joinType of a Query Builder join.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

/** @type {QBSelect<db:/example_data/orders>} */
	var query = databaseManager.createSelect('db:/example_data/orders')
 /** @type {QBJoin<db:/example_data/order_details>} */
	var join = query.joins.add('db:/example_data/order_details', JSRelation.RIGHT_OUTER_JOIN, 'odetail')
	join.on.add(join.columns.orderid.eq(query.columns.orderid))

...

Table Row (tr)
classlastDetailRow
Table Cell (td)


HTML Table
idproperty
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Property Details
Table Body (tbody)
idallowCreationRelatedRecords
Table Row (tr)
idname
Table Cell (td)
allowCreationRelatedRecords
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

Flag that tells if related records can be created through this relation.

The default value of this flag is "false".

Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Boolean
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var relation = solutionModel.newRelation('parentToChild', 'db:/example_data/parent_table', 'db:/example_data/child_table', JSRelation.INNER_JOIN);
relation.allowCreationRelatedRecords = true;

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idallowParentDeleteWhenHavingRelatedRecords
Table Row (tr)
idname
Table Cell (td)
allowParentDeleteWhenHavingRelatedRecords
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

Flag that tells if the parent record can be deleted while it has related records.

The default value of this flag is "true".

Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Boolean
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var relation = solutionModel.newRelation('parentToChild', 'db:/example_data/parent_table', 'db:/example_data/child_table', JSRelation.INNER_JOIN);
relation.allowParentDeleteWhenHavingRelatedRecords = false;

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
iddeleteRelatedRecords
Table Row (tr)
idname
Table Cell (td)
deleteRelatedRecords
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

Flag that tells if related records should be deleted or not when a parent record is deleted.

The default value of this flag is "false".

Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Boolean
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var relation = solutionModel.newRelation('parentToChild', 'db:/example_data/parent_table', 'db:/example_data/child_table', JSRelation.INNER_JOIN);
relation.deleteRelatedRecords = true;

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idforeignDataSource
Table Row (tr)
idname
Table Cell (td)
foreignDataSource
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Qualified name of the foreign data source. Contains both the name of the foreign
server and the name of the foreign table.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var relation = solutionModel.newRelation('parentToChild', 'db:/example_data/parent_table', 'db:/example_data/child_table', JSRelation.INNER_JOIN);
relation.primaryDataSource = 'db:/user_data/another_parent_table';
relation.foreignDataSource = 'db:/user_data/another_child_table';

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idinitialSort
Table Row (tr)
idname
Table Cell (td)
initialSort
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

A String which specified a set of sort options for the initial sorting of data
retrieved through this relation.

Has the form "column_name asc, another_column_name desc, ...".

Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var relation = solutionModel.newRelation('parentToChild', 'db:/example_data/parent_table', 'db:/example_data/child_table', JSRelation.INNER_JOIN);
relation.initialSort = 'another_child_table_text asc';

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idjoinType
Table Row (tr)
idname
Table Cell (td)
joinType
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
The join type that is performed between the primary table and the foreign table.
Can be "inner join" or "left outer join".
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var relation = solutionModel.newRelation('parentToChild', 'db:/example_data/parent_table', 'db:/example_data/child_table', JSRelation.INNER_JOIN);
relation.joinType = JSRelation.LEFT_OUTER_JOIN;

 /** @type {QBSelect<db:/example_data/orders>} */
	var query = databaseManager.createSelect('db:/example_data/orders')
 /** @type {QBJoin<db:/example_data/order_details>} */
	var join = query.joins.add('db:/example_data/order_details', JSRelation.INNER_JOIN, 'odetail')
	join.on.add(join.columns.orderid.eq(query.columns.orderid))

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idname
Table Row (tr)
idname
Table Cell (td)
name
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
The name of the relation.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var relation = solutionModel.newRelation('parentToChild', 'db:/example_data/parent_table', 'db:/example_data/child_table', JSRelation.INNER_JOIN);
relation.name = 'anotherName';
var firstTab = tabs.newTab('firstTab', 'Child Form', childForm, relation);
firstTab.relationName = relation.name;

...

Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idprimaryDataSource
Table Row (tr)
idname
Table Cell (td)
primaryDataSource
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Qualified name of the primary data source. Contains both the name of the primary server
and the name of the primary table.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var relation = solutionModel.newRelation('parentToChild', 'db:/example_data/parent_table', 'db:/example_data/child_table', JSRelation.INNER_JOIN);
relation.primaryDataSource = 'db:/user_data/another_parent_table';
relation.foreignDataSource = 'db:/user_data/another_child_table';

...

Table Row (tr)
classlastDetailRow
Table Cell (td)


HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Method Details
Table Body (tbody)
idgetRelationItems
Table Row (tr)
idname
Table Cell (td)
getRelationItems
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
JSRelationItem[]
Span
stylefont-weight: bold;
getRelationItems
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns an array of JSRelationItem objects representing the relation criteria defined for this relation.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
JSRelationItem[] – An array of JSRelationItem instances representing the relation criteria of this relation.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var criteria = relation.getRelationItems();
for (var i=0; i<criteria.length; i++)
{
	var item = criteria[i];
	application.output('relation item no. ' + i);
	application.output('primary column: ' + item.primaryDataProviderID);
	application.output('operator: ' + item.operator);
	application.output('foreign column: ' + item.foreignColumnName);
} {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getUUID}{tr:id=name}{td}h6.getUUID{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[UUID]{span}{span:style=font-weight: bold;}getUUID{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Returns the UUID of the relation object{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[UUID]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}

}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetUUID
Table Row (tr)
idname
Table Cell (td)
getUUID
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
UUID
Span
stylefont-weight: bold;
getUUID
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns the UUID of the relation object
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
UUID
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var relation = solutionModel.newRelation('parentToChild', 'db:/example_data/parent_table', 'db:/example_data/child_table', JSRelation.INNER_JOIN);
application.output(relation.getUUID().toString())
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idnewRelationItem-String_String_String
}{
Table Row (tr)
:
id
=
name
}{td}h6.newRelationItem{td}{tr}{tr:id=sig}{td}{span:style=
Table Cell (td)
newRelationItem
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right:
5px;
}[
JSRelationItem
]{span}{span:style=
Span
stylefont-weight:
bold;
}
newRelationItem
{span}{span}\
Span
(dataprovider,
operator,
foreinColumnName)
{span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Creates a new relation item for this relation. The primary dataprovider, the foreign data provider and one relation operators (like '=' '!=' '>' '<') must be provided.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} dataprovider -- The name of the primary dataprovider. \{[String]} operator -- The operator used to relate the primary and the foreign dataproviders. \{[String]} foreinColumnName -- The name of the foreign dataprovider. {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[JSRelationItem] -- A JSRelationItem instance representing the newly added relation item.{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Creates a new relation item for this relation. The primary dataprovider, the foreign data provider
and one relation operators (like '=' '!=' '>' '<') must be provided.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} dataprovider – The name of the primary dataprovider.
{String} operator – The operator used to relate the primary and the foreign dataproviders.
{String} foreinColumnName – The name of the foreign dataprovider.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
JSRelationItem – A JSRelationItem instance representing the newly added relation item.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var relation = solutionModel.newRelation('parentToChild', 'db:/example_data/parent_table', 'db:/example_data/child_table', JSRelation.INNER_JOIN);
relation.newRelationItem('another_parent_table_id', '=', 'another_child_table_parent_id');
// for literals use a prefix
relation.newRelationItem(JSRelationItem.LITERAL_PREFIX + "'hello'",'=', 'mytextfield')
; {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=
;
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idremoveRelationItem-String_String_String
}{
Table Row (tr)
:
id
=
name
}{td}h6.removeRelationItem{td}{tr}{tr:id=sig}{td}{span:style=
Table Cell (td)
removeRelationItem
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right:
5px;
}
void
{span}{span:style=
Span
stylefont-weight:
bold;
}
removeRelationItem
{span}{span}\
Span
(primaryDataProviderID,
operator,
foreignColumnName)
{span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Removes the desired relation item from the specified relation.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} primaryDataProviderID -- the primary data provider (column) name \{[String]} operator -- the operator \{[String]} foreignColumnName -- the foreign column name {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Removes the desired relation item from the specified relation.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} primaryDataProviderID – the primary data provider (column) name
{String} operator – the operator
{String} foreignColumnName – the foreign column name
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var relation = solutionModel.newRelation('myRelation', 'db:/myServer/parentTable', 'db:/myServer/childTable', JSRelation.INNER_JOIN);
relation.newRelationItem('someColumn1', '=', 'someColumn2');
relation.newRelationItem('anotherColumn', '=', 'someOtherColumn');
relation.removeRelationItem('someColumn1', '=', 'someColumn2');
var criteria = relation.getRelationItems();
for (var i = 0; i < criteria.length; i++) {
	var item = criteria[i];
	application.output('primary column: ' + item.primaryDataProviderID);
	application.output('operator: ' + item.operator);
	application.output('foreign column: ' + item.foreignColumnName);
}
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}
Table Row (tr)
classlastDetailRow
Table Cell (td)