Skip 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.

Update child records with parent record

Featured Replies

  • Newbies

I have a FM7 layout that has demographic data from one table (contacts)

First_Name

Last_Name

It has address and phone info from two other tables (contact and address) in this layout. These are both 1-many relations based on a contact_id.

I can display all data and update data from the

contact table. I cannot update data from the

dependent tables.

Using print_r() the layout data looks like

[First_Name] => Array

(

[0] => Rich

)

[Last_Name] => Array

(

[0] => Gregory

)

[uIP_Contact_Address::Address_Type] => Array

(

[0] => Local Address

[1] =>

[2] =>

[3] =>

)

[uIP_Contact_Address::Address_Street1] => Array

(

[0] => 1630 Secretarys Road

[1] =>

[2] =>

[3] =>

)

I have the

set up so that the address fields are arrays, like this code snippet:

Local Address

Street Line 1

Street Line 2

City/State/Zip

Country:

which is created from this PHP snippet

$address_array =

array( "Local Address",

"Permanent Address", "Summer Address", "Aux Address");

$maxsize = sizeof( $address_array);

$data_array = $instanceData['UIP_Contact_Address::Address_Type'];

for ($i = 0; $i < $maxsize; $i++)

{

if( strlen( trim(

$instanceData['UIP_Contact_Address::Address_Type'][$i])) > 0)

{

// display DB value

$mykey = $i;

echo "

" . $address_array[$i] . "�n";

echo "

Street Line 1" .

"

"value='" . $instanceData['UIP_Contact_Address::Address_Street1'][$mykey] .

"'>

n";

echo "

Street Line 2" .

"

"value='" . $instanceData['UIP_Contact_Address::Address_Street2'][$mykey] .

"'>

n";

echo "

City/State/Zip" .

"

" .

"

"value='" .

$instanceData['UIP_Contact_Address::Address_City'][$mykey] . "'>n ";

echo "

"value='" .

$instanceData['UIP_Contact_Address::Address_State'][$mykey] . "'>n ";

echo "

"value='" .

$instanceData['UIP_Contact_Address::Address_Zip'][$mykey] . "'>n ";

echo "Country: " .

"

"value='" .

$instanceData['UIP_Contact_Address::Address_Country'][$mykey] . "'>n " .

"

n";

} // found in db

I echo all the correct data in the action PHP program that does the FMEdit().

I just cannot find the syntax to update the child

records. The parent record is updated fine with

$editData->AddDBParam( '-recid', $recID);

$editData->AddDBParam('First_Name', $First_Name);

$editData->AddDBParam('Last_Name', $Last_Name);

The complete PHP code for the display of the data in a form and the handler program is found in

http://128.143.31.105/php8/uip/fmforum.help.zip

thanks

rich

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.