Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Script that was working now isn't but no errors are returned...???


This topic is 6031 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted (edited)

I've got a basic insert record script setup that was working when I initially set it up and now I can't get anything out of it. Not an error, not a new record. Here's what I'm working with:


<?php

include_once('FileMaker.php');



// Open file outside of web root which contains FM credentials.  This is for security purposes.

$FMCredentialsPath = "C:PATH_TOfmCredentials.xml";

if(!$FMCredentials = simplexml_load_file($FMCredentialsPath))

	exit("There was an error opening the credentials file");

	

$APIUsername = $FMCredentials -> APIUsername;

$APIPassword = $FMCredentials -> APIPassword;



define('FM_HOST', 'filemaker.ourdomain.com');

define('FM_USER', $APIUsername);

define('FM_PASS', $APIPassword);

define('FM_FILE', 'Invoices');



$FMSession = new FileMaker(FM_FILE, FM_HOST, FM_USER, FM_PASS);



$FMDisputeRecordFields = array(

								'txn_id' => '123456789', 

								'txn_type' => 'new_case', 

								'case_id' => 'PP-123-456', 

								'case_type' => 'Dispute', 

								'reason_code' => 'Non-receipt', 

								'status' => 'Open'

							   );

							   

$FMDisputeRecord = $FMSession -> createRecord('PayPalDisputesDev', $FMDisputeRecordFields);

$FMDisputeRecord -> commit();

		

if (FileMaker::isError($FMDisputeRecord)) 

{	



	echo $FMDisputeRecord -> getMessage();

	

	$mail -> Subject  =  'FileMaker Error Adding New Dispute';

	$mail -> Body =  "Error: " . $FMDisputeRecord -> getMessage();

	$mail -> AddAddress("[email protected]", "Andrew Angell");

	$mail -> Send();

}

else

	echo "FM Insert command completely successfuly.";

?>

When I run that I'm getting the message that the command completely successfully. When I look at the DB, though, no new record is getting created.

When I first wrote this yesterday it was working for me. Any information on what might be going on here would be greatly appreciated. Thanks!

Edited by Guest
Posted

Doh! This gets me every single time! Man it's hard to get used to this.

I had this all setup and working like I said, and then I did end up adding a new field into the DB and I also added the new field into my script's insert code. However, I did NOT add the new field to the actual layout that I was hitting with this particular script.

I don't know why I wasn't getting an error back but I re-write a new script and then I did get a "field not found" error which is when it dawned on me.

This topic is 6031 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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