Page 1 of 1
custom All Facts query
Posted: 16 Nov 2020 11:34
by rogerdavies42
Is there any way to add a column to a custom All Facts query that lists an attribute or a flag of the fact owner? I have searched the knowledge base without success. Thanks in advance
Re: custom All Facts query
Posted: 16 Nov 2020 12:10
by tatewise
Yes, it is a bit tricky. It relies on two techniques...
1) Identify the fact owner.
Now bear in mind that some facts such as Marriage and Divorce are Family facts, so are 'owned' by the Family record.
Alternatively, they have two Individual 'owners', i.e. the Husband and the Wife who link to the Family record.
The function GetRecord(%FACT%) gets the Individual or Family record containing the fact.
The function FactOwner(%FACT%,1,MALES_FIRST) returns the Individual or Husband record.
The function FactOwner(%FACT%,2,MALES_FIRST) returns 'nothing' or the Wife record.
2) To retrieve fields from a record needs the Field(...) function, where the 1st parameter identifies the record and the 2nd parameter identifies the field.
So to determine if the Living record flag exists use:
=Field( GetRecord(%FACT%), 'INDI._FLGS.__LIVING' )
To list all record flags for each record use:
=Field( GetRecord(%FACT%), 'INDI._FLGS' )
I am not sure what you mean by attribute because Attributes are like Events and will be listed as Facts.
Re: custom All Facts query
Posted: 17 Nov 2020 14:47
by rogerdavies42
That is brilliant, Mike. Just what I need. Thank you very much for this and all the other help you give to members of this forum