I am experiencing a serious case of code blindness.
I have a piece of code and am trying to add a metafield to an existing source like this (p is the pointer to the source):
px = fhGetItemPtr(p,'SOUR.~NM-PERSOON') -- works as expected
xx = fhGetValueAsText(px) -- also ok
pz = fhCreateItem('SOUR.~NM-PERSOON_2', p) -- (null) Why?
bOk = fhSetValueAsText(pz, xx) -- false
What am I missing?
* Creating a metafield
- tatewise
- Megastar
- Posts: 27080
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Creating a metafield
Should be:
pz = fhCreateItem('~NM-PERSOON_2', p)
p is already pointing to SOUR and the fhCreateItem function needs the tag/shortcut of the child item to create.
pz = fhCreateItem('~NM-PERSOON_2', p)
p is already pointing to SOUR and the fhCreateItem function needs the tag/shortcut of the child item to create.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Re: Creating a metafield
Thanks Mike!