Hi,
Is it possible that when I create any record under an Account that this new record is automatically assigned to the same team as the Account is - rather then the users private team??
Rgds
Chris
Hi,
Is it possible that when I create any record under an Account that this new record is automatically assigned to the same team as the Account is - rather then the users private team??
Rgds
Chris
Hi Chris
Are you using any licensed version (PRO, ENT)?
I believe it is possible to perform creating any Workflow.
Best regards.
André Lopes
DevToolKit / Project of the Month - June 2009
Lampada Global Services- Open Source Solutions
Avenida Ipiranga, 318
Bloco B - CJ 1602
São Paulo, SP 01046-010
Brazil
Office: +55 11 3237-3110
Mobile: +55 11 7636-5859
e-mail: andre@lampadaglobal.com
Lampada Global delivers offshore software development and support services to customers around the world.
Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.
I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.
Yes - We have the Pro version - I will look into this thanks.
Hi Chris,
I think this can be done in a number of ways:
1) via a workflow - you would need to create a workflow for each module related to accounts.
2) via logic hooks - this reqires some PHP code.
3) via inheritable fields (auto-populate the value when creating a new child from a subpanel)
Here is some more info on option 3:
Auto-populate the PARENT value when creating a new CHILD from the subpanel
Edit the following file (create if necessary):
If your CHILD module is an OOB Module:
custom/modules/<CHILD>/views/view.edit.php (Ext mechanism cannot be used)
If your CHILD module is a Custom Module:
modules/<CHILD>/views/view.edit.php
(modules/CHILD/views/view.edit.php) The Custom Relate field is not automatically filled in when you click on the Create button on the subpanel to create a new CHILD record. The following is one way to do it, using a custom EditView for the CHILD module to extract the PARENTs information from the form post data. (With thanks to David O'Keefe - see thread http://www.sugarcrm.com/forums/showthread.php?p=91427 for his original description of this solution)
<?php
require_once('include/MVC/View/views/view.edit.php');
class <CHILD>ViewEdit extends ViewEdit{
function <CHILD>ViewEdit() {
parent::SugarView();
}
function display(){
$this->ev->process();
if (empty($this->ev->focus->id) && ($_REQUEST['parent_type'] == '<PARENT>'&& isset($_REQUEST['parent_name']) && isset($_REQUEST['parent_id']))) {
$this->ev->fieldDefs['<FIELDNAME>_c']['value'] = $_REQUEST['parent_name'];
$this->ev->fieldDefs['account_id_c']['value'] = $_REQUEST['parent_id'];
}
echo $this->ev->display();
}
}
Make sure the 'account_id_c' is the correct DB field. account_id_c is created if using the Accounts module. Adjust this name based on the parent module. (ptemplin7 03/19/2008)
Best regards,
John
Provident Technology Ltd
50 Clontarf Rd
Clontarf
Dublin 3
Ireland
Ph: +353 1 4403685
Last edited by maloner; 2008-09-01 at 11:07 AM.
Hello,
I try to do this function and I have the next display():
function display() {
$this->ev->process();
// in case of new record
if (empty($this->ev->focus->id)) {
if (!empty($_REQUEST['return_id'])) {
require_once('modules/Accounts/Account.php');
$My_bean = new Account();
$My_bean->retrieve($_REQUEST['return_id']);
$this->ev->fieldDefs['team_name']['value'] = $My_bean->team_name;
$this->ev->fieldDefs['team_id']['value'] = $My_bean->team_id;
//echo " $My_bean->team_id $My_bean->team_name";
}
}
echo $this->ev->display($this->showTitle);
}
The field "$My_bean->team_id" returns the correct value but the problem is that result don't appear in the field 'team_id'... Can anybody help me?
Hi, nobody knows the answer?
Finally, I found the correct solution:
function display() {
$this->ev->process();
if (!empty($this->ev->fieldDefs['account_name']['value'])){
$focus = new Contact();
$query="select team_id,team_set_id from accounts where accounts.id = '".$this->ev->fieldDefs['account_id']['value']."'";
$res=$focus->db->query($query);
$row=$focus->db->fetchByAssoc($res);
if (!empty($row)) {
$this->ev->fieldDefs['team_id']['value'] = $row['team_id'];
$this->ev->fieldDefs['team_set_id']['value'] = $row['team_set_id'];
}
}
echo $this->ev->display($this->showTitle);
}
Last edited by interfaceiberica; 2010-12-13 at 10:55 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks