Hello,
I created a module using the moduleCreator in sugarcrm 6.3.1 on my development version.
I have two related fields. the first for country of departure and arrival of the second for country arrival and I want to fill dynamically the value of name field
example :
related 1 = USA Related 2 : SWISS so the name is filled automatically USA/SWISS.
For this i have modified the file mymodule.php and add the save function like this:
My Problem is that the save function does not works and not override the basic save function.Code:function mymodule(){ parent::mymodule_sugar(); } } /**Cette fonction permet de renseigner le nom du rooting dynamiquement**/ function save($check_notify = FALSE){ $n=$_POST['ville_depart']."/".$_POST['ville_arrive']; $sql1 = "SELECT id FROM swpv_swroutingvilles WHERE swpv_swvilles_id_c= '".$_POST['ville_depart']."' AND swpv_swvilles_id1_c= '".$_POST['ville_depart']."'"; $result1 = $this->db->query($sql1); $num_row = $this->db->getRowCount($result1); $row1 = $this->db->fetchByAssoc($result1); if($num_row==0) { $this->name=$n parent::save($check_notify); } else {$this->id=$row1['id']; $this->name=$n parent::save($check_notify); } }
thanks for your help and sorry for my english![]()


LinkBack URL
About LinkBacks




Reply With Quote


Bookmarks