display data stored in one module in another module

I have address field which is stored in accounts module while creating the account. Here what I want is this address field should reflect in all modules can any one clearly explain me about this query .thanks in advance.
Parents
  • --- You need to create the address field in all desired modules.
    (Copy address field defination from \cache\modules\Accounts\Accountvardefs.php and add in your module in upgrade safe manner Path \custom\Extension\modules\YourModule\Ext\Vardefs\yourAddressFied.php )

    After this hit Quick Repair and Rebuild and see address field is created.

    ---  Secondly after adding field you need to show field in editviewdefs.php,detailviewdefs.php.
     (For this copy address field(billing,shipping) arrays from \modules\Accounts\metadata\editviewdefs.php ,\modules\Accounts\metadata\detailviewdefs.php and add in your module's edit/deailviewdefs.php in upgrade safe manner Path :custom/modules/YourModule/metadate/editORdeailviewdefs.php)

    Waleed!
  • HI i have never done this before but i believe it can be done as i have described below.
    - Override the view.detail of quote and in _displaySubPanels() function than based on quote status value enable/disable create button(URL will help you ovveriding view.detaill   )
    http://forums.sugarcrm.com/f6/how-enable-disable-create-sub-panel-button-depending-field-value-68262...
Reply Children
  • I have taken the file view.detail.php file from modules/Accounts/views directory an i have cleared the code in that and added the code given in the link and I have created
    a folder views in custom/modules/qte_Quote/ and I added the view.detail.php file
    in the views folder  and made some necessary changes according to my requirement.

    But when I run this(i.e when I click on testquote) the detail view of this quote not coming infact it is giving some error like ===>
    Parse error: syntax error, unexpected 'protected' (T_PROTECTED) in/opt/lampp/htdocs/SugarCRM/custom/modules/qte_Quote/views/view.detail.php on line 2


     Can You please tell me what is this error and still what should i do within this file.Thanks very much friend for your response.

  • You have syntax error in your code, look closely near line 2. 
  • please check the code which I have in the view.detail.php ===>


    <?php

    protected function _displaySubPanels() 
        { 
            if (isset($this->bean) && !empty($this->bean->id) && (file_exists('modules/' . $this->module . '/metadata/subpaneldefs.php') || file_exists('custom/modules/' . $this->module . '/metadata/subpaneldefs.php') || file_exists('custom/modules/' . $this->module . '/Ext/Layoutdefs/layoutdefs.ext.php'))) { 
                $GLOBALS['focus'] = $this->bean; 
                require_once ('include/SubPanel/SubPanelTiles.php'); 
                $subpanel = new SubPanelTiles($this->bean, $this->module); 
                if($this->bean->name != 'Approved' && !empty($subpanel->subpanel_definitions->layout_defs['subpanel_setup']['qte_quote_cont_contract_1'])) 
                { 
                   foreach($subpanel->subpanel_definitions->layout_defs['subpanel_setup']['qte_quote_cont_contract_1']['top_buttons'] as $key=>$button) 
                   { 
                          if(!empty($button['widget_class']) && $button['widget_class'] == 'SubPanelTopButtonQuickCreate') 
                          { 
                      unset($subpanel->subpanel_definitions->layout_defs['subpanel_setup']['qte_quote_cont_contract_1']['top_buttons'][$key]); 
                          } 
                   } 
                } 
                echo $subpanel->display(); 
            } 
        }  
    ?>
  • Can you tell me which class i should put this code
  • if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');require_once('modules/YourModuleName/views/view.detail.php');

    class CustomYourModuleNameViewDetail extends YourModuleNameViewDetail
    {
     
        function CustomYourModuleNameViewDetail()
        {
            parent::YourModuleNameViewDetail();
        }
     
        protected function _displaySubPanels()
        {

        }
    }
  • friend I dont have folder views in my modules/qte_quote' as this is a custom module. can u tell me how to create this folder anf file view.deatil.php .Thanks

  • Man for custom modules we don't need to shift files in custom directory.
    You can put views folder at module level. like modules/youModule/views/view.detail
    If file or folder does not exist feel free to create it.
  • thanku very very much it works 
  • hi friend can u help me i have stuck up with a problem

  • Seeking help for this thread? ( include\SugarFields\Fields\Address\EditView.tpl
    to custom\include\SugarFields\Fields\Address\EditView.tpl

    And change code in EditView.tpl (P.S not quite easy but feasible)