[FX.php List] Multiple Record edit

Steve Winter steve at bluecrocodile.co.nz
Tue Jun 26 11:22:01 MDT 2007


Hi William,

First off, welcome to the wonderful world of FX :-)

With regard to your current problem, two thoughts/observations...

1. Do you have a field in your database called 'recid' which is a
calculation containing the record id for each record...? if not, then that
could be your problem...

With FX the record id is actually returned as a component of the array key
for each record... if you do a print_r($assignConResult['data']) you will
see that the keys of that array are of the form xxx.yy where xxx is the
recid and yy is the modid...

So the equivalent of your foreach loop could be something like;
foreach ($foundContacts as $key => $value) {
  $recordPointers = explode('.',$key);
  array_push ($theRecIDs,$recordPointers[0]);
  }		

2. On this line;
   $assignNew[$counter]->AddDBParam('-recid',$theRecIDs['recid'][$counter]);
It appears that you're your recids are in a 'sub-component' of the array
$theRecIDs called 'recid', where as in the foreach above, you seem to be
pushing them into the 'root' of that array;
  array_push ($theRecIDs,$value['recid'][0]);

So assuming that observation 1 above isn't valid, and you have a recid field
in your db, then that could well be the cause of your issues...

Get back to us if you need anything further...

Cheers
Steve

-----Original Message-----
From: fx.php_list-bounces at mail.iviking.org
[mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of William Downs
Sent: Tuesday, 26 June 2007 5:53 p.m.
To: fx.php_list at mail.iviking.org
Subject: [FX.php List] Multiple Record edit

Hi There

I am new to this list, and rather new to FX.php / Filemaker.

I am having an issue with a multiple record edit - the foundContacts
are supposed to receive a new SalesID.

Code:
$foundContacts = $assignConResult['data'];

if ( is_array ($foundContacts) ) {
	$theRecIDs = array();
   foreach ($foundContacts as $key => $value) {
   array_push ($theRecIDs,$value['recid'][0]);
			}
	}

$counter = 0;

while ($counter < $countSelected) {

	$fmTarget 	= 'NeSales.fp7';
	$groupSize	= 'all';
	$assignNew[$counter] = new FX($serverIP,$webCompanionPort,'FMPro7');
	$assignNew[$counter]->SetDBData($fmTarget,'WebAssign',$groupSize);
	$assignNew[$counter]->SetDBPassword($webPassword,$webUser);
	
$assignNew[$counter]->AddDBParam('-recid',$theRecIDs['recid'][$counter]);
	$assignNew[$counter]->AddDBParam('fkSales',$newSalesID);
	
	$assignNewEdit[$counter]=$assignNew[$counter]->FMEdit();
	
$counter++;
}

Perhaps someone would be kind enough to point out what I am doing
wrong - the recid's are not being sent to the database. Any help
greatly appreciated

William
_______________________________________________
FX.php_List mailing list
FX.php_List at mail.iviking.org
http://www.iviking.org/mailman/listinfo/fx.php_list

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.476 / Virus Database: 269.9.8/869 - Release Date: 25/06/2007
5:32 p.m.
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.476 / Virus Database: 269.9.8/869 - Release Date: 25/06/2007
5:32 p.m.
 




More information about the FX.php_List mailing list