{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=}{sub-section}\\{table:class=servoy sReturnTypes}{tr:style=height: 30px;}{th}Return Types{th}{tr}{tr}{td}{span:class=sWordList}[JSRelationItem]{span}{td}{tr}{table}\\{table:class=servoy sSummery}{colgroup}{column:width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Constants Summary{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:class=servoy sSummery}{colgroup}{column:width=80px}{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}[#foreignServerName]
The name of the server where the foreign table is located.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#foreignTableName]
The name of the foreign table.{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}{tbody}{tr}{td}[String]{td}{td}[#primaryServerName]
The name of the server where the primary table is located.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#primaryTableName]
The name of the primary table.{td}{tr}{tbody}{table}\\{table:class=servoy sSummery}{colgroup}{column:width=80px}{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}[JSRelationItem]{td}{td}[#newRelationItem]\(dataprovider, operator, foreinColumnName)
Creates a new relation item for this relation.{td}{tr}{tbody}{table}\\{table:class=servoy sDetail}{colgroup}{column:width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Constants Details{th}{tr}{tbody:id=423F1FA0-EEA8-4685-8328-CF77B620545E}{tr:id=name}{td}h6.INNER_JOIN{td}{tr}{tr:id=des}{td}{sub-section:423F1FA0-EEA8-4685-8328-CF77B620545E_des|text=|trigger=button}{sub-section}{sub-section:423F1FA0-EEA8-4685-8328-CF77B620545E_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=prs}{td}*Parameters*\\{sub-section:423F1FA0-EEA8-4685-8328-CF77B620545E_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:423F1FA0-EEA8-4685-8328-CF77B620545E_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:423F1FA0-EEA8-4685-8328-CF77B620545E_ret|text=|trigger=button}{sub-section}{sub-section:423F1FA0-EEA8-4685-8328-CF77B620545E_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:423F1FA0-EEA8-4685-8328-CF77B620545E_see|text=|trigger=button}{sub-section}{sub-section:423F1FA0-EEA8-4685-8328-CF77B620545E_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:423F1FA0-EEA8-4685-8328-CF77B620545E_see|text=|trigger=button}{sub-section}{sub-section:423F1FA0-EEA8-4685-8328-CF77B620545E_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:423F1FA0-EEA8-4685-8328-CF77B620545E_sam|text=|trigger=button}{sub-section}{sub-section:423F1FA0-EEA8-4685-8328-CF77B620545E_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=1D08F099-59A8-44E9-BACE-D89F5EEBF0B6}{tr:id=name}{td}h6.LEFT_OUTER_JOIN{td}{tr}{tr:id=des}{td}{sub-section:1D08F099-59A8-44E9-BACE-D89F5EEBF0B6_des|text=|trigger=button}{sub-section}{sub-section:1D08F099-59A8-44E9-BACE-D89F5EEBF0B6_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=prs}{td}*Parameters*\\{sub-section:1D08F099-59A8-44E9-BACE-D89F5EEBF0B6_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:1D08F099-59A8-44E9-BACE-D89F5EEBF0B6_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:1D08F099-59A8-44E9-BACE-D89F5EEBF0B6_ret|text=|trigger=button}{sub-section}{sub-section:1D08F099-59A8-44E9-BACE-D89F5EEBF0B6_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:1D08F099-59A8-44E9-BACE-D89F5EEBF0B6_see|text=|trigger=button}{sub-section}{sub-section:1D08F099-59A8-44E9-BACE-D89F5EEBF0B6_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:1D08F099-59A8-44E9-BACE-D89F5EEBF0B6_see|text=|trigger=button}{sub-section}{sub-section:1D08F099-59A8-44E9-BACE-D89F5EEBF0B6_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:1D08F099-59A8-44E9-BACE-D89F5EEBF0B6_sam|text=|trigger=button}{sub-section}{sub-section:1D08F099-59A8-44E9-BACE-D89F5EEBF0B6_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\{table:class=servoy sDetail}{colgroup}{column:width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Property Details{th}{tr}{tbody:id=B9805C2D-AC45-4EAB-BEB0-502951991DBA}{tr:id=name}{td}h6.allowCreationRelatedRecords{td}{tr}{tr:id=des}{td}{sub-section:B9805C2D-AC45-4EAB-BEB0-502951991DBA_des|text=|trigger=button}{sub-section}{sub-section:B9805C2D-AC45-4EAB-BEB0-502951991DBA_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=prs}{td}*Parameters*\\{sub-section:B9805C2D-AC45-4EAB-BEB0-502951991DBA_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:B9805C2D-AC45-4EAB-BEB0-502951991DBA_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:B9805C2D-AC45-4EAB-BEB0-502951991DBA_ret|text=|trigger=button}{sub-section}{sub-section:B9805C2D-AC45-4EAB-BEB0-502951991DBA_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:B9805C2D-AC45-4EAB-BEB0-502951991DBA_see|text=|trigger=button}{sub-section}{sub-section:B9805C2D-AC45-4EAB-BEB0-502951991DBA_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:B9805C2D-AC45-4EAB-BEB0-502951991DBA_see|text=|trigger=button}{sub-section}{sub-section:B9805C2D-AC45-4EAB-BEB0-502951991DBA_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:B9805C2D-AC45-4EAB-BEB0-502951991DBA_sam|text=|trigger=button}{sub-section}{sub-section:B9805C2D-AC45-4EAB-BEB0-502951991DBA_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=5785B93B-F79C-41F5-820C-A5CCFA6CBC8C}{tr:id=name}{td}h6.allowParentDeleteWhenHavingRelatedRecords{td}{tr}{tr:id=des}{td}{sub-section:5785B93B-F79C-41F5-820C-A5CCFA6CBC8C_des|text=|trigger=button}{sub-section}{sub-section:5785B93B-F79C-41F5-820C-A5CCFA6CBC8C_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=prs}{td}*Parameters*\\{sub-section:5785B93B-F79C-41F5-820C-A5CCFA6CBC8C_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:5785B93B-F79C-41F5-820C-A5CCFA6CBC8C_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:5785B93B-F79C-41F5-820C-A5CCFA6CBC8C_ret|text=|trigger=button}{sub-section}{sub-section:5785B93B-F79C-41F5-820C-A5CCFA6CBC8C_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:5785B93B-F79C-41F5-820C-A5CCFA6CBC8C_see|text=|trigger=button}{sub-section}{sub-section:5785B93B-F79C-41F5-820C-A5CCFA6CBC8C_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:5785B93B-F79C-41F5-820C-A5CCFA6CBC8C_see|text=|trigger=button}{sub-section}{sub-section:5785B93B-F79C-41F5-820C-A5CCFA6CBC8C_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:5785B93B-F79C-41F5-820C-A5CCFA6CBC8C_sam|text=|trigger=button}{sub-section}{sub-section:5785B93B-F79C-41F5-820C-A5CCFA6CBC8C_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=3FD6F762-1225-44EC-9A1B-F8B708E4E63F}{tr:id=name}{td}h6.deleteRelatedRecords{td}{tr}{tr:id=des}{td}{sub-section:3FD6F762-1225-44EC-9A1B-F8B708E4E63F_des|text=|trigger=button}{sub-section}{sub-section:3FD6F762-1225-44EC-9A1B-F8B708E4E63F_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=prs}{td}*Parameters*\\{sub-section:3FD6F762-1225-44EC-9A1B-F8B708E4E63F_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:3FD6F762-1225-44EC-9A1B-F8B708E4E63F_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:3FD6F762-1225-44EC-9A1B-F8B708E4E63F_ret|text=|trigger=button}{sub-section}{sub-section:3FD6F762-1225-44EC-9A1B-F8B708E4E63F_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:3FD6F762-1225-44EC-9A1B-F8B708E4E63F_see|text=|trigger=button}{sub-section}{sub-section:3FD6F762-1225-44EC-9A1B-F8B708E4E63F_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:3FD6F762-1225-44EC-9A1B-F8B708E4E63F_see|text=|trigger=button}{sub-section}{sub-section:3FD6F762-1225-44EC-9A1B-F8B708E4E63F_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:3FD6F762-1225-44EC-9A1B-F8B708E4E63F_sam|text=|trigger=button}{sub-section}{sub-section:3FD6F762-1225-44EC-9A1B-F8B708E4E63F_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=861FCAF0-376B-45F0-9663-2EFCFCB01F95}{tr:id=name}{td}h6.foreignDataSource{td}{tr}{tr:id=des}{td}{sub-section:861FCAF0-376B-45F0-9663-2EFCFCB01F95_des|text=|trigger=button}{sub-section}{sub-section:861FCAF0-376B-45F0-9663-2EFCFCB01F95_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=prs}{td}*Parameters*\\{sub-section:861FCAF0-376B-45F0-9663-2EFCFCB01F95_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:861FCAF0-376B-45F0-9663-2EFCFCB01F95_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:861FCAF0-376B-45F0-9663-2EFCFCB01F95_ret|text=|trigger=button}{sub-section}{sub-section:861FCAF0-376B-45F0-9663-2EFCFCB01F95_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:861FCAF0-376B-45F0-9663-2EFCFCB01F95_see|text=|trigger=button}{sub-section}{sub-section:861FCAF0-376B-45F0-9663-2EFCFCB01F95_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:861FCAF0-376B-45F0-9663-2EFCFCB01F95_see|text=|trigger=button}{sub-section}{sub-section:861FCAF0-376B-45F0-9663-2EFCFCB01F95_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:861FCAF0-376B-45F0-9663-2EFCFCB01F95_sam|text=|trigger=button}{sub-section}{sub-section:861FCAF0-376B-45F0-9663-2EFCFCB01F95_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=64A913B0-9FFC-4137-A37B-4ACBC6E42B72}{tr:id=name}{td}h6.foreignServerName{td}{tr}{tr:id=des}{td}{sub-section:64A913B0-9FFC-4137-A37B-4ACBC6E42B72_des|text=|trigger=button}{sub-section}{sub-section:64A913B0-9FFC-4137-A37B-4ACBC6E42B72_des|trigger=none|class=sIndent}The name of the server where the foreign table is located.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:64A913B0-9FFC-4137-A37B-4ACBC6E42B72_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:64A913B0-9FFC-4137-A37B-4ACBC6E42B72_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:64A913B0-9FFC-4137-A37B-4ACBC6E42B72_ret|text=|trigger=button}{sub-section}{sub-section:64A913B0-9FFC-4137-A37B-4ACBC6E42B72_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:64A913B0-9FFC-4137-A37B-4ACBC6E42B72_see|text=|trigger=button}{sub-section}{sub-section:64A913B0-9FFC-4137-A37B-4ACBC6E42B72_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:64A913B0-9FFC-4137-A37B-4ACBC6E42B72_see|text=|trigger=button}{sub-section}{sub-section:64A913B0-9FFC-4137-A37B-4ACBC6E42B72_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:64A913B0-9FFC-4137-A37B-4ACBC6E42B72_sam|text=|trigger=button}{sub-section}{sub-section:64A913B0-9FFC-4137-A37B-4ACBC6E42B72_sam|class=sIndent|trigger=none}{code:language=javascript}
var relation = solutionModel.newRelation('parentToChild', 'example_data', 'parent_table', 'example_data', 'child_table', JSRelation.INNER_JOIN);
relation.primaryTableName = 'another_parent_table';
relation.primaryServerName = 'user_data';
relation.foreignTableName = 'another_child_table';
relation.foreignServerName = 'user_data';
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=69CE960F-1A53-4B01-AF3B-CA095021CBA4}{tr:id=name}{td}h6.foreignTableName{td}{tr}{tr:id=des}{td}{sub-section:69CE960F-1A53-4B01-AF3B-CA095021CBA4_des|text=|trigger=button}{sub-section}{sub-section:69CE960F-1A53-4B01-AF3B-CA095021CBA4_des|trigger=none|class=sIndent}The name of the foreign table.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:69CE960F-1A53-4B01-AF3B-CA095021CBA4_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:69CE960F-1A53-4B01-AF3B-CA095021CBA4_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:69CE960F-1A53-4B01-AF3B-CA095021CBA4_ret|text=|trigger=button}{sub-section}{sub-section:69CE960F-1A53-4B01-AF3B-CA095021CBA4_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:69CE960F-1A53-4B01-AF3B-CA095021CBA4_see|text=|trigger=button}{sub-section}{sub-section:69CE960F-1A53-4B01-AF3B-CA095021CBA4_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:69CE960F-1A53-4B01-AF3B-CA095021CBA4_see|text=|trigger=button}{sub-section}{sub-section:69CE960F-1A53-4B01-AF3B-CA095021CBA4_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:69CE960F-1A53-4B01-AF3B-CA095021CBA4_sam|text=|trigger=button}{sub-section}{sub-section:69CE960F-1A53-4B01-AF3B-CA095021CBA4_sam|class=sIndent|trigger=none}{code:language=javascript}
var relation = solutionModel.newRelation('parentToChild', 'example_data', 'parent_table', 'example_data', 'child_table', JSRelation.INNER_JOIN);
relation.primaryTableName = 'another_parent_table';
relation.primaryServerName = 'user_data';
relation.foreignTableName = 'another_child_table';
relation.foreignServerName = 'user_data';
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=B08D5854-673B-4296-B01F-F018BBC40A34}{tr:id=name}{td}h6.initialSort{td}{tr}{tr:id=des}{td}{sub-section:B08D5854-673B-4296-B01F-F018BBC40A34_des|text=|trigger=button}{sub-section}{sub-section:B08D5854-673B-4296-B01F-F018BBC40A34_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=prs}{td}*Parameters*\\{sub-section:B08D5854-673B-4296-B01F-F018BBC40A34_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:B08D5854-673B-4296-B01F-F018BBC40A34_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:B08D5854-673B-4296-B01F-F018BBC40A34_ret|text=|trigger=button}{sub-section}{sub-section:B08D5854-673B-4296-B01F-F018BBC40A34_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:B08D5854-673B-4296-B01F-F018BBC40A34_see|text=|trigger=button}{sub-section}{sub-section:B08D5854-673B-4296-B01F-F018BBC40A34_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:B08D5854-673B-4296-B01F-F018BBC40A34_see|text=|trigger=button}{sub-section}{sub-section:B08D5854-673B-4296-B01F-F018BBC40A34_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:B08D5854-673B-4296-B01F-F018BBC40A34_sam|text=|trigger=button}{sub-section}{sub-section:B08D5854-673B-4296-B01F-F018BBC40A34_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=A1FE04DE-C1BD-4BB5-8CD2-C71CED1D6757}{tr:id=name}{td}h6.joinType{td}{tr}{tr:id=des}{td}{sub-section:A1FE04DE-C1BD-4BB5-8CD2-C71CED1D6757_des|text=|trigger=button}{sub-section}{sub-section:A1FE04DE-C1BD-4BB5-8CD2-C71CED1D6757_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=prs}{td}*Parameters*\\{sub-section:A1FE04DE-C1BD-4BB5-8CD2-C71CED1D6757_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:A1FE04DE-C1BD-4BB5-8CD2-C71CED1D6757_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:A1FE04DE-C1BD-4BB5-8CD2-C71CED1D6757_ret|text=|trigger=button}{sub-section}{sub-section:A1FE04DE-C1BD-4BB5-8CD2-C71CED1D6757_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:A1FE04DE-C1BD-4BB5-8CD2-C71CED1D6757_see|text=|trigger=button}{sub-section}{sub-section:A1FE04DE-C1BD-4BB5-8CD2-C71CED1D6757_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:A1FE04DE-C1BD-4BB5-8CD2-C71CED1D6757_see|text=|trigger=button}{sub-section}{sub-section:A1FE04DE-C1BD-4BB5-8CD2-C71CED1D6757_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:A1FE04DE-C1BD-4BB5-8CD2-C71CED1D6757_sam|text=|trigger=button}{sub-section}{sub-section:A1FE04DE-C1BD-4BB5-8CD2-C71CED1D6757_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=DA969405-D188-42E8-80C8-AE3D6A84C7DC}{tr:id=name}{td}h6.name{td}{tr}{tr:id=des}{td}{sub-section:DA969405-D188-42E8-80C8-AE3D6A84C7DC_des|text=|trigger=button}{sub-section}{sub-section:DA969405-D188-42E8-80C8-AE3D6A84C7DC_des|trigger=none|class=sIndent}The name of the relation.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:DA969405-D188-42E8-80C8-AE3D6A84C7DC_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:DA969405-D188-42E8-80C8-AE3D6A84C7DC_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:DA969405-D188-42E8-80C8-AE3D6A84C7DC_ret|text=|trigger=button}{sub-section}{sub-section:DA969405-D188-42E8-80C8-AE3D6A84C7DC_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:DA969405-D188-42E8-80C8-AE3D6A84C7DC_see|text=|trigger=button}{sub-section}{sub-section:DA969405-D188-42E8-80C8-AE3D6A84C7DC_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:DA969405-D188-42E8-80C8-AE3D6A84C7DC_see|text=|trigger=button}{sub-section}{sub-section:DA969405-D188-42E8-80C8-AE3D6A84C7DC_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:DA969405-D188-42E8-80C8-AE3D6A84C7DC_sam|text=|trigger=button}{sub-section}{sub-section:DA969405-D188-42E8-80C8-AE3D6A84C7DC_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=EEDDF00E-9DC1-41CC-96E1-1D70BA485F6F}{tr:id=name}{td}h6.primaryDataSource{td}{tr}{tr:id=des}{td}{sub-section:EEDDF00E-9DC1-41CC-96E1-1D70BA485F6F_des|text=|trigger=button}{sub-section}{sub-section:EEDDF00E-9DC1-41CC-96E1-1D70BA485F6F_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=prs}{td}*Parameters*\\{sub-section:EEDDF00E-9DC1-41CC-96E1-1D70BA485F6F_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:EEDDF00E-9DC1-41CC-96E1-1D70BA485F6F_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:EEDDF00E-9DC1-41CC-96E1-1D70BA485F6F_ret|text=|trigger=button}{sub-section}{sub-section:EEDDF00E-9DC1-41CC-96E1-1D70BA485F6F_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:EEDDF00E-9DC1-41CC-96E1-1D70BA485F6F_see|text=|trigger=button}{sub-section}{sub-section:EEDDF00E-9DC1-41CC-96E1-1D70BA485F6F_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:EEDDF00E-9DC1-41CC-96E1-1D70BA485F6F_see|text=|trigger=button}{sub-section}{sub-section:EEDDF00E-9DC1-41CC-96E1-1D70BA485F6F_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:EEDDF00E-9DC1-41CC-96E1-1D70BA485F6F_sam|text=|trigger=button}{sub-section}{sub-section:EEDDF00E-9DC1-41CC-96E1-1D70BA485F6F_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=613B43E1-4F8E-4712-B05E-AE8FD509687A}{tr:id=name}{td}h6.primaryServerName{td}{tr}{tr:id=des}{td}{sub-section:613B43E1-4F8E-4712-B05E-AE8FD509687A_des|text=|trigger=button}{sub-section}{sub-section:613B43E1-4F8E-4712-B05E-AE8FD509687A_des|trigger=none|class=sIndent}The name of the server where the primary table is located.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:613B43E1-4F8E-4712-B05E-AE8FD509687A_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:613B43E1-4F8E-4712-B05E-AE8FD509687A_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:613B43E1-4F8E-4712-B05E-AE8FD509687A_ret|text=|trigger=button}{sub-section}{sub-section:613B43E1-4F8E-4712-B05E-AE8FD509687A_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:613B43E1-4F8E-4712-B05E-AE8FD509687A_see|text=|trigger=button}{sub-section}{sub-section:613B43E1-4F8E-4712-B05E-AE8FD509687A_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:613B43E1-4F8E-4712-B05E-AE8FD509687A_see|text=|trigger=button}{sub-section}{sub-section:613B43E1-4F8E-4712-B05E-AE8FD509687A_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:613B43E1-4F8E-4712-B05E-AE8FD509687A_sam|text=|trigger=button}{sub-section}{sub-section:613B43E1-4F8E-4712-B05E-AE8FD509687A_sam|class=sIndent|trigger=none}{code:language=javascript}
var relation = solutionModel.newRelation('parentToChild', 'example_data', 'parent_table', 'example_data', 'child_table', JSRelation.INNER_JOIN);
relation.primaryTableName = 'another_parent_table';
relation.primaryServerName = 'user_data';
relation.foreignTableName = 'another_child_table';
relation.foreignServerName = 'user_data';
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=BAA99A23-23B5-4F07-B2F4-C243E58506F4}{tr:id=name}{td}h6.primaryTableName{td}{tr}{tr:id=des}{td}{sub-section:BAA99A23-23B5-4F07-B2F4-C243E58506F4_des|text=|trigger=button}{sub-section}{sub-section:BAA99A23-23B5-4F07-B2F4-C243E58506F4_des|trigger=none|class=sIndent}The name of the primary table.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:BAA99A23-23B5-4F07-B2F4-C243E58506F4_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:BAA99A23-23B5-4F07-B2F4-C243E58506F4_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:BAA99A23-23B5-4F07-B2F4-C243E58506F4_ret|text=|trigger=button}{sub-section}{sub-section:BAA99A23-23B5-4F07-B2F4-C243E58506F4_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:BAA99A23-23B5-4F07-B2F4-C243E58506F4_see|text=|trigger=button}{sub-section}{sub-section:BAA99A23-23B5-4F07-B2F4-C243E58506F4_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:BAA99A23-23B5-4F07-B2F4-C243E58506F4_see|text=|trigger=button}{sub-section}{sub-section:BAA99A23-23B5-4F07-B2F4-C243E58506F4_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:BAA99A23-23B5-4F07-B2F4-C243E58506F4_sam|text=|trigger=button}{sub-section}{sub-section:BAA99A23-23B5-4F07-B2F4-C243E58506F4_sam|class=sIndent|trigger=none}{code:language=javascript}
var relation = solutionModel.newRelation('parentToChild', 'example_data', 'parent_table', 'example_data', 'child_table', JSRelation.INNER_JOIN);
relation.primaryTableName = 'another_parent_table';
relation.primaryServerName = 'user_data';
relation.foreignTableName = 'another_child_table';
relation.foreignServerName = 'user_data';
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\{table:class=servoy sDetail}{colgroup}{column:width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=950D4039-A6B7-491D-8791-9757412C6A44}{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:950D4039-A6B7-491D-8791-9757412C6A44_des|text=|trigger=button}{sub-section}{sub-section:950D4039-A6B7-491D-8791-9757412C6A44_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=prs}{td}*Parameters*\\{sub-section:950D4039-A6B7-491D-8791-9757412C6A44_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:950D4039-A6B7-491D-8791-9757412C6A44_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:950D4039-A6B7-491D-8791-9757412C6A44_ret|text=|trigger=button}{sub-section}{sub-section:950D4039-A6B7-491D-8791-9757412C6A44_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:950D4039-A6B7-491D-8791-9757412C6A44_see|text=|trigger=button}{sub-section}{sub-section:950D4039-A6B7-491D-8791-9757412C6A44_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:950D4039-A6B7-491D-8791-9757412C6A44_see|text=|trigger=button}{sub-section}{sub-section:950D4039-A6B7-491D-8791-9757412C6A44_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:950D4039-A6B7-491D-8791-9757412C6A44_sam|text=|trigger=button}{sub-section}{sub-section:950D4039-A6B7-491D-8791-9757412C6A44_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=BE0B6D5E-9EB1-4FE2-8A5A-5A63E6F4AA08}{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:BE0B6D5E-9EB1-4FE2-8A5A-5A63E6F4AA08_des|text=|trigger=button}{sub-section}{sub-section:BE0B6D5E-9EB1-4FE2-8A5A-5A63E6F4AA08_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}{tr:id=prs}{td}*Parameters*\\{sub-section:BE0B6D5E-9EB1-4FE2-8A5A-5A63E6F4AA08_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:BE0B6D5E-9EB1-4FE2-8A5A-5A63E6F4AA08_prs|trigger=none}dataprovider -- The name of the primary dataprovider.
operator -- The operator used to relate the primary and the foreign dataproviders.
foreinColumnName -- The name of the foreign dataprovider.
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:BE0B6D5E-9EB1-4FE2-8A5A-5A63E6F4AA08_ret|text=|trigger=button}{sub-section}{sub-section:BE0B6D5E-9EB1-4FE2-8A5A-5A63E6F4AA08_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:BE0B6D5E-9EB1-4FE2-8A5A-5A63E6F4AA08_see|text=|trigger=button}{sub-section}{sub-section:BE0B6D5E-9EB1-4FE2-8A5A-5A63E6F4AA08_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:BE0B6D5E-9EB1-4FE2-8A5A-5A63E6F4AA08_see|text=|trigger=button}{sub-section}{sub-section:BE0B6D5E-9EB1-4FE2-8A5A-5A63E6F4AA08_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:BE0B6D5E-9EB1-4FE2-8A5A-5A63E6F4AA08_sam|text=|trigger=button}{sub-section}{sub-section:BE0B6D5E-9EB1-4FE2-8A5A-5A63E6F4AA08_sam|class=sIndent|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}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}