<div dir="ltr">Thank you very much Stefan!<div><br></div><div>In my case I wasn't setting the "visibility" property since it's not listed as mandatory when you run a "describe".</div><div><br></div>
<div>Setting this property has fixed the issue.</div><div><br></div><div>I guess the API should be updated to list this property as mandatory, or a default value should be set on "create".</div><div><br></div><div>
Max</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Apr 9, 2014 at 7:08 PM, Stefan- Setras LLC <span dir="ltr"><<a href="mailto:stefan@setras.net" target="_blank">stefan@setras.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Max,<br>
<br>
had the same problem. Here is the code that worked for me<br>
<br>
$vEvent = array(<br>
'subject' => 'Call back - ' .<br>
$contact_form->posted_data['companyname'] . ' | ' .<br>
$contact_form->posted_data['title'] .<br>
' '<br>
. $contact_form->posted_data['firstname'] . ' ' .<br>
$contact_form->posted_data['firstname'],<br>
'date_start' => date("d-m-Y"),<br>
'time_start' => date("H:i:s",(time() +<br>
300)),<br>
'due_date' => date("d-m-Y"),<br>
'time_end' => date("H:i:s",(time() +<br>
500)),<br>
'eventstatus' => 'Planned',<br>
'activitytype' => 'Call',<br>
"visibility" => "Public",<br>
'assigned_user_id' => '20x17',<br>
'parent_id' => $vid,<br>
'duration_hours' => '0',<br>
'duration_minutes' => '5',<br>
'description' =><br>
$contact_form->posted_data['Message'] ,<br>
);<br>
$objectJson = json_encode($vEvent);<br>
<br>
$params = array("sessionName"=>$vtiger_sessionId,<br>
"operation"=>'create',<br>
"element"=>$objectJson, "elementType"=>' Events');<br>
$vtiger_httpc->post("$vtiger_endpointUrl", $params, true);<br>
$response = $vtiger_httpc->currentResponse();<br>
<br>
Good luck,<br>
Stefan<br>
<br>
============================================================================<br>
====<br>
<br>
Message: 3<br>
Date: Wed, 9 Apr 2014 17:40:07 +1000<br>
From: Max Clarke <<a href="mailto:max@smarte.com.au">max@smarte.com.au</a>><br>
To: <a href="mailto:vtigercrm-developers@lists.vtigercrm.com">vtigercrm-developers@lists.vtigercrm.com</a><br>
Subject: [Vtigercrm-developers] Webservices create Calendar record<br>
fails<br>
Message-ID:<br>
<<a href="mailto:CABee08fWYMHJx%2BmeT5xEHJXfXVDoCCvCSF1577ppPQjjVoZBAQ@mail.gmail.com">CABee08fWYMHJx+meT5xEHJXfXVDoCCvCSF1577ppPQjjVoZBAQ@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<div><div class="h5"><br>
Hi guys,<br>
<br>
Is anyone else having trouble creating Calendar items in 6.0 using<br>
Webservices API? I'm using code that was working on 5.4, but now it's<br>
throwing:<br>
<br>
WebServiceException: LBL_DATABASE_QUERY_ERROR<br>
<br>
This happens on a blank 6.0 installation.<br>
<br>
Thanks<br>
<br>
Max<br>
<br>
<br>
</div></div>_______________________________________________<br>
<a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a><br>
</blockquote></div><br></div>