Exemple #1
0
/**
 * Update or create a list of SugarBeans, returning details about the records created/updated
 *
 * @param String $session -- Session ID returned by a previous call to login.
 * @param String $module_name -- The name of the module to return records from.  This name should be the name the module was developed under (changing a tab name is studio does not affect the name that should be passed into this method)..
 * @param Array $name_value_lists -- Array of Bean specific Arrays where the keys of the array are the SugarBean attributes, the values of the array are the values the attributes should have.
 * @param Array  $select_fields -- A list of the fields to be included in the results. This optional parameter allows for only needed fields to be retrieved.
 * @return Array    'name_value_lists' --  Array of Bean specific Arrays where the keys of the array are the SugarBean attributes, the values of the array are the values the attributes should have.
 *                  'error' -- The SOAP error if any.
 */
function set_entries_details($session, $module_name, $name_value_lists, $select_fields)
{
    $error = new SoapError();
    if (!validate_authenticated($session)) {
        $error->set_error('invalid_login');
        return array('ids' => array(), 'error' => $error->get_soap_array());
    }
    return handle_set_entries($module_name, $name_value_lists, $select_fields);
}
Exemple #2
0
 /**
  * Test if set_entries returns proper IDs for Calls/Meetings
  * with set outlook_id or with equal fields
  *
  * @param $module - Module name
  * @param $outlookID - Outlook ID (must always be set, for the OPI Sync check to be initiated)
  * @param $nameValueLists - name-value lists for set_entries call
  *
  * @dataProvider dataProvider
  * @group 63559
  */
 public function testSetEntriesOPISync($module, $outlookID, $nameValueLists)
 {
     $meeting = SugarTestMeetingUtilities::createMeeting();
     // Set the fields using $nameValueLists, and resave the meeting
     foreach ($nameValueLists[0] as $nameValue) {
         $meeting->{$nameValue}['name'] = $nameValue['value'];
     }
     $meeting->outlook_id = $outlookID;
     $meeting->save();
     // Mock $server and $server->wsdl
     $server = $this->getMock('soap_server', array('register'));
     $server->wsdl = $this->getMock('wsdl', array('addComplexType'));
     // Need name space to be set
     $NAMESPACE = '';
     require_once 'soap/SoapSugarUsers.php';
     require_once 'soap/SoapError.php';
     // Unset $NAMESPACE, it was only needed in SoapSugarUsers.php
     unset($NAMESPACE);
     $actual = handle_set_entries($module, $nameValueLists);
     $this->assertEquals($meeting->id, $actual['ids'][0], 'Meeting not synced properly.');
 }