[FX.php List] I need a refresher

Steve Winter steve at bluecrocodile.co.nz
Fri Dec 9 05:35:37 MST 2011


Hi Bob

Ummm, ok, if you say so… though the error here is 507 which is validation by calculation, not 500, which is the date validation error code…

In the SyncDek docs it says to paste three SyncDek fields into your table definition. The fields are:



The second of those has Always Validate, By Calculation set

And when I try and look at the calculation on my computer, which doesn't have any of the SyncDek stuff on it, then the definition is

If( Get(AccountName) = "SyncDeK" or $$syncdek_off ; True ;
    <Function Missing>( GetFieldName(SyncDeK_RecId) ; SyncDeK_RecId ; Get(AccountName) )
)

So - If John has that that field in his table, and he tries to update that table using a web connection, where the SyncDek plugin isn't available, then that calc will fail, and a 507 error will be generated…

All idle speculation of course, but the diagnosis fits the symptoms :-)

Cheers
Steve

> Steve,
> 
> I don't think SyncDeK is the issue; I haven't used FMDataGuard but have 2 huge systems using SyncDeK (total of 4 servers). We don't have the SyncDeK plugin installed on the server at all, and are running about 10 web apps that use FX.php.
> 
> Here's something that has happened to me in the past: database has a date field, user types in something silly like "December 8, 2011", which fails validation. We have a ticketing app, in fact, where someone was typing in "Saturday" because they ignored the instruction to use dd/mm/yy. I solved that by using 3 pulldowns (1 each for month, day, & year), so that the use is forced to submit the date in a format that FileMaker would accept.
> 
> Date fields will more commonly fail validation since text can be anything, but FileMaker wants to see an actual date in a date field.
> 
> I don't know about FMDataGuard since I haven't used it, but live in SyncDeK every day, and other than putting a TCP/IP plugin on the client machines, haven't put any plugins on the 4 machines running SyncDeK. There's no extra step for enabling SyncDeK for web app use.
> 
> 
> Bob Patin
> Longterm Solutions LLC
> bob at longtermsolutions.com
> 615-333-6858
> http://www.longtermsolutions.com
> FileMaker 9, 10 & 11 Certified Developer
> Member of FileMaker Business Alliance and FileMaker TechNet
> --
> Twitter: bobpatin
> Google+: http://www.longtermsolutions.com/plus
> AIM: longterm1954
> iChat: bobpatin
> --
> Expert FileMaker Consulting 
> FileMaker Hosting for all versions of FileMaker
> 
> 
> 
> 
> 
> On Dec 9, 2011, at 1:20 AM, Steve Winter wrote:
> 
>> The username/password thing must be a red herring (UK expression, umm, misleading variable?) since you have them just as 'wrong' in the case where it does work, so that can't be the issue.
>> 
>> As I said yesterday 507 is data validation by calculation failure. As I said almost every time I see that error it's the DataGuard plugin. Well, DataGaurd - SynDek, same dog, different name (umm, NZ expression, you say tomato I say tomato etc etc).
>> 
>> The way both of those systems work is to use a validation calculation to call a plugin - if the plugin isn't there, then the va;libation returns 0, and you get error 507.
>> 
>> The plugin can either be on the local machine, or on the server, but for web access the plugin needs to be double-installed on the server, once in the  regular server plugins folder, once in a special web plugins folder (which depending on your version of FMS moves around a bit, and may not exist).
>> 
>> I've had a quick look on the SyncDek site, but they seem to have changed their documentation and made it non-searchable so I can't seem to find the instructions, but to do a quick test to sees that this is what's mucking things up, locate the SyncDek field SyncDek_ModDateTime and turn off the validation on that field and try again, I've got 2p that says with that turned off it'll work…
>> 
>> Then all you need to do is find out how you enable SyncDek for web access and all will be well again...
>> 
>> Cheers
>> Steve
>> 
>> 
>>> Hey guys thanks for your brain power on this. Tomorrow I will try switching PW & UN. I have never had trouble in the past with this.
>>> But I did just think of a possible issue with the FM table I am using.
>>> The table is in a solution that uses SyncDek to sync data to India and SyncDek requires a special field for a primary key and I wonder if that calculated field is preventing editing from XML. (The FileMaker client requires a plugin to be present for data entry)
>>> I will switch tables and test the exact script, I bet it will work.
>>> Thanks again,
>>> John
>>> 
>>> 
>>> On 12/8/11 9:55 PM, "Bob Patin" <bob at patin.com> wrote:
>>> 
>>>> That *is* interesting; somewhere in the past I had username & pw backwards and it just didn't do anything at all... but I don't remember what the error message was. In fact, as I think of it, I don't think it returned any error code...
>>>> 
>>>> 
>>>> Bob Patin
>>>> Longterm Solutions LLC
>>>> P.O. Box 3408
>>>> Brentwood, TN 37024
>>>> bob at longtermsolutions.com
>>>> 615-333-6858
>>>> http://www.longtermsolutions.com
>>>> iChat: bobpatin
>>>> AIM: longterm1954
>>>> Twitter: bobpatin
>>>> Google+: http://www.longtermsolutions.com/plus
>>>> --
>>>> FileMaker 9, 10 & 11 Certified Developer
>>>> Member of FileMaker Business Alliance and FileMaker TechNet
>>>> --
>>>> FileMaker hosting and consulting for all versions of FileMaker
>>>> PHP • Full email services • Free DNS hosting • Colocation • Consulting
>>>> On Dec 8, 2011, at 9:27 PM, Jonathan Schwartz wrote:
>>>> 
>>>>> Agreed...so how is the Find query getting results using the same flawed parameter setting?
>>>>> 
>>>>> Jonathan Schwartz
>>>>> Exit 445 Group
>>>>> 415-370-5011
>>>>> 
>>>>> On Dec 8, 2011, at 16:37, Bob Patin <bob at patin.com> wrote:
>>>>> 
>>>>>> Jonathan's exactly right; password first, then username.
>>>>>> 
>>>>>> 
>>>>>> Bob Patin
>>>>>> Longterm Solutions LLC
>>>>>>  <mailto:bob at longtermsolutions.com> bob at longtermsolutions.com
>>>>>> 615-333-6858
>>>>>>  <http://www.longtermsolutions.com/> http://www.longtermsolutions.com <http://www.longtermsolutions.com/> 
>>>>>> FileMaker 9, 10 & 11 Certified Developer
>>>>>> Member of FileMaker Business Alliance and FileMaker TechNet
>>>>>> --
>>>>>> Twitter: bobpatin
>>>>>> Google+:  <http://www.longtermsolutions.com/plus> http://www.longtermsolutions.com/plus
>>>>>> AIM: longterm1954
>>>>>> iChat: bobpatin
>>>>>> --
>>>>>> Expert FileMaker Consulting 
>>>>>> FileMaker Hosting for all versions of FileMaker
>>>>>> 
>>>>>> On Dec 8, 2011, at 6:01 PM, Jonathan Schwartz wrote:
>>>>>> 
>>>>>>> John,
>>>>>>> 
>>>>>>> Two suggestions:
>>>>>>> 
>>>>>>> 1) check the order of parameters for SetDBUserPass. Doesn't the Pass come first?
>>>>>>> 
>>>>>>> 2) Reduce the problem query to just an edit request on a single record. Hardcore the recid. At least you will know that you are dealing with a single issue, rather than  one involving a query and edit of multiple records on a loop.
>>>>>>> 
>>>>>>> Try that and see where you get. 
>>>>>>> 
>>>>>>> Jonathan Schwartz
>>>>>>> Exit 445 Group
>>>>>>> 415-370-5011
>>>>>>> 
>>>>>>> On Dec 8, 2011, at 11:21, John Funk < <mailto:jfunk at criticalsolution.com> jfunk at criticalsolution.com> wrote:
>>>>>>> 
>>>>>>>> Hi,
>>>>>>>> I am a bit rusty at PHP and FX....I have some code below that I need to figure out why I keep getting an error 507 error.
>>>>>>>> The script works “getting” the three FileMaker records that match the $Item string.
>>>>>>>> I just cannot figure out why it will not edit the record with the $RecID
>>>>>>>> Thanks for any help.
>>>>>>>> John Funk
>>>>>>>> 
>>>>>>>> <?php
>>>>>>>> require_once ('FX/FX.php');
>>>>>>>> require_once ('FX/server_data.php');
>>>>>>>> define('DEBUG', True); 
>>>>>>>> 
>>>>>>>> //Get Item Info from URL
>>>>>>>> $Item=$_REQUEST['Item'];
>>>>>>>> $Date=$_REQUEST['Date'];
>>>>>>>> 
>>>>>>>> //echo "Item=".$Item.'<br>';
>>>>>>>> //echo "Date=".$Date.'<br>';
>>>>>>>> //exit;
>>>>>>>> 
>>>>>>>> //GETTING THE ARRAY OF RECORDS WORKS
>>>>>>>> $groupSize='10';
>>>>>>>> $request = new FX($ServerIP, $Port, $DataSourceType);
>>>>>>>> $request->SetDBData($fmdb,'XML_Items',$groupSize);
>>>>>>>> $request->SetDBUserPass($fmAccount, $fmPass);
>>>>>>>> $request->AddDBParam('ItemNumber_Prism', "=".$Item);
>>>>>>>> $result =$request->FMFind();
>>>>>>>> $records =$result['data'];
>>>>>>>> 
>>>>>>>> foreach($records as $record)
>>>>>>>> {
>>>>>>>> $RecID=$record['recid'][0];
>>>>>>>> $TCIN=$record['ItemNumber_Prism'][0];
>>>>>>>> $ASIN=$record['ASIN_Prism'][0];
>>>>>>>> $ImageUploadedDate=$record['ImageUploadedDate'][0];
>>>>>>>> $Notes=$record['Notes'][0];
>>>>>>>> 
>>>>>>>> //EDITING THE EACH RECORD DOES NOT WORK
>>>>>>>> $request = new FX($ServerIP, $Port, $DataSourceType);
>>>>>>>> $request->SetDBData($fmdb,'XML_Items',1);
>>>>>>>> $request->SetDBUserPass($fmAccount, $fmPass);
>>>>>>>> $request->AddDBParam('-recid', $RecID);
>>>>>>>> $request->AddDBParam('Notes', ‘TEST’);   //FAILS HERE with 507
>>>>>>>> $result = $request->FMEdit();
>>>>>>>> 
>>>>>>>> }
>>>>>>>> 
>>>>>>>> ?>
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> _______________________________________________
>>>>>>>> FX.php_List mailing list
>>>>>>>>  <mailto:FX.php_List at mail.iviking.org> FX.php_List at mail.iviking.org
>>>>>>>>  <http://www.iviking.org/mailman/listinfo/fx.php_list> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>>>>> _______________________________________________
>>>>>>> FX.php_List mailing list
>>>>>>>  <mailto:FX.php_List at mail.iviking.org> 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
>>>>> 
>>>> 
>>>> 
>>>> _______________________________________________
>>>> 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
>> 
>> 
> 
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list

Steve Winter
+44 777 852 4776
steve at bluecrocodile.co.nz



-------------- next part --------------
Skipped content of type multipart/related


More information about the FX.php_List mailing list