Function overview
Prototype
GroupRelationInfo (
FileTarget; TableTarget; Result )
Parameters
FileTarget Get ( FileName ) or name of a file open or related file
TableTarget name of the target occurrence, between quotes or Get ( LayoutTableName )
Result Field or F or 1 or Table or T or 0 ( default : Table )
Description
Tags:
List Relation RelationInfo
To retrieve a list of occurrences or fields only for a group of links.
3 parameters, the filename and the target occurrence and the desired result
If result = 0 :
just all Occurrences related directly or indirectly to the selected occurrences of n Occurrences on the application
If result = 1 :
all Fields for the above group Occurrences related directly or indirectly to the selected occurrences
* result = 1 ( returns the list of fields contained in a layout if the occurrence in the same name as a layout )
Carreful :
On the code, you have 25 :
(...)
Trigger = CustomList ( 1 ; 25 ; (...)
> Is the RelationInfo_Max : 10 or 200 or n Occurrences related of max 25 Occurrences related in line :
Occurrence1 <-> Occurrence2 <-> [...] <-> Occurrence25
- You can filter the list with FilterList()
http://www.fmfunctions.com/fid/150
- And you can suggest fields to a user to export only data from an related group.
Examples
Sample input
GroupRelationInfo ( Get ( FileName ) ; Get ( LayoutTableName ) ; 0 )
--------------------------
GroupRelationInfo ( Get ( FileName ) ; "cre_CRE_Table" ; 1 )
Sample output
cre_CRE_Table
cre_TAF_TableAndField
cre_CRE_CustomReport
cre_FTA_FileTarget
--------------------------
cre_CRE_Table::zkv_TargetFile
cre_CRE_Table::zkp_IDCustomExport
cre_CRE_Table::ResultatExport
cre_CRE_Table::zkv_TargetTable
cre_CRE_Table::zc_FileTargetTable
cre_TAF_TableAndField::zkp_IDTableAndField
cre_TAF_TableAndField::zkv_ClefMagique
cre_TAF_TableAndField::ColSpan
cre_TAF_TableAndField::RowSpan
cre_TAF_TableAndField::VerticalAlign
cre_TAF_TableAndField::TextAlign
cre_TAF_TableAndField::zks_IDCustomExport
cre_CRE_CustomReport::zkv_TargetFile
cre_CRE_CustomReport::zkp_IDCustomExport
cre_CRE_CustomReport::ResultatExport
cre_CRE_CustomReport::zkv_TargetTable
cre_CRE_CustomReport::zc_FileTargetTable
cre_FTA_FileTarget::zkp_IDTableAndField
cre_FTA_FileTarget::zkv_ClefMagique
cre_FTA_FileTarget::zks_IDCustomExport
cre_FTA_FileTarget::TableField
Function code
//GroupRelationInfo ( FileTarget ; TableTarget ; Result ) v1.6
//Requires CustomList ( Start ; End ; Function )
//--------------------------------------
/*
• FileTarget : Get ( FileName ) or the name of a file open or related file.
• TableTarget : name of the target occurrence, between quotes or Get ( LayoutTableName )
• Result : Field or F or 1 or Table or T or 0 ( default : Table )
> If Result = Table or T or 0, returns a list of all occurrences of tables related to "TableTarget".
> If Result = Field ou F ou 1, returns a list of all fields of occurrences of tables related to "TableTarget" as Table::Field
( returns the list of fields contained in a layout if the occurrence in the same name as a layout )
> RelationInfo_Max : n Occurrences related of max 25 Occurrences related in line :
Occurrence1 <-> Occurrence2 <-> [...] <-> Occurrence25
> ex > GroupRelationInfo ( Get ( FileName ) ; Get ( LayoutTableName ) ; 0 ) And Get ( LayoutTableName ) = cre_CRE_Table
Return :
cre_CRE_Table
cre_TAF_TableAndField
cre_CRE_CustomReport
cre_FTA_FileTarget
=> just all Occurrences related directly or indirectly to cre_CRE_Table of n Occurrences on the application
> ex > GroupRelationInfo ( Get ( FileName ) ; "cre_CRE_Table" ; 1 )
Return :
cre_CRE_Table::zkv_TargetFile
cre_CRE_Table::zkp_IDCustomExport
cre_CRE_Table::ResultatExport
cre_CRE_Table::zkv_TargetTable
cre_CRE_Table::zc_FileTargetTable
cre_TAF_TableAndField::zkp_IDTableAndField
cre_TAF_TableAndField::zkv_ClefMagique
cre_TAF_TableAndField::ColSpan
cre_TAF_TableAndField::RowSpan
cre_TAF_TableAndField::VerticalAlign
cre_TAF_TableAndField::TextAlign
cre_TAF_TableAndField::zks_IDCustomExport
cre_CRE_CustomReport::zkv_TargetFile
cre_CRE_CustomReport::zkp_IDCustomExport
cre_CRE_CustomReport::ResultatExport
cre_CRE_CustomReport::zkv_TargetTable
cre_CRE_CustomReport::zc_FileTargetTable
cre_FTA_FileTarget::zkp_IDTableAndField
cre_FTA_FileTarget::zkv_ClefMagique
cre_FTA_FileTarget::zks_IDCustomExport
cre_FTA_FileTarget::TableField
=> all Fields for the above group
*/
//------------------------------------------------------------*/
// Agnès Barouh - Decembre 2009 - Substitute( filemaker§tictac.fr; §; @ )
//------------------------------------------------------------*/
Let ([
$rc = ¶ ;
$ri_Ta = "Table:" ; $ri_Tp = "::" ;
$ri_TT = FileTarget ;
$ri_CL1 = TableTarget ;
$ri_CL2 = RelationInfo ( $ri_TT; $ri_CL1 ) ;
$ri_CLR = $ri_CL1 ;
R = Case ( Left ( Result ; 1 ) = "F" or Result = 1 ; 1 ; 0 ) ;
Trigger = CustomList ( 1 ; 25 ;
"Case ( Not IsEmpty ( $ri_CL1 ) ;
Let ([
$ri_CL1 = CustomList ( 1 ; ValueCount ( $ri_CL2 ) ;
\"Let ([ V = GetValue ( $ri_CL2 ; [n] ) ; VR = Middle ( V ; 7 ; Length ( V ) ) ];
Case (( PatternCount ( V ;$ri_Ta ) And Not PatternCount ( V ; $ri_Tp ) And Not PatternCount ( $rc & $ri_CLR & $rc ; $rc & VR & $rc )) ; VR ) )\" ) ;
$ri_CL2 = CustomList ( 1 ; ValueCount ( $ri_CL1 ) ; \"RelationInfo ( $ri_TT; GetValue ( $ri_CL1 ; [n] ) )\" ) ;
$ri_CLR = $ri_CLR & $rc & $ri_CL1 ]; \"\" ))" )
];
Choose ( R ; $ri_CLR ;
CustomList ( 1 ; ValueCount ( $ri_CLR ) ;
"Let ([ V = GetValue ( $ri_CLR ; [n] ) ]; V & $ri_Tp & Substitute ( FieldNames ( $ri_TT ; V ) ; $rc ; $rc & V & $ri_Tp ))" )
)
)
// ===================================
/*
This function is published on FileMaker Custom Functions
to check for updates and provide feedback and bug reports
please visit http://www.fmfunctions.com/fid/252
Prototype: GroupRelationInfo( FileTarget; TableTarget; Result )
Function Author: Agnès (http://www.fmfunctions.com/mid/46)
Last updated: 17 March 2010
Version: 1.2
*/
// ===================================
//GroupRelationInfo ( FileTarget ; TableTarget ; Result ) v1.6__LITBR__//Requires CustomList ( Start ; End ; Function )__LITBR__//--------------------------------------__LITBR__/*__LITBR__ • FileTarget : Get ( FileName ) or the name of a file open or related file.__LITBR__ • TableTarget : name of the target occurrence, between quotes or Get ( LayoutTableName )__LITBR__ • Result : Field or F or 1 or Table or T or 0 ( default : Table )__LITBR__ > If Result = Table or T or 0, returns a list of all occurrences of tables related to "TableTarget".__LITBR__ > If Result = Field ou F ou 1, returns a list of all fields of occurrences of tables related to "TableTarget" as Table::Field__LITBR__ ( returns the list of fields contained in a layout if the occurrence in the same name as a layout )__LITBR____LITBR__ > RelationInfo_Max : n Occurrences related of max 25 Occurrences related in line : __LITBR__ Occurrence1 <-> Occurrence2 <-> [...] <-> Occurrence25__LITBR____LITBR__ > ex > GroupRelationInfo ( Get ( FileName ) ; Get ( LayoutTableName ) ; 0 ) And Get ( LayoutTableName ) = cre_CRE_Table__LITBR__ Return : __LITBR__cre_CRE_Table__LITBR__cre_TAF_TableAndField__LITBR__cre_CRE_CustomReport__LITBR__cre_FTA_FileTarget__LITBR____LITBR__=> just all Occurrences related directly or indirectly to cre_CRE_Table of n Occurrences on the application__LITBR____LITBR__ > ex > GroupRelationInfo ( Get ( FileName ) ; "cre_CRE_Table" ; 1 )__LITBR__ Return : __LITBR__cre_CRE_Table::zkv_TargetFile__LITBR__cre_CRE_Table::zkp_IDCustomExport__LITBR__cre_CRE_Table::ResultatExport__LITBR__cre_CRE_Table::zkv_TargetTable__LITBR__cre_CRE_Table::zc_FileTargetTable__LITBR__cre_TAF_TableAndField::zkp_IDTableAndField__LITBR__cre_TAF_TableAndField::zkv_ClefMagique__LITBR__cre_TAF_TableAndField::ColSpan__LITBR__cre_TAF_TableAndField::RowSpan__LITBR__cre_TAF_TableAndField::VerticalAlign__LITBR__cre_TAF_TableAndField::TextAlign__LITBR__cre_TAF_TableAndField::zks_IDCustomExport__LITBR__cre_CRE_CustomReport::zkv_TargetFile__LITBR__cre_CRE_CustomReport::zkp_IDCustomExport__LITBR__cre_CRE_CustomReport::ResultatExport__LITBR__cre_CRE_CustomReport::zkv_TargetTable__LITBR__cre_CRE_CustomReport::zc_FileTargetTable__LITBR__cre_FTA_FileTarget::zkp_IDTableAndField__LITBR__cre_FTA_FileTarget::zkv_ClefMagique__LITBR__cre_FTA_FileTarget::zks_IDCustomExport__LITBR__cre_FTA_FileTarget::TableField__LITBR____LITBR__=> all Fields for the above group__LITBR____LITBR__*/__LITBR__//------------------------------------------------------------*/__LITBR__// Agnès Barouh - Decembre 2009 - Substitute( filemaker§tictac.fr; §; @ )__LITBR__//------------------------------------------------------------*/__LITBR__Let ([__LITBR____LITBR__$rc = ¶ ;__LITBR__$ri_Ta = "Table:" ; $ri_Tp = "::" ;__LITBR__$ri_TT = FileTarget ;__LITBR__$ri_CL1 = TableTarget ;__LITBR__$ri_CL2 = RelationInfo ( $ri_TT; $ri_CL1 ) ;__LITBR__$ri_CLR = $ri_CL1 ;__LITBR__R = Case ( Left ( Result ; 1 ) = "F" or Result = 1 ; 1 ; 0 ) ;__LITBR____LITBR__Trigger = CustomList ( 1 ; 25 ;__LITBR__"Case ( Not IsEmpty ( $ri_CL1 ) ;__LITBR__Let ([__LITBR__$ri_CL1 = CustomList ( 1 ; ValueCount ( $ri_CL2 ) ;__LITBR__\"Let ([ V = GetValue ( $ri_CL2 ; [n] ) ; VR = Middle ( V ; 7 ; Length ( V ) ) ];__LITBR__Case (( PatternCount ( V ;$ri_Ta ) And Not PatternCount ( V ; $ri_Tp ) And Not PatternCount ( $rc & $ri_CLR & $rc ; $rc & VR & $rc )) ; VR ) )\" ) ;__LITBR__$ri_CL2 = CustomList ( 1 ; ValueCount ( $ri_CL1 ) ; \"RelationInfo ( $ri_TT; GetValue ( $ri_CL1 ; [n] ) )\" ) ;__LITBR__$ri_CLR = $ri_CLR & $rc & $ri_CL1 ]; \"\" ))" )__LITBR____LITBR__];__LITBR__Choose ( R ; $ri_CLR ; __LITBR__CustomList ( 1 ; ValueCount ( $ri_CLR ) ;__LITBR__"Let ([ V = GetValue ( $ri_CLR ; [n] ) ]; V & $ri_Tp & Substitute ( FieldNames ( $ri_TT ; V ) ; $rc ; $rc & V & $ri_Tp ))" )__LITBR__)__LITBR__)__LITBR____LITBR__// ===================================__LITBR__/*__LITBR____LITBR__ This function is published on FileMaker Custom Functions__LITBR__ to check for updates and provide feedback and bug reports__LITBR__ please visit http://www.fmfunctions.com/fid/252__LITBR____LITBR__ Prototype: GroupRelationInfo( FileTarget; TableTarget; Result )__LITBR__ Function Author: Agnès (http://www.fmfunctions.com/mid/46)__LITBR__ Last updated: 17 March 2010__LITBR__ Version: 1.2__LITBR____LITBR__*/__LITBR__// ===================================
Login or register to comment
Create a new account with fmcustomfunctions.com or login to post a comment.