Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Field access problem with FilleMaker 5 and FX.php

Featured Replies

  • Newbies

Hi everybody,

I'm having a big problem in my work. I need to publish databeses using FX.php. I'm abble to connect the database, check data but I can't access to the linked fields of my database. I've checked that all tables where shared on the web with FM companion but when I try to access to a field linked using relatonship The field appear empty.

Here is my code (based on the exemples of FX) B)

$BushingQuery = new FX($serverIP, $webCompanionPort);

$BushingQuery->SetDBData("Bushing request.fp5");

$arrayName = 'HTTP_' . $HTTP_SERVER_VARS["REQUEST_METHOD"] . '_VARS';

if (${$arrayName}['currentSort'] != '')

{

$BushingQuery->AddSortParam($HTTP_GET_VARS['currentSort']);

}

if (${$arrayName}['currentQuery'] == 'search orders')

{

foreach ($$arrayName as $key => $value)

{

if ($key != 'currentSort')

{

$BushingQuery->AddDBParam($key, $value);

}

$currentSearch .= '&' . "$key=" . urlencode($value);

}

$BushingData = $BushingQuery->FMFind();

}

else

{

$currentSearch = '';

$BushingData = $BushingQuery->FMFindAll();

}

$counter = 1;

if ($BushingData['foundCount'] > 0)

{

foreach ($BushingData['data'] as $key => $value)

{

$recordID = strtok($key, '.');

-------------------------------------------------------------------

$value['Revision'][0]; (Work to call a field)

$value['STATUS::CUSTOMER'][0]; (Doesn't work for a linked field)

-------------------------------------------------------------------

}

}

My relationship's name is STATUS and my field's name is CUSTOMER.

Regarding to the documentation it is supposed to work ...

I'm really disapointed with this problem. If someone could help me :grin: :grin: ...

If someone has an exemple of the way he can access to related fields using fx.php, please post it :

Thank you all for your help

Howdy from Texas!

I have included a snippet of some working code which I use for a WAP/WML solution I have created for bringing Filemaker data to my mobile users. It includes reference to a field through a relationship.

A point to note (which you may already be aware of) is that your fields should appear on your layout that the query is referencing. I notice that your SetDBData line does not specify a layout.

Your SetDBData line reads:

$BushingQuery->SetDBData("Bushing request.fp5");

and should probably be something like:

$BushingQuery->SetDBData("Bushing request.fp5", "name-of-your-layout");

I normally create a specific layout for my web services which includes all (local and related) fields I expect to reference. In my case below, the layout name in the file "schedule.fp5" is "web".

- - - - - - - - - -

include ("FX/FX.php");

include ("FX/prefs.php");

// Schedule Mode - Client passed $worksched in URL

if (isset($_REQUEST[ 'worksched' ]))

$mode = 'schedule';

// Set up the query

$SchQuery = new FX($FMAddress, $FMPort);

$SchQuery->SetDBData ('schedule.fp5', 'web', 999);

$SchQuery->SetDBPassword ($syspassword, $sysusername);

$SchQuery->AddDBParam ('SchedDate',$worksched,'eq');

$SchQuery->AddDBParam ('RecordType', 'Labor', 'eq' );

// Get the data

$SchResult = $SchQuery->FMFind();

echo "Returned from query...Found = " . $SchResult['foundCount'] ."<br/>n";

// If we returned data, iterate through the found set.

if($SchResult['foundCount'] > 0) {

foreach($SchResult['data'] as $CRecord){

echo $CRecord['PO_Nbr'][0] . " - ";

echo $CRecord['Main::ContactName'][0] . " - ";

echo $CRecord['InstallType'][0] . " - ";

if ( $CRecord['Installer'][0] == "" ) {

echo "N/A";

}

else {

echo $CRecord['Installer'][0];

}

echo "<br/>n";

}

}

else echo "<br/>No Jobs Found<br/>";

- - - - - e n d o f s n i p p e t - - - - - - - - - - - - - -

regards...

Bob Minteer

CTO / IT Manager

Cooper Flooring, LTD.

  • Author
  • Newbies

Yaouuuuuuuuuu !!!

Minteer I would like to thank you a lot. The problem was due to the layout. I didn't specified any layout and that's why the related links were not working.

I'm now able to do what I need so thank you B)-)

See you

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.