{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=}h4.Selfjoins
Relations can use the same table as primary and foreign table. Depending on the setup of the the RelationItems the relation can point back to the originating record or one or more different records.

h4.Container relations
If the primary and foreign table are equal and the relation does not contain any RelationItems, it becomes a Container relation. A Container relation returns it originating FoundSet. A Container relation can be used to set the FoundSet of the parent form into the Form displayed in a TabPanel.{sub-section}\\ 

{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}[#foreignTable]
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}[#primaryTable]
Qualified name of the primary data source.{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=16474A7A-E3F8-4521-B8B8-0117531AB502}{tr:id=name}{td}h6.allowCreationRelatedRecords{td}{tr}{tr:id=des}{td}{sub-section:16474A7A-E3F8-4521-B8B8-0117531AB502_des|text=|trigger=button}{sub-section}{sub-section:16474A7A-E3F8-4521-B8B8-0117531AB502_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:16474A7A-E3F8-4521-B8B8-0117531AB502_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:16474A7A-E3F8-4521-B8B8-0117531AB502_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:16474A7A-E3F8-4521-B8B8-0117531AB502_ret|text=|trigger=button}{sub-section}{sub-section:16474A7A-E3F8-4521-B8B8-0117531AB502_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:16474A7A-E3F8-4521-B8B8-0117531AB502_see|text=|trigger=button}{sub-section}{sub-section:16474A7A-E3F8-4521-B8B8-0117531AB502_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:16474A7A-E3F8-4521-B8B8-0117531AB502_see|text=|trigger=button}{sub-section}{sub-section:16474A7A-E3F8-4521-B8B8-0117531AB502_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:16474A7A-E3F8-4521-B8B8-0117531AB502_sam|text=|trigger=button}{sub-section}{sub-section:16474A7A-E3F8-4521-B8B8-0117531AB502_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=DE00CF62-BBFF-4CCF-8F92-E4A2627EA196}{tr:id=name}{td}h6.allowParentDeleteWhenHavingRelatedRecords{td}{tr}{tr:id=des}{td}{sub-section:DE00CF62-BBFF-4CCF-8F92-E4A2627EA196_des|text=|trigger=button}{sub-section}{sub-section:DE00CF62-BBFF-4CCF-8F92-E4A2627EA196_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:DE00CF62-BBFF-4CCF-8F92-E4A2627EA196_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:DE00CF62-BBFF-4CCF-8F92-E4A2627EA196_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:DE00CF62-BBFF-4CCF-8F92-E4A2627EA196_ret|text=|trigger=button}{sub-section}{sub-section:DE00CF62-BBFF-4CCF-8F92-E4A2627EA196_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:DE00CF62-BBFF-4CCF-8F92-E4A2627EA196_see|text=|trigger=button}{sub-section}{sub-section:DE00CF62-BBFF-4CCF-8F92-E4A2627EA196_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:DE00CF62-BBFF-4CCF-8F92-E4A2627EA196_see|text=|trigger=button}{sub-section}{sub-section:DE00CF62-BBFF-4CCF-8F92-E4A2627EA196_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:DE00CF62-BBFF-4CCF-8F92-E4A2627EA196_sam|text=|trigger=button}{sub-section}{sub-section:DE00CF62-BBFF-4CCF-8F92-E4A2627EA196_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=3015BAAD-69EB-4E7B-B237-09C6198EE2FF}{tr:id=name}{td}h6.deleteRelatedRecords{td}{tr}{tr:id=des}{td}{sub-section:3015BAAD-69EB-4E7B-B237-09C6198EE2FF_des|text=|trigger=button}{sub-section}{sub-section:3015BAAD-69EB-4E7B-B237-09C6198EE2FF_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:3015BAAD-69EB-4E7B-B237-09C6198EE2FF_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:3015BAAD-69EB-4E7B-B237-09C6198EE2FF_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:3015BAAD-69EB-4E7B-B237-09C6198EE2FF_ret|text=|trigger=button}{sub-section}{sub-section:3015BAAD-69EB-4E7B-B237-09C6198EE2FF_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:3015BAAD-69EB-4E7B-B237-09C6198EE2FF_see|text=|trigger=button}{sub-section}{sub-section:3015BAAD-69EB-4E7B-B237-09C6198EE2FF_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:3015BAAD-69EB-4E7B-B237-09C6198EE2FF_see|text=|trigger=button}{sub-section}{sub-section:3015BAAD-69EB-4E7B-B237-09C6198EE2FF_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:3015BAAD-69EB-4E7B-B237-09C6198EE2FF_sam|text=|trigger=button}{sub-section}{sub-section:3015BAAD-69EB-4E7B-B237-09C6198EE2FF_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=F03C0813-5AC8-47C8-A7C6-060FEC49D6CB}{tr:id=name}{td}h6.foreignTable{td}{tr}{tr:id=des}{td}{sub-section:F03C0813-5AC8-47C8-A7C6-060FEC49D6CB_des|text=|trigger=button}{sub-section}{sub-section:F03C0813-5AC8-47C8-A7C6-060FEC49D6CB_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:F03C0813-5AC8-47C8-A7C6-060FEC49D6CB_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:F03C0813-5AC8-47C8-A7C6-060FEC49D6CB_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:F03C0813-5AC8-47C8-A7C6-060FEC49D6CB_ret|text=|trigger=button}{sub-section}{sub-section:F03C0813-5AC8-47C8-A7C6-060FEC49D6CB_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:F03C0813-5AC8-47C8-A7C6-060FEC49D6CB_see|text=|trigger=button}{sub-section}{sub-section:F03C0813-5AC8-47C8-A7C6-060FEC49D6CB_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:F03C0813-5AC8-47C8-A7C6-060FEC49D6CB_see|text=|trigger=button}{sub-section}{sub-section:F03C0813-5AC8-47C8-A7C6-060FEC49D6CB_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:F03C0813-5AC8-47C8-A7C6-060FEC49D6CB_sam|text=|trigger=button}{sub-section}{sub-section:F03C0813-5AC8-47C8-A7C6-060FEC49D6CB_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=5394857F-A29E-42EC-9692-35CF2793B324}{tr:id=name}{td}h6.initialSort{td}{tr}{tr:id=des}{td}{sub-section:5394857F-A29E-42EC-9692-35CF2793B324_des|text=|trigger=button}{sub-section}{sub-section:5394857F-A29E-42EC-9692-35CF2793B324_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:5394857F-A29E-42EC-9692-35CF2793B324_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:5394857F-A29E-42EC-9692-35CF2793B324_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:5394857F-A29E-42EC-9692-35CF2793B324_ret|text=|trigger=button}{sub-section}{sub-section:5394857F-A29E-42EC-9692-35CF2793B324_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:5394857F-A29E-42EC-9692-35CF2793B324_see|text=|trigger=button}{sub-section}{sub-section:5394857F-A29E-42EC-9692-35CF2793B324_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:5394857F-A29E-42EC-9692-35CF2793B324_see|text=|trigger=button}{sub-section}{sub-section:5394857F-A29E-42EC-9692-35CF2793B324_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:5394857F-A29E-42EC-9692-35CF2793B324_sam|text=|trigger=button}{sub-section}{sub-section:5394857F-A29E-42EC-9692-35CF2793B324_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=94F12761-3463-4AA7-A73B-526516E198EF}{tr:id=name}{td}h6.joinType{td}{tr}{tr:id=des}{td}{sub-section:94F12761-3463-4AA7-A73B-526516E198EF_des|text=|trigger=button}{sub-section}{sub-section:94F12761-3463-4AA7-A73B-526516E198EF_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:94F12761-3463-4AA7-A73B-526516E198EF_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:94F12761-3463-4AA7-A73B-526516E198EF_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:94F12761-3463-4AA7-A73B-526516E198EF_ret|text=|trigger=button}{sub-section}{sub-section:94F12761-3463-4AA7-A73B-526516E198EF_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:94F12761-3463-4AA7-A73B-526516E198EF_see|text=|trigger=button}{sub-section}{sub-section:94F12761-3463-4AA7-A73B-526516E198EF_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:94F12761-3463-4AA7-A73B-526516E198EF_see|text=|trigger=button}{sub-section}{sub-section:94F12761-3463-4AA7-A73B-526516E198EF_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:94F12761-3463-4AA7-A73B-526516E198EF_sam|text=|trigger=button}{sub-section}{sub-section:94F12761-3463-4AA7-A73B-526516E198EF_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=3A513961-7973-4ABF-9E87-501D97E23B68}{tr:id=name}{td}h6.name{td}{tr}{tr:id=des}{td}{sub-section:3A513961-7973-4ABF-9E87-501D97E23B68_des|text=|trigger=button}{sub-section}{sub-section:3A513961-7973-4ABF-9E87-501D97E23B68_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:3A513961-7973-4ABF-9E87-501D97E23B68_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:3A513961-7973-4ABF-9E87-501D97E23B68_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:3A513961-7973-4ABF-9E87-501D97E23B68_ret|text=|trigger=button}{sub-section}{sub-section:3A513961-7973-4ABF-9E87-501D97E23B68_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:3A513961-7973-4ABF-9E87-501D97E23B68_see|text=|trigger=button}{sub-section}{sub-section:3A513961-7973-4ABF-9E87-501D97E23B68_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:3A513961-7973-4ABF-9E87-501D97E23B68_see|text=|trigger=button}{sub-section}{sub-section:3A513961-7973-4ABF-9E87-501D97E23B68_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:3A513961-7973-4ABF-9E87-501D97E23B68_sam|text=|trigger=button}{sub-section}{sub-section:3A513961-7973-4ABF-9E87-501D97E23B68_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=157DD405-5AA6-49DB-82E9-09AA9C06343C}{tr:id=name}{td}h6.primaryTable{td}{tr}{tr:id=des}{td}{sub-section:157DD405-5AA6-49DB-82E9-09AA9C06343C_des|text=|trigger=button}{sub-section}{sub-section:157DD405-5AA6-49DB-82E9-09AA9C06343C_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:157DD405-5AA6-49DB-82E9-09AA9C06343C_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:157DD405-5AA6-49DB-82E9-09AA9C06343C_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:157DD405-5AA6-49DB-82E9-09AA9C06343C_ret|text=|trigger=button}{sub-section}{sub-section:157DD405-5AA6-49DB-82E9-09AA9C06343C_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:157DD405-5AA6-49DB-82E9-09AA9C06343C_see|text=|trigger=button}{sub-section}{sub-section:157DD405-5AA6-49DB-82E9-09AA9C06343C_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:157DD405-5AA6-49DB-82E9-09AA9C06343C_see|text=|trigger=button}{sub-section}{sub-section:157DD405-5AA6-49DB-82E9-09AA9C06343C_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:157DD405-5AA6-49DB-82E9-09AA9C06343C_sam|text=|trigger=button}{sub-section}{sub-section:157DD405-5AA6-49DB-82E9-09AA9C06343C_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}