Child pages
  • JSRelation

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{hidden}
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING.
		THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE{hidden}
{sub-section:description|text=}For more information see [Relations]{sub-section}\\ 

{table:id=|class=servoy sSummerysSummary}{colgroup}{column:padding=0px|width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Constants SummerySummary{th}{tr}{tbody}{tr}{td}[Number]{td}{td}[#INNER_JOIN]
Constant for set/get the joinType of a JSRelation.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#LEFT_OUTER_JOIN]
Constant for set/get the joinType of a JSRelation.{td}{tr}{tbody}{table}\\ 

{table:id=|class=servoy sSummerysSummary}{colgroup}{column:padding=0px|width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Property SummerySummary{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 sSummerysSummary}{colgroup}{column:padding=0px|width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method SummerySummary{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}{tabletbody}\\ 

{table:id=constant|class=servoy sDetail{tr}{colgrouptd}{column:padding=0px|width=100%void{td}{column}{colgroup}{tr: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:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Constants Details{th}{tr}{tbody:id=INNER_JOIN|class=node}{tr:id=name}{td}h6.INNER_JOIN{td}{tr}{tr:id=des}{td}{sub-section:INNER_JOIN_des|text=|trigger=button}{sub-section}{sub-section:INNER_JOIN_des|trigger=none|class=sIndent}Constant for set/get the joinType of a JSRelation. It is also used in solutionModel.newRelation(...).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:INNER_JOIN_snc|text=|trigger=button}{sub-section}{sub-section:INNER_JOIN_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:INNER_JOIN_prs|text=|trigger=button}{sub-section}{sub-section:INNER_JOIN_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:INNER_JOIN_ret|text=|trigger=button}{sub-section}{sub-section:INNER_JOIN_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:INNER_JOIN_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:INNER_JOIN_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:INNER_JOIN_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:INNER_JOIN_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:INNER_JOIN_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:INNER_JOIN_sam|trigger=none}{code:language=javascript}
var relation = solutionModel.newRelation('parentToChild', 'example_data', 'parent_table', 'example_data', 'child_table', JSRelation.INNER_JOIN);
relation.joinType = JSRelation.LEFT_OUTER_JOIN;
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=LEFT_OUTER_JOIN|class=node}{tr:id=name}{td}h6.LEFT_OUTER_JOIN{td}{tr}{tr:id=des}{td}{sub-section:LEFT_OUTER_JOIN_des|text=|trigger=button}{sub-section}{sub-section:LEFT_OUTER_JOIN_des|trigger=none|class=sIndent}Constant for set/get the joinType of a JSRelation. It is also used in solutionModel.newRelation(...).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:LEFT_OUTER_JOIN_snc|text=|trigger=button}{sub-section}{sub-section:LEFT_OUTER_JOIN_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:LEFT_OUTER_JOIN_prs|text=|trigger=button}{sub-section}{sub-section:LEFT_OUTER_JOIN_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:LEFT_OUTER_JOIN_ret|text=|trigger=button}{sub-section}{sub-section:LEFT_OUTER_JOIN_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:LEFT_OUTER_JOIN_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:LEFT_OUTER_JOIN_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:LEFT_OUTER_JOIN_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:LEFT_OUTER_JOIN_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:LEFT_OUTER_JOIN_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:LEFT_OUTER_JOIN_sam|trigger=none}{code:language=javascript}
var relation = solutionModel.newRelation('parentToChild', 'example_data', 'parent_table', 'example_data', 'child_table', JSRelation.INNER_JOIN);
relation.joinType = JSRelation.LEFT_OUTER_JOIN;
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\ 

{table:id=property|class=servoy sDetail}{colgroup}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Property Details{th}{tr}{tbody:id=allowCreationRelatedRecords|class=node}{tr:id=name}{td}h6.allowCreationRelatedRecords{td}{tr}{tr:id=des}{td}{sub-section:allowCreationRelatedRecords_des|text=|trigger=button}{sub-section}{sub-section:allowCreationRelatedRecords_des|trigger=none|class=sIndent}Flag that tells if related records can be created through this relation.

The default value of this flag is "false".{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:allowCreationRelatedRecords_snc|text=|trigger=button}{sub-section}{sub-section:allowCreationRelatedRecords_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:allowCreationRelatedRecords_prs|text=|trigger=button}{sub-section}{sub-section:allowCreationRelatedRecords_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:allowCreationRelatedRecords_ret|text=|trigger=button}{sub-section}{sub-section:allowCreationRelatedRecords_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:allowCreationRelatedRecords_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:allowCreationRelatedRecords_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:allowCreationRelatedRecords_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:allowCreationRelatedRecords_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:allowCreationRelatedRecords_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:allowCreationRelatedRecords_sam|trigger=none}{code:language=javascript}
var relation = solutionModel.newRelation('parentToChild', 'example_data', 'parent_table', 'example_data', 'child_table', JSRelation.INNER_JOIN);
relation.allowCreationRelatedRecords = true;
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=allowParentDeleteWhenHavingRelatedRecords|class=node}{tr:id=name}{td}h6.allowParentDeleteWhenHavingRelatedRecords{td}{tr}{tr:id=des}{td}{sub-section:allowParentDeleteWhenHavingRelatedRecords_des|text=|trigger=button}{sub-section}{sub-section:allowParentDeleteWhenHavingRelatedRecords_des|trigger=none|class=sIndent}Flag that tells if the parent record can be deleted while it has related records.

The default value of this flag is "true".{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:allowParentDeleteWhenHavingRelatedRecords_snc|text=|trigger=button}{sub-section}{sub-section:allowParentDeleteWhenHavingRelatedRecords_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:allowParentDeleteWhenHavingRelatedRecords_prs|text=|trigger=button}{sub-section}{sub-section:allowParentDeleteWhenHavingRelatedRecords_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:allowParentDeleteWhenHavingRelatedRecords_ret|text=|trigger=button}{sub-section}{sub-section:allowParentDeleteWhenHavingRelatedRecords_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:allowParentDeleteWhenHavingRelatedRecords_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:allowParentDeleteWhenHavingRelatedRecords_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:allowParentDeleteWhenHavingRelatedRecords_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:allowParentDeleteWhenHavingRelatedRecords_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:allowParentDeleteWhenHavingRelatedRecords_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:allowParentDeleteWhenHavingRelatedRecords_sam|trigger=none}{code:language=javascript}
var relation = solutionModel.newRelation('parentToChild', 'example_data', 'parent_table', 'example_data', 'child_table', JSRelation.INNER_JOIN);
relation.allowParentDeleteWhenHavingRelatedRecords = false;
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=deleteRelatedRecords|class=node}{tr:id=name}{td}h6.deleteRelatedRecords{td}{tr}{tr:id=des}{td}{sub-section:deleteRelatedRecords_des|text=|trigger=button}{sub-section}{sub-section:deleteRelatedRecords_des|trigger=none|class=sIndent}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".{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:deleteRelatedRecords_snc|text=|trigger=button}{sub-section}{sub-section:deleteRelatedRecords_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:deleteRelatedRecords_prs|text=|trigger=button}{sub-section}{sub-section:deleteRelatedRecords_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:deleteRelatedRecords_ret|text=|trigger=button}{sub-section}{sub-section:deleteRelatedRecords_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:deleteRelatedRecords_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:deleteRelatedRecords_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:deleteRelatedRecords_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:deleteRelatedRecords_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:deleteRelatedRecords_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:deleteRelatedRecords_sam|trigger=none}{code:language=javascript}
var relation = solutionModel.newRelation('parentToChild', 'example_data', 'parent_table', 'example_data', 'child_table', JSRelation.INNER_JOIN);
relation.deleteRelatedRecords = true;
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=foreignDataSource|class=node}{tr:id=name}{td}h6.foreignDataSource{td}{tr}{tr:id=des}{td}{sub-section:foreignDataSource_des|text=|trigger=button}{sub-section}{sub-section:foreignDataSource_des|trigger=none|class=sIndent}Qualified name of the foreign data source. Contains both the name of the foreign
server and the name of the foreign table.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:foreignDataSource_snc|text=|trigger=button}{sub-section}{sub-section:foreignDataSource_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:foreignDataSource_prs|text=|trigger=button}{sub-section}{sub-section:foreignDataSource_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:foreignDataSource_ret|text=|trigger=button}{sub-section}{sub-section:foreignDataSource_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:foreignDataSource_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:foreignDataSource_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:foreignDataSource_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:foreignDataSource_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:foreignDataSource_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:foreignDataSource_sam|trigger=none}{code:language=javascript}
var relation = solutionModel.newRelation('parentToChild', 'example_data', 'parent_table', 'example_data', 'child_table', JSRelation.INNER_JOIN);
relation.primaryDataSource = 'db:/user_data/another_parent_table';
relation.foreignDataSource = 'db:/user_data/another_child_table';
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=initialSort|class=node}{tr:id=name}{td}h6.initialSort{td}{tr}{tr:id=des}{td}{sub-section:initialSort_des|text=|trigger=button}{sub-section}{sub-section:initialSort_des|trigger=none|class=sIndent}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, ...".{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:initialSort_snc|text=|trigger=button}{sub-section}{sub-section:initialSort_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:initialSort_prs|text=|trigger=button}{sub-section}{sub-section:initialSort_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:initialSort_ret|text=|trigger=button}{sub-section}{sub-section:initialSort_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:initialSort_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:initialSort_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:initialSort_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:initialSort_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:initialSort_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:initialSort_sam|trigger=none}{code:language=javascript}
var relation = solutionModel.newRelation('parentToChild', 'example_data', 'parent_table', 'example_data', 'child_table', JSRelation.INNER_JOIN);
relation.initialSort = 'another_child_table_text asc';
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=joinType|class=node}{tr:id=name}{td}h6.joinType{td}{tr}{tr:id=des}{td}{sub-section:joinType_des|text=|trigger=button}{sub-section}{sub-section:joinType_des|trigger=none|class=sIndent}The join type that is performed between the primary table and the foreign table.
Can be "inner join" or "left outer join".{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:joinType_snc|text=|trigger=button}{sub-section}{sub-section:joinType_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:joinType_prs|text=|trigger=button}{sub-section}{sub-section:joinType_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:joinType_ret|text=|trigger=button}{sub-section}{sub-section:joinType_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:joinType_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:joinType_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:joinType_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:joinType_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:joinType_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:joinType_sam|trigger=none}{code:language=javascript}
var relation = solutionModel.newRelation('parentToChild', 'example_data', 'parent_table', 'example_data', 'child_table', JSRelation.INNER_JOIN);
relation.joinType = JSRelation.LEFT_OUTER_JOIN;
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=name|class=node}{tr:id=name}{td}h6.name{td}{tr}{tr:id=des}{td}{sub-section:name_des|text=|trigger=button}{sub-section}{sub-section:name_des|trigger=none|class=sIndent}The name of the relation.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:name_snc|text=|trigger=button}{sub-section}{sub-section:name_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:name_prs|text=|trigger=button}{sub-section}{sub-section:name_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:name_ret|text=|trigger=button}{sub-section}{sub-section:name_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:name_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:name_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:name_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:name_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:name_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:name_sam|trigger=none}{code:language=javascript}
var relation = solutionModel.newRelation('parentToChild', 'example_data', 'parent_table', 'example_data', 'child_table', JSRelation.INNER_JOIN);
relation.name = 'anotherName';
var firstTab = tabs.newTab('firstTab', 'Child Form', childForm, relation);
firstTab.relationName = relation.name;
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=primaryDataSource|class=node}{tr:id=name}{td}h6.primaryDataSource{td}{tr}{tr:id=des}{td}{sub-section:primaryDataSource_des|text=|trigger=button}{sub-section}{sub-section:primaryDataSource_des|trigger=none|class=sIndent}Qualified name of the primary data source. Contains both the name of the primary server
and the name of the primary table.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:primaryDataSource_snc|text=|trigger=button}{sub-section}{sub-section:primaryDataSource_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:primaryDataSource_prs|text=|trigger=button}{sub-section}{sub-section:primaryDataSource_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:primaryDataSource_ret|text=|trigger=button}{sub-section}{sub-section:primaryDataSource_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:primaryDataSource_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:primaryDataSource_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:primaryDataSource_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:primaryDataSource_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:primaryDataSource_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:primaryDataSource_sam|trigger=none}{code:language=javascript}
var relation = solutionModel.newRelation('parentToChild', 'example_data', 'parent_table', 'example_data', 'child_table', JSRelation.INNER_JOIN);
relation.primaryDataSource = 'db:/user_data/another_parent_table';
relation.foreignDataSource = 'db:/user_data/another_child_table';
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\ 

