Hi. I work with SugarCRM 5.0.0e in Windows XP.
I want subpanels of the module 'Documents' in module' Accounts' but I'm having some problems.
I did the following:
- In MySQL, created table 'acounts_documents';
- Created the file 'accounts_documentsMetaData.php':
- Changed file 'vardefs.php' module 'Account':Code:$dictionary["accounts_documents"] = array ( 'table' => 'accounts_documents', 'fields' => array ( 0 => array ( 'name' => 'id', 'type' => 'varchar', 'len' => 36, ), 1 => array ( 'name' => 'date_modified', 'type' => 'datetime', ), 2 => array ( 'name' => 'deleted', 'type' => 'bool', 'len' => '1', 'default' => '0', 'required' => true, ), 3 => array ( 'name' => 'accounts_ida', 'type' => 'varchar', 'len' => 36, ), 4 => array ( 'name' => 'documents_idb', 'type' => 'varchar', 'len' => 36, ), ), 'indices' => array ( 0 => array ( 'name' => 'accounts_documentsspk', 'type' => 'primary', 'fields' => array ( 0 => 'id', ), ), 1 => array ( 'name' => 'accounts_documents_ida1', 'type' => 'index', 'fields' => array ( 0 => 'accounts_ida', ), ), 2 => array ( 'name' => 'accounts_documents_idb2', 'type' => 'index', 'fields' => array ( 0 => 'documents_idb', ), ), 3 => array ( 'name' => 'accounts_documents_alt', 'type' => 'index', 'fields' => array ( 0 => 'accounts_ida', 1 => 'documents_idb', ), ), ), 'relationships' => array ( 'accounts_documents' => array ( 'lhs_module' => 'accounts', 'lhs_table' => 'accounts', 'lhs_key' => 'id', 'rhs_module' => 'documents', 'rhs_table' => 'documents', 'rhs_key' => 'id', 'relationship_type' => 'many-to-many', 'join_table' => 'accounts_documents', 'join_key_lhs' => 'accounts_ida', 'join_key_rhs' => 'documents_idb', ), ), ); ?>
- Changed file 'vardefs.php' module 'Documents':Code:$dictionary["Account"]["fields"]["documents"] = array ( 'name' => 'documents', 'type' => 'link', 'relationship' => 'accounts_documents', 'source' => 'non-db', );
- Changed file 'layoudefs.php' module 'Account':Code:$dictionary["Document"]["fields"]["accounts"] = array ( 'name' => 'accounts', 'type' => 'link', 'relationship' => 'accounts_documents', 'source' => 'non-db', );
- Changed file 'layoudefs.php' module 'Documents':Code:$layout_defs["Accounts"]["subpanel_setup"]["documents"] = array ( 'order' => 100, 'module' => 'Documents', 'subpanel_name' => 'default', 'get_subpanel_data' => 'documents', 'add_subpanel_data' => 'documents_idb', 'title_key' => 'lbl_documents', );
- Insert labels in the language file.Code:$layout_defs["Documents"]["subpanel_setup"]["accounts"] = array ( 'order' => 100, 'module' => 'Accounts', 'subpanel_name' => 'default', 'get_subpanel_data' => 'accounts', 'add_subpanel_data' => 'accounts_ida', 'title_key' => 'LBL_ACCOUNTS_SUBPANEL_TITLE', );
When I sign in to SugarCRM and the tab 'Accounts' or' Documents' give me the following error: "Fatal error: Call to a member function getQuery () on a non-object in C: \ Wamp \ www \ Sugar5.0 \ data \ SugarBean.php online 2555 ":
http://www.dibconsulting.com/sites/images/erro1.jpg
I tried to clear the cache and subpanels already appear, but the relationship is wrong. For each document appear all accounts and each account appear all documents (attached image)
http://www.dibconsulting.com/sites/images/error2.jpg
How do I solve this problem?


LinkBack URL
About LinkBacks



Reply With Quote
Bookmarks