[英]How to create an Activity with vTiger webservice?
我正在使用php創建活動。
我不知道為什么,最后一個var_dump就像“布爾假”。 這是我的代碼。
$today=getdate();
$today=date("Y-m-d");
var_dump($today);
$modulet='Calendar';
$insertt= Array(
'subject'=>'Call',
'activitytype'=>'Task',
'date_start'=>$today,
'due_date'=>$today,
'assigned_user_id'=>$vtiger->_userid ,
'time_start'=>'09:00:00',
'time_end'=>'17:00:00',
'sendnotification'=>'0',
'status'=>'Not Started',
'priority'=>'High',
'notime'=>'0',
'visibility'=>'Private'
);
var_dump($insertt);
$recordtask = $client->doCreate($modulet, $insertt);
var_dump($recordtask);
檢查$vtiger->_userid
19x1
$vtiger->_userid
的格式是否為19x1
(模塊X user_id),而不僅僅是整數值(例如1
)。 如果使用vTiger的vtwsclib中的WSClient.php,則實際上可以忽略它。
這是doCreate代碼。
/**
* Do Create Operation
*/
function doCreate($module, $valuemap) {
// Perform re-login if required.
$this->__checkLogin();
// Assign record to logged in user if not specified
if(!isset($valuemap['assigned_user_id'])) {
$valuemap['assigned_user_id'] = $this->_userid;
}
$postdata = Array(
'operation' => 'create',
'sessionName' => $this->_sessionid,
'elementType' => $module,
'element' => $this->toJSONString($valuemap)
);
$resultdata = $this->_client->doPost($postdata, true);
if($this->hasError($resultdata)) {
return false;
}
return $resultdata[result];
}
也許您想var_dump
$resultdata
而不是庫的結果,這只是一個布爾值
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.