{table:id=function|class=servoy sDetail}{colgroup}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=getRelationItems|class=node}{tr:id=name}{td}h6.getRelationItems{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSRelationItem]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}getRelationItems{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:getRelationItems_des|text=|trigger=button}{sub-section}{sub-section:getRelationItems_des|trigger=none|class=sIndent}Returns an array of JSRelationItem objects representing the relation criteria defined for this relation.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getRelationItems_snc|text=|trigger=button}{sub-section}{sub-section:getRelationItems_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getRelationItems_prs|text=|trigger=button}{sub-section}{sub-section:getRelationItems_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getRelationItems_ret|text=|trigger=button}{sub-section}{sub-section:getRelationItems_ret|trigger=none|class=sIndent}[JSRelationItem]\[] -- An array of JSRelationItem instances representing the relation criteria of this relation.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getRelationItems_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRelationItems_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getRelationItems_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRelationItems_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getRelationItems_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRelationItems_sam|trigger=none}{code:language=javascript}
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}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=newRelationItemgetUUID|class=node}{tr:id=name}{td}h6.newRelationItemgetUUID{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSRelationItemUUID]{span}{span:id=iets|style=float: left; font-weight: bold;}newRelationItemgetUUID{span}{span:id=iets|style=float: left;}\(dataprovider, operator, foreinColumnName){span}{td}{tr}{tr:id=des}{td}{sub-section:newRelationItemgetUUID_des|text=|trigger=button}{sub-section}{sub-section:newRelationItemgetUUID_des|trigger=none|class=sIndent}CreatesReturns athe new relation item for this relation. The primary dataprovider, the foreign data provider 
and one relation operators (like '=' '!=' '>' '<') must be provided.UUID of the relation object{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:newRelationItemgetUUID_snc|text=|trigger=button}{sub-section}{sub-section:newRelationItemgetUUID_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:newRelationItemgetUUID_prs|text=|trigger=button}{sub-section}{sub-section:newRelationItemgetUUID_prs|trigger=none|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.
{sub-section}{td}{tr}{tr}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:newRelationItemgetUUID_ret|text=|trigger=button}{sub-section}{sub-section:newRelationItemgetUUID_ret|trigger=none|class=sIndent}[JSRelationItemUUID] -- A JSRelationItem instance representing the newly added relation item.{sub-section}{td}{tr}{builder-show:permission{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:newRelationItemgetUUID_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:newRelationItemgetUUID_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:newRelationItemgetUUID_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:newRelationItemgetUUID_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:newRelationItemgetUUID_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:newRelationItemgetUUID_sam|trigger=none}{code:language=javascript}
var relation = solutionModel.newRelation('parentToChild', 'example_data', 'parent_table', 'example_data', 'child_table', JSRelation.INNER_JOIN);
application.output(relation.getUUID().newRelationItem('another_parent_table_id', '=', 'another_child_table_parent_id');toString())
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=newRelationItem|class=node}{tr:id=name}{td}h6.newRelationItem{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSRelationItem]{span}{span:id=iets|style=float: left; font-weight: bold;}newRelationItem{span}{span:id=iets|style=float: left;}\(dataprovider, operator, foreinColumnName){span}{td}{tr}{tr:id=des}{td}{sub-section:newRelationItem_des|text=|trigger=button}{sub-section}{sub-section:newRelationItem_des|trigger=none|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.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:newRelationItem_snc|text=|trigger=button}{sub-section}{sub-section:newRelationItem_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:newRelationItem_prs|text=|trigger=button}{sub-section}{sub-section:newRelationItem_prs|trigger=none|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.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:newRelationItem_ret|text=|trigger=button}{sub-section}{sub-section:newRelationItem_ret|trigger=none|class=sIndent}[JSRelationItem] -- A JSRelationItem instance representing the newly added relation item.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:newRelationItem_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:newRelationItem_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:newRelationItem_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:newRelationItem_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:newRelationItem_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:newRelationItem_sam|trigger=none}{code:language=javascript}
var relation = solutionModel.newRelation('parentToChild', 'example_data', 'parent_table', 'example_data', 'child_table', JSRelation.INNER_JOIN);
relation.newRelationItem('another_parent_table_id', '=', 'another_child_table_parent_id');
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=removeRelationItem|class=node}{tr:id=name}{td}h6.removeRelationItem{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}removeRelationItem{span}{span:id=iets|style=float: left;}\(primaryDataProviderID, operator, foreignColumnName){span}{td}{tr}{tr:id=des}{td}{sub-section:removeRelationItem_des|text=|trigger=button}{sub-section}{sub-section:removeRelationItem_des|trigger=none|class=sIndent}Removes the desired relation item from the specified relation.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:removeRelationItem_snc|text=|trigger=button}{sub-section}{sub-section:removeRelationItem_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:removeRelationItem_prs|text=|trigger=button}{sub-section}{sub-section:removeRelationItem_prs|trigger=none|class=sIndent}\{[String]} primaryDataProviderID -- the primary data provider (column) name
\{[String]} operator -- the operator
\{[String]} foreignColumnName -- the foreign column name
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:removeRelationItem_ret|text=|trigger=button}{sub-section}{sub-section:removeRelationItem_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:removeRelationItem_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:removeRelationItem_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:removeRelationItem_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:removeRelationItem_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:removeRelationItem_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:removeRelationItem_sam|trigger=none}{code:language=javascript}
var relation = solutionModel.newRelation('myRelation', 'myServer', 'parentTable', '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}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}