2026-08-05 Updated for RM11
This Gemini generated script updates from the RM7 version below with the added features that the RM People View gets the column Date Last Edited updated for the affected persons and the BirthYear in various displays is set. Also, instead of the ‘Before’ prefix being added to the Date and SortDate, the ‘By’ prefix as was suggested in a Comment is applied.
Birth-AddFromChristenBaptism_RM11_ByDate
The procedure with Gemini started with a rather simple prompt that included the original script, requesting it to check for compatibility with RootsMagic 11, update it accordingly, and to propose any improvement in the code. The first response was excellent, collapsing the script from multiple statements into a single, efficient query. However, Gemini hallucinated that the FactTypeID for Baptism (7) had been swapped with that for Burial (4) after RM7. Subsequently, as I added the updating for Date Last Edited and BirthYear displays in RM11, Gemini added additional statements, a temporary table and enclosed the set in a transaction.
RootsMagic 7, as does some other software, uses the date of the Christen event as a substitute birth date for age calculations and summary displays when there is no Birth event. But RootsMagic’s own mobile application for iOS and Android does not. Moreover, some users object to using the Christen fact type, on principle or perhaps having already extensively used the Baptism fact type and not wanting to have to change those instances one at a time, just to get the benefit of the auto-substitution. If that is all that is wanted, then the script Facts – Change Fact Type should suffice. This script removes the reliance on auto-substitution by creating a Birth event from the Christen or Baptism event for all persons having one or more of those but no Birth event.
Birth-AddFromChristenBaptism.sql
-- Birth-AddFromChristenBaptism.sql /* 2017-02-11 Tom Holden ve3meo For persons having no Birth event but with either a Christen or Baptism event, adds a Birth event duplicating the CHR or BAPM event. It does not copy citations or media and does not modify the Date or SortDate. If a person has both CHR and BAPM, it copies CHR. If a person has multiple CHR or BAPM events, it copies only one which with priority given to IsPrimary and secondly to lowest SortDate. */
…and it does not replicate sharers if the source event is shared.
A useful query. I am new to Rootsmagic, and new to Sqlite. It took me a while to understand how this works. While I like the idea of creating a birth event to everyone, I didn’t want to just replicate the baptism date. Originally I wanted to create a birth fact with a date estimated a week earlier than the baptism. But on second thought I didn’t want to introduce a date that would most of the time be inaccurate. So I went with using the baptism date with a date qualifier. I wanted a qualifier that I didn’t use elsewhere, so that when perusing my tree I could easily know that a birth date was based on a baptism date. I settled on “By”. So-n-so was born by . After a number of stabs in the dark, I found a way to use the “Birth-AddFromChristenBaptism.sql” with some added code to accomplish my new birth fact.
Where the code reads:
INSERT INTO EventTable
SELECT * FROM vNewBirth
I substituted the following:
INSERT INTO EventTable
SELECT EventID
,EventType
,OwnerType
,OwnerID
,FamilyID
,PlaceID
,SiteID
,(SUBSTR(date,1,1) || “Y” || SUBSTR(date,3)) as date
,SortDate
,IsPrimary
,IsPrivate
,Proof
,Status
,EditDate
,Sentence
,Details
,Note
FROM vNewBirth
The letter ‘Y’ as the second character in the date string equals “By”. Other letters could be used instead: Before, B; the following are the 13th character: About, A; Estimated, E; Circa, C; Say, S
And, voila, 2000+ birth facts added, based on baptism dates.
Updated for RM 11, changed date prefix to ‘by’ instead of ‘before’, added update to ‘Date last edited’ for People view.