3

I am trying to add entries to a 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);

An entry is made in the sugar db, but the name field is left blank and the Role field is labelled: Pre Sugar Roll Out

does anyone know what is wrong here?

Anthony
  • 36,459
  • 25
  • 97
  • 163
Brian
  • 26,662
  • 52
  • 135
  • 170

1 Answers1

0

The issue is probably due to using "Name" as your "name" in teh "name_value_list". The "Name" field is just a concactonation 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);
Anthony
  • 36,459
  • 25
  • 97
  • 163