Page 1 of 1
fhOutput
Posted: 21 Aug 2012 12:04
by MartinA
Here's another one.
Is it possible to make the output a link to the record? At the moment it is a bit of a pain finding the name and then having to go to the record separately.
Martin
ID:6448
fhOutput
Posted: 21 Aug 2012 12:36
by Jane
Yes, just make sure you use an item type and pass in the pointer.
eg
Code: Select all
tblRecord[count] = ptrIndividual:Clone()
fhOutputResultSetColumn('Record', 'item', tblRecord, #tblSurname, 140, 'align_left')
fhOutput
Posted: 21 Aug 2012 12:48
by MartinA
Thanks Jane. I'll play with that.
Martin
fhOutput
Posted: 21 Aug 2012 16:27
by MartinA
Sorry Jane, that proved a bit too abbreviated for me. Can you expand a bit further please?
Martin
fhOutput
Posted: 21 Aug 2012 20:33
by Jane
You are already building a table with the values in.
So you need to put a clone of a pointer in rather than the name of the person. Hence the first line.
Then when you add the column to the output you need to use 'Item' the second line.
If you look at the code for a plugin like 'Search All Possible Names' you can see a more detailed example.
Here is a quick loop
Code: Select all
local tblRecord = {}
pi = fhNewItemPtr() -- declare pointer
pi:MoveToFirstRecord('INDI') -- and set to the first record.
while pi:IsNotNull() do
table.insert(tblRecord,pi:Clone())
pi:MoveNext()
end
fhOutputResultSetColumn('Record', 'item', tblRecord, #tblRecord, 140, 'align_left')
I have added a more detailed example to the wiki [wiki]plugins:code_snippets:result_set_creation[/wiki]
fhOutput
Posted: 22 Aug 2012 09:08
by MartinA
Thanks Jane, that's the explanation I needed. I'd been looking at your 'related media' code, but got bogged down in the numerous pointers and your use of 'fhGetValueAs Link' which didn't seem to do the same for me.
Still I'm sure I'll sort it out now. I've just managed tob output a simple table that works.
Martin