Page 1 of 1
Occupation in main fact box
Posted: 02 Sep 2021 12:00
by Johnr65
Why does FH default to the first census so as to record the person's occupation? Mostly it records them as a scholar? Why can't it default to the last census occupation?

Re: Occupation in main fact box
Posted: 02 Sep 2021 12:09
by ColeValleyGirl
It actually defaults to the earliest occupation, whether that came from a census or elsewhere. Use the 'Preferred' fact flag in V7 to choose which occupation it displays on the Main tab of the Property Box.
Re: Occupation in main fact box
Posted: 02 Sep 2021 13:31
by Johnr65
Where do I find 'preferred facts' in FH7?
Re: Occupation in main fact box
Posted: 02 Sep 2021 13:44
by LornaCraig
Select the fact in the facts tab, then click the cog wheel icon in the facts tab toolbar and select Fact Flags. This gives you a choice of four flags: Private, Preferred, Tentative and Rejected.
This is the relevant section in the Help files:
https://www.family-historian.co.uk/help ... afact.html
Re: Occupation in main fact box
Posted: 03 Sep 2021 06:46
by laz_gen
Has anybody used this preferred flag for a fact and can confirm the feature is working.
I have just tried marking a later occupation as preferred, as described in this thread. The fact shows a yellow star in the fact list but the occupation field on the Main tab is still showing the earlier occupation.
I have clicked away from the fact tab, to the main tab and even to a different individual then back to the individual in question but still the earlier occupation is shown.
This preferred fact feature does not work for me.

- A.jpg (74.56 KiB) Viewed 2076 times

- B.jpg (46.96 KiB) Viewed 2076 times
Re: Occupation in main fact box
Posted: 03 Sep 2021 07:11
by ColeValleyGirl
It works for me.
Re: Occupation in main fact box
Posted: 03 Sep 2021 07:57
by Johnr65
This works OK for an individual but is it not possible to use the preferred fact for the whole tree of people as a blanket choice say of the last occupation rather than first? I've got over 30000 people in my tree and this will work even harder!
Re: Occupation in main fact box
Posted: 03 Sep 2021 08:35
by Mark1834
But is the last occupation necessarily a better default than the first? It's very common for somebody to have a different occupation listed in their twilight years that does not reflect their main occupation in earlier life.
If you wanted to make a bulk change to 30k records, despite this caveat, this is where learning basic plugin skills would come into its own. It would be a fairly simple change for a plugin to make. They might have a reputation as being difficult (and much of the discussion and examples in the Plugins forum does little to dispel that notion

), but IMO a basic plugin is no more complicated than some of the more convoluted formulae for defining queries or expressions in reports or diagrams.
Re: Occupation in main fact box
Posted: 03 Sep 2021 08:38
by ColeValleyGirl
Johnr65 wrote: ↑03 Sep 2021 07:57
This works OK for an individual but is it not possible to use the preferred fact for the whole tree of people as a blanket choice say of the last occupation rather than first? I've got over 30000 people in my tree and this will work even harder!
The flag has to be set on specific facts. It might be possible to write a plugin to do what you want, but you'd have to re-run it - it would not be a one-shot thing. As Mark said, it would not need to be very complex.
Re: Occupation in main fact box
Posted: 03 Sep 2021 09:14
by tatewise
@laz_gen: It looks like you have used the Customize Property Box... option, removed the default Sex & Occupation item and replaced it with an Occupation & Date item.
I suspect you have used the data reference INDI.OCCU which defaults to INDI.OCCU[1] the 1st Occupation.
Change that data reference to INDI.OCCU[preferred] as in Sex & Occupation and it will use your Preferred Occupation or the 1st Occupation is none have the Preferred Flag.
@Johnr65: It is possible to globally change the Property Box to always show the last Occupation for everyone.
Use the Property Box cog Menu > Customize Property Box... option.
Select the Sex & Occupation item in the Selected Items list on the right.
Click the View/Edit... button and in the lower Data Reference: change INDI.OCCU[preferred] to INDI.OCCU[last]
Then click OK twice.
Alternatively, if you would prefer the penultimate Occupation use INDI.OCCU[last-1] instead.
Later on, after you have set the Preferred Flag on the Occupation events for many of the Individual records, then you can revert the above setting to INDI.OCCU[preferred]
Re: Occupation in main fact box
Posted: 03 Sep 2021 10:39
by Johnr65
Thank you, Mike, once again you've helped me to cut to the chase in simple terms!

Re: Occupation in main fact box
Posted: 03 Sep 2021 15:50
by laz_gen
Yes I did customise the property box back in V6 (before the Preferred Fact feature I think), so have carried these modifications into V7 without realising I now had a little more control of the display of facts in V7.
I actually had "%INDI.OCCU[1]%" as the data reference but have now changed it, and the associated date to show the preferred fact.
I notice other individuals in my file with multiple occupation facts are still defaulted to using the first instance so I can revisit them at my own pace and select a preferred occupation.
Thanks Mike
Re: Occupation in main fact box
Posted: 03 Sep 2021 16:30
by tatewise
See FH Help page
Understanding Data References and scroll down to
Advanced Indices where [preferred] and [prefonly] and other magic is explained. It says there that if no fact is Preferred then the 1st fact is used, unless you use [prefonly].