Page 2 of 2
Re: fh.getParam question
Posted: 08 Mar 2021 08:32
by JoopvB
The version I attached yesterday evening (too) late is not 100%. Will fix it this morning and send it for testing. Sorry.
Re: fh.getParam question
Posted: 08 Mar 2021 08:38
by ColeValleyGirl
No problem, Joop. I will wait.
Re: fh.getParam question
Posted: 08 Mar 2021 09:09
by JoopvB
This is the one that works.
As always ... all suggestions for improvement are welcome.
Re: fh.getParam question
Posted: 08 Mar 2021 10:06
by ColeValleyGirl
Joop, that seems to work well.
Do you envisage that it will be used on sources which have already had their template fields populated? If so, the old template data is thrown away when the template is changed. Have you considered perhaps presenting the old data and/or Text from Source and the new empty fields so that users can cut and paste the data into new fields if relevant? It would be a more complex interface, of course, and you may not wish to do it. If you don't do it, a warning to users about data loss might be appropriate.
(By the way, I still have on my to-do list looking at the plugin you wrote "Convert generic source to template")
Re: fh.getParam question
Posted: 08 Mar 2021 11:07
by JoopvB
Helen, thanks for testing.
I used it on sources with their template fields populated and the data was not thrown away but kind of hidden. I then used the source records overview and from there had access to all data to cut/paste it. The best proof that data is not thrown away is by changing a record to a new (very different template) and then change it back again. Should be unchanged.
You're right however that this is quite cumbersome, but the alternative of building a more elaborate user interface seemed a lot of work and involving iup (and I really don't like to go down that road

). Indeed before publishing it in the store I planned to include a warning about how to handle data from fields missing in the target template.
If you have ideas about how the mapping of old template to new template fields can be done with fh.getParam, I'd be glad to incorporate it.
About the Convert Generic to Templated plugin... let me update that one with a usable user interface and I'll share that one here to test it.
Re: fh.getParam question
Posted: 08 Mar 2021 11:19
by ColeValleyGirl
JoopvB wrote: ↑08 Mar 2021 11:07
If you have ideas about how the mapping of old template to new template fields can be done with fh.getParam, I'd be glad to incorporate it.
I was wondering about something simple, using a single multiline text field in getParam to display the old values
e.g. field label: text (which would either be the text value or a text representation of a link) and a number of fields for the new template (which could be generated dynamically as getParam is data table driven). Users could cut and paste from the old values to the new... For each source, you'd pop-up a tailored getparam dialog, and save the results when the users had tinkered...
A more sophisticated approach would look for fields with similar types/names e.g. TX-ADDRESS and repopulate them automatically but that's further than I'd envisage going.
re the multiline field, there's a parameter for string fields:
lines: makes the field multiline and with a height of the number given for the lines value (1.9 #99)
About the Convert Generic to Templated plugin... let me update that one with a usable user interface and I'll share that one here to test it.
Thanks.