Apache Version : 2.2.11
MySQL Version : 5.1.30
OS : MS Windows Server 2003 Standard Edition Service Pack 2
PHP : 5.2.8 + PEAR
Sugar Version : 5.2.0a (Build 5447)
Category : Tasks
Hi Folks,
newbie to this forum and also to Sugar. I am in the process of integrating my application with SugarCRM. I have written a custom PHP script that accepts a HTTP Request and then creates a Task in Sugar using the Soap functionality. The HTTP Request is being submitted by a Java class, and I am encoding the request before it is sent (UTF-8 encoding).
I am passing a "start date" and a "due date" in the HTTP request. The format of dates I am passing in to the Task create is "mm/dd/yyyy". In the name->value list I am taking these values from the HTTP request and assigned the values to the names "date_start" and "date_due" respectively. I have included a copy of the PHP script below.
When I submit a HTTP request to my script, the script executes and a Task is successfully created. However, when the Task is created and I go view it in the Task List in Sugar, the Start Date and the Due Date for the task are both blank. All the other data I am sending is working fine (including two custom fields i have added myself). I need the date fields to be populated because I need to be able to filter the Tasks view on the value of the dates.
Is there something wrong with this format? Or is there another reason why the dates I am passing in is not being displayed when I view the Tasks in Sugar?
Hopefully one of you folks can help me out on this, I would be extremely grateful.
Many thanks.
PHP Code:<?php
if(!defined('sugarEntry'))define('sugarEntry', true);
require_once('include/nusoap/nusoap.php');
$soapclient = new nusoapclient('http://localhost/SugarCE/soap.php?wsdl',true);
$user_auth = array(
'user_auth' => array(
'user_name' => 'admin',
'password' => md5('##########'),
'version' => '0.1'
),
'application_name' => 'soaptaskcapture');
$result_array = $soapclient->call('login',$user_auth);
$session_id = $result_array['id'];
$user_guid = $soapclient->call('get_user_id',$session_id);
echo("date_due" . $_POST['date_due']);
echo("date_start" . $_POST['date_start']);
// The following lines will use the set_entry SOAP call to add
// values, then assign to the authenticated Sugar user...
$set_entry_params = array(
'session' => $session_id,
'module_name' => 'Tasks',
'name_value_list'=>array(
array('name'=>'name','value'=>$_POST['name']),
array('name'=>'status','value'=>$_POST['status']),
array('name'=>'priority', 'value'=>$_POST['priority']),
array('name'=>'description','value'=>$_POST['description']),
array('name'=>'date_due','value'=>$_POST['date_due']),
array('name'=>'date_start','value'=>$_POST['date_start']),
array('name'=>'cif_c','value'=>$_POST['cif_c']),
array('name'=>'member_rep_c','value'=>$_POST['member_rep_c']),
array('name'=>'assigned_user_id', 'value'=>$user_guid)));
$result = $soapclient->call('set_entry',$set_entry_params);
?>


LinkBack URL
About LinkBacks



Reply With Quote

Bookmarks