我使用SOAP API向SugarCRM添加新潛在客戶。此外,每當創建新的潛在顧客時,我都會使用插件來分配自動遞增的潛在顧客ID(http://www.sugarforge.org/projects/autoincrement/)。SugarCRM - 使用自動遞增的ID添加潛在客戶ID
現在,插件工作正常,如果我通過前端創建新的潛在客戶。但是,如果我使用SOAP API,則不會觸發將自動增量ID分配給潛在客戶的模塊中的功能。
我創建通過
$module = 'Leads';
$params = array(
'session' => $session,
'module_name' => $module,
'name_value_list' => array(
array('name' => 'id', 'value' => ''),
//array('name' => 'int_lead_id_c', 'value' => ''),
array('name' => 'first_name', 'value' => $_POST["first_name"]),
array('name' => 'last_name', 'value' => $_POST["last_name"]),
array('name' => 'phone_home', 'value' => $_POST["phone"]),
array('name' => 'email1', 'value' => $_POST["email"]),
array('name' => 'assigned_user_id', 'value' => '1'),
)
);
//Create the Lead record
$lead_result = $soapclient->call('set_entry', $params);
領先的模塊中的功能是這樣的一個:
class SugarFieldAutoincrement extends SugarFieldBase {
/**
* Override the SugarFieldBase::save() function to implement the logic to get the next autoincrement value
* and format the saved value based on the attributes defined for the field.
*
* @param SugarBean bean - the bean performing the save
* @param array params - an array of paramester relevant to the save, most likely will be $_REQUEST
* @param string field - the name of the field
*/
public function save(&$bean, $params, $field, $properties, $prefix = '') {
}
}
我如何才能確保,這一功能也被觸發,將通過SOAP引線時API?
非常感謝您的幫助! :-)
大衛
我不認爲uuid是一個通用的sql函數,是嗎? – Anthony 2013-06-26 11:59:16