Page 1 of 1

Using preferred index for spouse

Posted: 03 Jan 2022 18:52
by BakerJL75
In the layout section of the descendant report for Heading Record the default is

%INDI.NAME:ADORNED_FULL% (=LifeDates2()) Which displays John Doe Sr. (1957-2014) at the top of the report

I would like my header to say John Doe Sr. – Mary Smith where Mary is one of many wives, but in this case marked as the preferred wife. Let’s say Mary is wife #4.

The John Doe Sr. portion displays properly in any case. Mary is the problem.

%INDI.~SPOU[4]>NAME% displays Mary Smith
%INDI.~SPOU[preferred]>NAME% displays nothing although Mary is the only wife marked preferred.

Any suggestions?

If you are wondering I like the descendant report as a narrative family group sheet as suggested in this post: https://www.fhug.org.uk/forum/viewtopic ... 32&t=20116

Thanks,
Jackie

Re: Using preferred index for spouse

Posted: 03 Jan 2022 19:27
by LornaCraig
According to the FH Help file:
The [preferred] and [prefonly] indices can only be used with facts(events or attributes). They are not valid in any other context.
So you can mark a particular marriage event as the preferred marriage, but I don't think this makes the spouse a 'preferred' spouse.

Re: Using preferred index for spouse

Posted: 03 Jan 2022 19:44
by BakerJL75
And that is what I did. Sorry I didn't read more closely. Thank you.

Re: Using preferred index for spouse

Posted: 04 Jan 2022 10:31
by tatewise
You might get it to work by using a complex expression along the lines of:

=TextIf( Exists(%INDI.FAMS[1].MARR[prefonly]%), %INDI.~SPOU[1]>NAME%, TextIf( Exists(%INDI.FAMS[2].MARR[prefonly]%), %INDI.~SPOU[2]>NAME%, TextIf( Exists(%INDI.FAMS[3].MARR[prefonly]%), %INDI.~SPOU[3]>NAME%, ... ) ) )

Can you work that out for yourself or do you need detailed advice?