Jump to content

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

Recommended Posts

Posted

Hi, I am trying to add a new record to FM 7 using FX. The new record is added; however, the returned data set has no data. It is supposed to have the values of the just created record. Here is my code:

$result=$NewData->FMNew();

$recKey = key($result['data']);

$recordPointers = explode (".",$recKey);

$recID = $recordPointers[0];

RecID is null.

Any ideas will be very appreciated! Thank you very much

Posted

That what it looks like:

fx_error Object ( [error_message_prefix] => [mode] => 1 [level] => 1024

 => 100 [message] => FX: ExecuteQuery XML error: no element found at line 1 [userinfo] => [backtrace] => Array ( [0] => Array ( [file] => /Library/WebServer/Documents/SSD_new/include/FX.php [line] => 879 [function] => fx_error [class] => fx_error [type] => -> [args] => Array ( [0] => ExecuteQuery XML error: no element found at line 1 ) ) [1] => Array ( [file] => /Library/WebServer/Documents/SSD_new/include/FX.php [line] => 1041 [function] => executequery [class] => fx [type] => -> [args] => Array ( [0] => -new ) ) [2] => Array ( [file] => /Library/WebServer/Documents/SSD_new/include/FX.php [line] => 1107 [function] => fmaction [class] => fx [type] => -> [args] => Array ( [0] => -new [1] => 1 [2] => full ) ) [3] => Array ( [file] => /Library/WebServer/Documents/SSD_new/new_ticket.php [line] => 34 [function] => fmnew [class] => fx [type] => -> [args] => Array ( ) ) ) [callback] => ) 

Does it tell you about anything?

Thank you very much for your help!

Posted

Here is what a basic - create a new record should look like:

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

$newrecord->SetDBData('Order.fp5','ForWeb');

$newrecord->AddDBparam('OrderID', '');

$newrecordResult=$newrecord->FMNew();

foreach($newrecordResult['data'] as $key=>$newrecordData);

$recordDetails = explode('.',$key);

$currentrecord=$recordDetails[0];

Then I might set a cookie:

setcookie("orderID", $currentrecord, time()+60*60*24,"/");

This could also be done with sessions.

Hope this helps - but also consider FXForge from the people at FMWebschool (FXforge.net)

Posted

I am working with FM 7. Anyways - tried that. It looks like it does not return data only if I am using particular layouts. If I use layout that contain ONLY fields from this database - it returns data. If I use layout that contains fields from related db's - it does not. User names and passwords are identical for all the related databases. Also, if the record is being created - I can't see it via FMPXMLRESULT link using layouts other than the one that was used to create it. I've spent so much time trying to figure this out and I am getting really frustrated...:

Please help....

Posted

having not seen your whole code, can't check to see what you might have missed. I just went through a similar problem and was missing:

$newrecord->SetDBPassword($db_password); //$db_password is defined in fx_server.php

The other steps - which you have have done - are to reduce the number of fields you are trying to create in the new record and see if you can get one field to work.

Also looking at your array you printed, there appear to be some files missing or errors in your coding. Check line 34 of new_ticket.php

If you are having huge frustrations, I'm sure there are many coding experts that for an hours worth of billable time could review in detail your files and make the corrections necessary.

This topic is 7284 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.