I am having an awful time getting a subpanel to display. I could really use some guidance. I have followed the Wiki article, Creating 1-to-many relationships in Sugar 5.0.
1. I have created a custom relate field in the child module: client_name_c
the relate field acts properly in edit view, but then once saved, it doesn't update - no data in any view, nor in the database table.
(There is a relate field already which works, but it's in the main table, not the custom table - I built it before I knew there would be a need for a subpanel. Could this be conflicting?)
2. Added the field to the edit view and detail view
3. Editted vardefs:
custom/Extension/modules/Accounts/Ext/Vardefs/vardefs.php
4. Ran Quick Repair and Rebuild, and Rebuild Relationships.Code:$dictionary['Account']['relationships']['account_YRE08_Year_End_2008'] = array( 'lhs_module' => 'Accounts', 'lhs_table' => 'accounts', 'lhs_key' => 'id', 'rhs_module' => 'YRE08_Year_End_2008', 'rhs_table' => 'yre08_year_end_2008_cstm', // must use custom table as we're using a custom Relate field in step 4 'rhs_key' => 'client_name_c', // must match the name of the field containing the PARENT id in the CHILD_cstm table 'relationship_type' => 'one-to-many' // one LHS to many RHS ); $dictionary['Account']['fields']['client_name_c'] = array ( 'name' => 'client_name_c', 'type' => 'link', 'relationship' => 'account_YRE08_Year_End_2008', 'source'=>'non-db', 'vname'=>'LBL_YRE08_Year_End_2008', ); //<LBL_FIELD_LABEL> can be anything you want, but it must match the key you use in the language file later on ?>
I have iterated through a great deal of different ideas, and have led myself to confusion and doubt. Any assistance from someone who knows how to do this is greatly appreciated.


LinkBack URL
About LinkBacks



Reply With Quote
Bookmarks