Hi, I have created a new module, with a relate to account name, and a subpanel showing in standard account module. Is it possible to search within the account module only those with custom fields from the custom module?
Hi, I have created a new module, with a relate to account name, and a subpanel showing in standard account module. Is it possible to search within the account module only those with custom fields from the custom module?
Hi, almafer
Can you explain your needs again?
Cheers
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.
Of course!
I have made a custom module (with module creator built in sugar 5.00f), regarding some kind of products. It works, and I have also a subpanel linked to standard Sugar account module. Well, my question is: how can I do a search (in module account) with a specific product; I want to view all the accounts which have a specific product (in order to do campaign etc).
Thanks!!!
Almafer
Any advice? Please help!
Hi, Almafer.
Bellow are the steps and tricks:
You have to create an extended vardefs for the Accounts module including or modifying the field which defines the Product module. In the code bellow I added the related field Account into a custom module and this field is available into Basic Search of the Custom module. You will apply the equivalent for Accounts module.
This piece of code defines the relationship between the default Account module and the custom module related to Accounts.PHP Code:'account_name' =>
array (
'required' => '1',
'source' => 'non-db',
'name' => 'account_name',
'rname' => 'name',
'vname' => 'LBL_ACCOUNT_NAME',
'type' => 'relate',
'massupdate' => 0,
'comments' => '',
'help' => '',
'duplicate_merge' => 'disabled',
'duplicate_merge_dom_value' => 0,
'audited' => 0,
'reportable' => 0,
'len' => '255',
'id_name' => 'account_id',
'module' => 'Accounts',
'studio' => 'visible',
'link' => 'account_link',
),
'account_link' =>
array (
'name' => 'account_link',
'type' => 'link',
'relationship' => 'lgs_suport_accounts',
'vname' => 'LBL_ACCOUNT_NAME',
'link_type' => 'one',
'module' => 'Accounts',
'bean_name' => 'Account',
'source' => 'non-db',
),
There is a bug into data/SugarBean.php which cause a sql error in some situation.PHP Code:'lgs_suport_accounts' =>
array (
'lhs_module' => 'Accounts',
'lhs_table' => 'accounts',
'lhs_key' => 'id',
'rhs_module' => 'lgs_Suport',
'rhs_table' => 'lgs_suport',
'rhs_key' => 'account_id',
'relationship_type' => 'one-to-many',
),
You can fix it modifying the line
For this onePHP Code:$where = preg_replace('/(^|\s)' . $join_table_name . '\./', '${1}' . $params['join_table_alias'] . '.', $where);
CheersPHP Code:$where = preg_replace('/(^|\s?)' . $join_table_name . '\./', '${1}' . $params['join_table_alias'] . '.', $where);
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.
Aha! I think you are on to the solution I need as well. Although I am trying to do something a little different..
I am trying to add a custom relate field from Leads to a custom module to the Mass Update subpanel.
I have added the following to define the fields in the vardefs of Leads to set massupdate to true, but I was doing it with true, not 1... Does that make a difference? It's still not working. Please help me figure out what I've got wrong here:
I have changed the source from 'non-db' to 'custom_fields', as I read in this forum somewhere that was a change for defining custom fields 5.0.0x (I'm f right now, I know I need to upgrade to g, but let's get this working first...)PHP Code:'assigned_team_id' =>
array (
'name' => 'assigned_team_id_c',
'rname' => 'name',
'id_name' => 'teams_teams_id_c',
'vname' => 'LBL_ASSIGNED_TEAM',
'type' => 'relate',
'link'=>'assigned_team_link',
'table' => 'teams_teams',
'isnull' => 'true',
'module' => 'teams_teams',
'dbType' => 'varchar',
'len' => 'id',
'source'=>'custom_fields',
'reportable'=>false,
'massupdate'=> 1,
),
'assigned_team_link' =>
array (
'name' => 'assigned_team_link',
'type' => 'link',
'relationship' => 'leads_assigned_team',
'link_type'=>'one',
'side'=>'right',
'source'=>'custom_fields',
'vname'=>'LBL_ASSIGNED_TEAM',
),
I have also defined the relationship like this: (again in vardef on Leads - should this be on the custom module 's vardef instead, since it goes the other way?)
I also found a relationship table in the sql and have added this relationship there as well. But still the field does not appear in Mass Update.PHP Code:,'lead_assigned_team'=> array(
'lhs_module' => 'teams_teams',
'lhs_table' => 'teams_teams',
'lhs_key' => 'id',
'rhs_module' => 'Leads',
'rhs_table' => 'leads_cstm',
'rhs_key' => 'teams_teams_id_c',
'relationship_type' => 'one-to-many'
)
Finally, let me say this: what I'd really like to do is be able to import info to this custom relate field right from the beginning. I've been able to map data to the field in the import (as I do with assigned user id) but the data doesn't stick. I believe these two issues are the same. I simply need to define the relationship between Leads and my custom module in the right place.
Thanks in advance for helping with my code!
Last edited by tomatosld; 2008-08-03 at 07:20 PM.
Thanks alot andopes. I can finally search on account name in my custom module.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks