Sugar SOAP set_entry

I am trying to add entries to the Sugar Contacts database with the following SOAP code in PHP.

$set_entry_params = array(
'session' => $result_array->id,
'module_name' => 'Contacts',
'name_value_list'=>array(
    array('name'=>'Name','value'=>'Brian')
)
);

    $result = $soapClient->__soapCall('set_entry', $set_entry_params);

Recording is performed in sugar db, but the name field remains empty and the Role field is marked: "Pre Sugar Roll Out"

Does anyone know what's wrong here?

+3
source share
1 answer

The problem is probably due to using "Name" as your "name" in "name_value_list". The "Name" field is simply a concatenation of the "first_name" and "last_name" fields. Try:

$set_entry_params = array(
'session' => $result_array->id,
'module_name' => 'Contacts',
'name_value_list'=>array(
    array('name'=>'first_name','value'=>'Brian')
)
);

    $result = $soapClient->__soapCall('set_entry', $set_entry_params);
0
source

Source: https://habr.com/ru/post/1750229/


All Articles