Thanks Arnuad, however, that will work, but requires a bunch of 'work'. Thanks to Keisuke, again :), his query component contains code that pulls all relations ENDING (where the current field of parent table is the many of a one to many relation). without having to troll through the entire table structure.
So my final code looks like this: For (all valid fields of parent table) query hidden structure definition tables for related many on current parent table field if (related many exist) clear selections on those tables RELATE MANY if (records in selection of any related many tables >0) exit loop $Dependancies_Exist := true end if else GET RELATION PROPERTIES (Current field) RELATE ONE if Records in selection one table >0) exit loop $Dependancies_Exist := true end if end if end for $0:= $Dependancies_Exist On Thu, 10 Jan 2019 17:02:52 +0100, Arnaud de Montard via 4D_Tech wrote: > >> Le 8 janv. 2019 à 21:47, Chip Scheide via 4D_Tech >> <4d_tech@lists.4d.com> a écrit : >> >> given a pointer to a table, or a pointer to a field of a table, >> I want to be able, for the current record of this table, to : > > Hi Chip, > I use this for foreign keys: > > //DB_getForeignKeys (aTable_p) > $parentTable_l:=Table($1) > $FKarray_p:=$2 > CLEAR VARIABLE($FKarray_p->) > For ($table_l;1;Get last table number) > Case of > : (Not(Is table number valid($table_l))) > : ($table_l=$parentTable_l) > Else > For ($field_l;1;Get last field number($table_l)) > If (Is field number valid($table_l;$field_l)) > GET RELATION > PROPERTIES($table_l;$field_l;$destinationTable_l;$destinationField_l) > If ($parentTable_l=$destinationTable_l) > APPEND TO > ARRAY($FKarray_p->;Field($table_l;$field_l)) > End if > End if > End for > End case > End for > $0:=Size of array($FKarray_p->) > > Primary is easier, just loop through fields of the start table and > check if a relation exists for the current one (as above). > > -- > Arnaud de Montard > > > > ********************************************************************** > 4D Internet Users Group (4D iNUG) > Archive: http://lists.4d.com/archives.html > Options: https://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > ********************************************************************** --------------- Gas is for washing parts Alcohol is for drinkin' Nitromethane is for racing ********************************************************************** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **********************************************************************