Rebuilding Field List doesn't and deletes CONTACTS table

Support, Tips and Tricks for Proof Group's fmSpark "merge anything" utility for FileMaker Pro.
Posts: 2
Joined: Mon Feb 02, 2009 11:07 pm
PostPosted: Mon Feb 02, 2009 11:38 pm
I have successfully repointed the three orange Table Occurrences to my contacts file. Triple checked!
When I try to rebuild the Field List, it doesn't. It deletes the CONTACTS table from the Table list, and leaves no fields showing in the Field List.
If I add CONTACTS back in using the [New Table] button, the same thing happens - it is immediately deleted again.
It all works perfectly when the 3 orange table occurrences are repointed back to your sample contacts table, but repointing back to my own contacts file does not work.
Using the debugger, it seems that an additional table is created, called - (that is a hyphen), then both - and CONTACTS are deleted in the [remove unused MergeTable records] script.
Any suggestions? Is it something to do with the fmSparkUtil.fp7 file being locked up even though your site specifically says that fmSpark is completely unlocked?
Or could it be that all my fields have a standardized labeling format _001_RecordID_n and if this is the cause, then why?
I've tried it on both my Mac and then on Windows, just to see if it made a difference.
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Tue Feb 03, 2009 7:15 am
Hi Vivienne,

I'm going to write up something on the way we handle field names and get back to you asap.

As for the locked file, fmSparkUtil.fp7 contains nothing but the MailIt plugin registration code. When one purchases a developer license of a plugin the manufacturers require that you prevent others from extracting the dev license registration, so you put it in a locked file. If you already had a site license for the MailIt plugin, we'd provide an unlocked copy of fmSparkUtil.fp7, so you could remove it from the solution.
Last edited by John Sindelar on Thu Feb 05, 2009 6:49 am, edited 1 time in total.
John Sindelar
SeedCode
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Tue Feb 03, 2009 7:44 am
Hello again,

Yes, it is the opening underscore in your field name. fmSpark is scripted to specifically ignore fields and table occurrences beginning with an underscore so that you can use this convention to keep developer fields out of your list of possible merge fields.

However, if the primary key you use to link your table to fmSpark begins with an underscore, then fmSpark can't see the table and you've seen what happens next.

I imagine you don't want to rename your fields, so you can change this behavior in fmSpark instead.

1. You'll find the test for "_" a few places in the scripts (below). You can choose to either replace the "_" with a new developer prefix or remove it all together. Here are a couple examples...

The first place fmSpark tests for this is in the script "rebuild sysFields". Find the comment "build reduced table list" and the finds the Loop after that. The second SetVariable within the loop looks like this:

Code: Select all
Case (
   Left ( $theTableName; 1 ) <> "_";
   $newTableList & $theTableName & ¶;
   $newTableList
)


To test for another developer prefix, perhaps "_z" you might change that calc to this:

Code: Select all
Case (
   Left ( $theTableName; 2 ) <> "_z";
   $newTableList & $theTableName & ¶;
   $newTableList
)


To remove the feature all together and always include all fields in the merge, you'd change the calc to this:

Code: Select all
$newTableList & $theTableName & ¶


2. Next, edit the script "create mergeField records ( tableName*; fieldName*; suppressTag )". Find the comment "sets default tag to ignore underscores to preserve previous behavior." You'll want to edit the following SetVariable line which currently reads like this:

Code: Select all
Let ( _tag = GetValue ( Get ( ScriptParameter ); 3 ); Case ( IsEmpty ( _tag ); "_"; _tag ) )


To test for a different test, change this to simply the prefix you wish to test for:

Code: Select all
"_z"


Unfortunately in this part of the script you have to test for something, so to include all your fields (to remove the test) just test for something that will never prefix your fields, like:

Code: Select all
"0000"


That's it.

I hope that helps get you moving forward again.
John Sindelar
SeedCode
Posts: 2
Joined: Mon Feb 02, 2009 11:07 pm
PostPosted: Thu Feb 05, 2009 3:14 am
Hi John

Thanks very much for your very detailed reply. I've chosen to take advantage of the convention you've used, so all fields I don't want the user to see now have _ in front of their names, and all fields I do want them to see are in plain text. Great idea! I'll keep you post handy, however, in case i want to change it

Thank you!
Vivienne

Return to fmSpark

Who is online

Users browsing this forum: No registered users and 3 guests

cron
(855) SEEDCODE
[email protected]
Follow us: