Hi,
I am trying to set the team of a record to a certain Team always, no matter who created it. I am using the view.edit.php, I have done this before for many other modules ot inherite the Team of the Parent Record..
I have the following code in the view.edit.php in the display function
PHP Code:
function display(){
$this->ev->process;
$query="SELECT id from teams WHERE name = 'Area 886' ";
$res=$this->bean->db->query($query);
$row=$this->bean->db->fetchByAssoc($res);
If(!empty($row)){
$this->ev->fieldDefs['team_id']['value'] = $row['id'];
$this->ev->fieldDefs['team_set_id']['value'] = $row['id'];
}
parent::display();
}
I have echoed the ID of the Team that is selected in the Query and it is correct, I have also Echoed $this->ev->fieldDefs['team_id']['value'] and the Team_Set_id after setting them and they are both correct.
But when I create/edit a record the Team is not set and it is going to the users default team. Any one noticed an issue with the code?
Rgds
Chris
Bookmarks