Template selection per merge group

Support, Tips and Tricks for Proof Group's fmSpark "merge anything" utility for FileMaker Pro.
Posts: 123
Joined: Tue Jul 15, 2008 12:41 am
Location: Perth Western Australia
PostPosted: Tue Aug 05, 2008 11:16 pm
Hi John

After I have implemented a second merge group and tested it, I thought it would be nice to have only templates displayed which are related to my merge group in the Create New... screen.
As I am using a different table connection, letters from a different merge groups would not work anyway.
Not sure if this should already work like that? It doesn't for me.
Just thought I let you know for your further development of the product.

For the moment I have solved the problem by creating a different category dealing with these letters, but it won't stop the user from using a different letter from a different merge group and ending up with not resolved merge fields.

I looked into the scripts and coding, but as you know yourself, if you haven't designed a database its quite hard to get your head around and adjusting it without destroying any other functionality.

If you have any tip for me, how to solve this, it would be greatly appreciated.

Kind regards

Regine
SeedCode Staff
SeedCode Staff
Posts: 2759
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Wed Aug 06, 2008 8:11 am
Hi Regine,

I hear you. Showing only templates linked to your merge group is something we indeed have planned for a future version. Unfortunately, I don't think this is a behavior you can easily change in the current version. But I'll look into what might be involved.

Thanks,
John Sindelar
SeedCode
SeedCode Staff
SeedCode Staff
Posts: 2759
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Wed Aug 06, 2008 8:42 am
I do love it when tricky things are easier than expected! And the guys at Proof did an *amazing* job at making fmSpark easy to mod.

So, of you want to narrow the available templates to just those tagged to the current merge group, make the following changes:

1. In the fmSparkData file, add a global text field called gGroup to the Category table.

2. In the relationship graph of fmSpark, find the table occurrence "_Category Templates" and make a new instance of that named "_Category Group Templates". Create a relationship from this to "_selected Category" that is JUST like the one from "_selected Category" to "_Category Templates", making sure to copy the sort order of the relationship as well. Now add an additional match criteria to the relationship, from gGroup in "_selected Category" to GroupID in "_Category Group Templates.

3. Edit the script "cmd - perform command ( command*; "parameter" )" and find the comment "gather matching templates for category" about 3/4 of the way through the script. Two lines after that you'll see we're setting the field gCategoryID. Add a new SetField() right after that and set _Category::gGroup to "If ( IsEmpty ( _app::gGroup ) ; List ( _all MergeGroups::Group ) ; _app::gGroup )" (without the quotes).

4. Continue editing this script; the next line in the script sets a variable $templateIDList to "List ( _Category Templates::ID )". Change that to "List ( _Category Group Templates::ID )" (without the quotes). Note that this line is the only change you need to undo if you want to remove this mod.

That's it!
John Sindelar
SeedCode
Posts: 123
Joined: Tue Jul 15, 2008 12:41 am
Location: Perth Western Australia
PostPosted: Wed Aug 06, 2008 9:57 pm
Hi John

Thanks for that, that is really fantastic and it works perfect.

I had figured out that the templates are assigned in the script step, which your step 3 is referring to, but without knowing the database, it would have taken me ages to achieve this.

Thanks heaps.

Kind regards

Regine

Return to fmSpark

Who is online

Users browsing this forum: No registered users and 2 guests

cron
(855) SEEDCODE
support@seedcode.com
Follow us: