[Vtigercrm-developers] creating potentials through webservice gives database error

lucia digirolamo l.digirolamo at websonica.net
Wed Mar 30 09:46:03 GMT 2016


Hi,

I'm trying to create a potential through webserice with this code:

[... here goes login parameters ..]

if(!$login) echo 'Login Failed';
else {

$module = "Potentials";
$recorddata = array(
         'potentialname' => 'test',
         'related_to' => '3x95460', // (moduleId x recordId) such as 3x95460
         'closingdate' => date('Y-m-d'),
         'sales_stage' => 'Closed Lost',
         'amount' => '2000',
         'contact_id'=>'4x97106',
     );
$record = $client->doCreate('Potentials', $recorddata);
     $wasError = $client->lastError();
     if ($wasError) {
         echo $wasError['code'] . ':' . $wasError['message'];
     }

}

I know that login is correct because I get no 'login failed message' and 
because other things (such as doDescribe or doQuery) works, so I can 
successfully connect

I know that doCreate works because I tried with Leads and I got no error 
at all.

I know it's not about missing mandatory fields because the original code 
had no 'contact_id' and the error code /message shown clearly said that 
mandatory contact_id had no value.

When I added contact_id, I got no 'mandatory field missing' message. 
Instead I got this:

DATABASE_QUERY_ERROR: LBL_DATABASE_QUERY_ERROR

I looked up in the internet but  I couldn't find much explanation. I 
tried to look in the database potential table but without a clear idea 
of what to look for, everything seemed normal to me.

What's the error for? How can I get rid of it?

Vtiger version is 6.4 (migrated in time from an original 5.4. Migration 
has not been done recently in only one step. Crm has been updated as 
soon as new version were available)







More information about the vtigercrm-developers mailing list