Change contact assigned from call, duplicates calls

Hello all

I am using SugarCRM v7.9.8.
We have realized an strange behaviour. If I have a call, “Call 1” created and assigned/related to Contact A, when we open/edit the call to replace the related contact, to Call B, and save it, instead of having just Call1 with “ContactB” related, we end with two calls

“Call1” with “Contact A” and
“Call2” with “Contact B”

So then we need to remove/delete “Call1” manually, and checking this and deleting calls manually delays our work a lot.

How can we get this solved?

Thanks a lot!

Hi,
From where you are editing the “Call1”?
Can you please share the screenshot?

Thanks

Hello

We just go to the Call List view, in one of the calls we click on the “pencil” icon to open it in “Edit Mode”, and there we just select another contact and save it.
Then you get the same call “twice” but with two contacts.

Lest see if the screenshots can help:

Is there any Hook implemented in the Calls module??
It look like something is happening by the back-end code.

Thanks

Hello

In the logic hoos we have for calls we do not have anything that seems to be affected to this behaviour.

We call in a “before_save” to this two functions

Class CallHooks
{

/*****************************************************************************
* La función Inscripcion comprobará si la llamada es de tipo Captación y si está
* Completada, si es así asignará la respuesta del campo inscripcion_c al contacto asignado a la llamada
********************************************************************************/

public static function Inscripcion($bean, $event, $arguments)
    {	

       global $current_user;

        if (($bean->status == 'Held')&&($bean->direction=='selection'))
         {
            // PRimero conseguimos el contacto relacionado con la llamada

           $bean->load_relationship('contacts');

           $contactIds = $bean->contacts->get();

           if(sizeof($contactIds>=1))
           {
             foreach($contactIds as $contactId)
                {
                  $contactAux= new Contact();
                  $contactAux->retrieve($contactId);
                }


           // Ahora comprobamos el proyecto al que está relacionado el usuario
           // Para ver a cual actualizamos el campo "Inscrito"
                  $proyectoAux= FuncionesComunes::ObtenerSecurityNameUsuario($current_user->id);
                  switch ($proyectoAux)
                        {
							   case 'Asi':
                                                $contactAux->inscrito_ASI_c=$bean->inscripcion_c;
                             case 'CHAS':
                                                $contactAux->inscrito_CHAS_c=$bean->inscripcion_c;



                        }//End of Switch
                   $contactAux->save();
                }// End if sizeof >=1
         } // End if condicion general para entrar en hook.



}// End of function

/**********************************************************************
         *  Esta funciĂłn, se lanzara en un logic_hook before save y despendiendo del usuario
         *  activo que cree una llamda se le asignará el proyecto al que pertenezca en ese momento.
         */
        public static function AsignarProyecto($bean, $event, $arguments)
        {

                // Primero Obtenemos el securityname del usuario

                global $current_user;

                $proyecto = FuncionesComunes::ObtenerSecurityNameUsuario($current_user->id);

                $bean->proyecto_c=$proyecto;



        }// End Of Function

}// End of Class
?>

							 

But it is only when the call is saved as “Held” (first funciton) and in the second we just add a value to a custom fiend depending on the “creator user”… apart from this, we do not have any other back-end code in Calls