[FX.php List] Display Calc Field from Related data - RESOLVED

Jonathan Schwartz jonathan at eschwartz.com
Fri Sep 29 09:35:49 MDT 2006


OK. I see what was going on here.  I'm going to reveal what the problem is/was.

For the benefit of all who can benefit from my error...

Are you ready....?

The problem...is...the relationship was based on a global value.   Arggh!

I had set up the relationships with a variable key (based on a global 
value set at startup) to provide flexibility to view active/inactive 
records in the FMP native portal.  I used that same relationship on 
the web layout and again in the script.  Since the global is never 
set when FMSA accesses the data, the result data was always "zero" 
and the script bombed.

By creating a new relationship, all the flakiness i described went away.

Put another notch in the belt.   This one really cost me a lot of time. ;-)

Hope this benefits others.

Jonathan

>What you describe here is the only reason to use FM script with XML;
>post processing of data.
>
>I use set field to a non-calculation field to achieve what you are asking for
>
>ggt667
>
>On 9/28/06, Jonathan Schwartz <jonathan at eschwartz.com> wrote:
>>This is a continuation of the previous post regarding scripts in my
>>challenge to produce summary data from related tables.   I changed
>>direction on how to display my summary data from the related tables,
>>taking Andrew's suggestion. Now, I use php and portals to display the
>>data directly from the related tables on a summary page.
>>
>>The problem...I still have one or two fields that require a
>>calculation based on data in the related tables: a simple count()
>>records.  To my surprise, I've realized the fx will not return a
>>value from a calc field unless the field is indexed.  FMP refuses to
>>index because it is based on a related field. Catch 22.
>>
>>Is this accurate?
>>
>>Movining to another mehtod, I remember discussion of using a regular
>>field with a lookup, but could not figure out how to do that. Self
>>join and triggered by.....?
>>
>>Finally, I tried to populate the single field with a one-line
>>script...but I just can't get ANY scripts to work AT ALL from fx.php.
>>This one was a simple Set Field.
>>
>>So, I've run out of tools to produce this "simple" result....almost.
>>
>>My last hope is to execute a a query in the target related table,
>>collect the foundCount result and save it for my result.  Seems like
>>a long way to go.
>>
>>Any suggestions?
>>
>>Thanks
>>
>>
>>Jonathan
>>
>>
>>
>>
>>
>>--
>>
>>Jonathan Schwartz
>>FileMaker 8 Certified  Developer
>>Associate Member, FileMaker Solutions Alliance
>>Schwartz & Company
>>jonathan at eschwartz.com
>>http://www.eschwartz.com
>>http://www.exit445.com
>>415-381-1852
>>
>>_______________________________________________
>>FX.php_List mailing list
>>FX.php_List at mail.iviking.org
>>http://www.iviking.org/mailman/listinfo/fx.php_list
>>
>_______________________________________________
>FX.php_List mailing list
>FX.php_List at mail.iviking.org
>http://www.iviking.org/mailman/listinfo/fx.php_list


-- 

Jonathan Schwartz
FileMaker 8 Certified  Developer
Associate Member, FileMaker Solutions Alliance
Schwartz & Company
jonathan at eschwartz.com
http://www.eschwartz.com
http://www.exit445.com
415-381-1852



More information about the FX.php_List mailing list