{"id":141,"date":"2019-08-25T07:56:46","date_gmt":"2019-08-25T07:56:46","guid":{"rendered":"https:\/\/www.techcrm.in\/blogs\/?p=141"},"modified":"2020-09-08T14:55:35","modified_gmt":"2020-09-08T09:25:35","slug":"add-custom-subpanel","status":"publish","type":"post","link":"https:\/\/www.techcrm.in\/blogs\/add-custom-subpanel\/","title":{"rendered":"Add custom subpanel"},"content":{"rendered":"\n<p>We have consider Accounts\u00a0 module. There comes the time when sales rep finds it irritating to view opportunities Closed Won and Closed Lost under same subpanel. <\/p>\n\n\n\n<p>Lets make custom subpanels separating Closed Won and Closed Lost. <\/p>\n\n\n\n<p>In this blog post, we will add those subpanels under Accounts module. <\/p>\n\n\n\n<p><strong>Step 1 :\u00a0<\/strong>Create custom\/Extension\/modules\/Accounts\/Ext\/Layoutdefs\/&lt;any_name>.php and write the following code into it. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php \n$layout_defs['Accounts']['subpanel_setup']['opp_closed_lost'] =\n        array('order' => 49,\n            'module' => 'Opportunities',\n            'subpanel_name' => 'ForAccounts',\n            'get_subpanel_data' => 'function:get_closed_lost_closed_won_opportunities',\n            'generate_select' => true,\n            'title_key' => 'LBL_OPPORTUNITIES_WITH_CLOSED_LOST',\n            'top_buttons' => array(),\n            'function_parameters' => array(\n                'import_function_file' => 'custom\/modules\/Accounts\/customOpportunitiesSubpanel.php',\n                'sales_stage' => 'Closed Lost',\n                'account_id' => $this->_focus->id,\n                'return_as_array' => 'true'\n            ),\n);\n$layout_defs['Accounts']['subpanel_setup']['opp_closed_won'] =\n        array('order' => 50,\n            'module' => 'Opportunities',\n            'subpanel_name' => 'ForAccounts',\n            'get_subpanel_data' => 'function:get_closed_lost_closed_won_opportunities',\n            'generate_select' => true,\n            'title_key' => 'LBL_OPPORTUNITIES_WITH_CLOSED_WON',\n            'top_buttons' => array(),\n            'function_parameters' => array(\n                'import_function_file' => 'custom\/modules\/Accounts\/customOpportunitiesSubpanel.php',\n                'sales_stage' => 'Closed Won',\n                'account_id' => $this->_focus->id,\n                'return_as_array' => 'true'\n            ),\n);<\/code><\/pre>\n\n\n\n<p><strong>Step 2 :<\/strong>\u00a0Create custom\/modules\/Accounts\/customOpportunitiesSubpanel.php and write following code into it. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php \nfunction get_closed_lost_closed_won_opportunities($params) {\n    $args = func_get_args();\n    $opportunitiesSalesStage = $args[0]['sales_stage'];\n    $accountId = $args[0]['account_id'];\n    $return_array['select'] = \" SELECT opportunities.*\";\n    $return_array['from'] = \" FROM opportunities \";\n    $return_array['where'] = \" WHERE opportunities.deleted = '0' AND opportunities.sales_stage = '\" . $opportunitiesSalesStage . \"'\";\n    $return_array['join'] = \" INNER JOIN accounts_opportunities ON accounts_opportunities.opportunity_id = opportunities.id AND accounts_opportunities.deleted = '0' INNER JOIN accounts ON accounts.id = accounts_opportunities.account_id AND accounts.deleted = '0' AND accounts.id = '\" . $accountId . \"'\";\n    $return_array['join_tables'] = '';\n    return $return_array;\n}<\/code><\/pre>\n\n\n\n<p><strong>Step 3 :<\/strong>\u00a0Create custom\/Extension\/modules\/Accounts\/Ext\/Language\/en_us.&lt;any_name>.php and write the following custom label into it. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php \n$mod_strings['LBL_OPPORTUNITIES_WITH_CLOSED_LOST'] = \"Opportunities With Closed Lost\";\n$mod_strings['LBL_OPPORTUNITIES_WITH_CLOSED_WON'] = \"Opportunities With Closed Won\";<\/code><\/pre>\n\n\n\n<p><strong>Step 4 :<\/strong>\u00a0Do Quick Repair and Rebuild from Admin panel. <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"854\" height=\"246\" src=\"https:\/\/www.techcrm.in\/blogs\/wp-content\/uploads\/2019\/08\/blog-9-screen-1.jpg\" alt=\"\" class=\"wp-image-142\"\/><figcaption>After Customization<\/figcaption><\/figure><\/div>\n","protected":false},"excerpt":{"rendered":"<p>We have consider Accounts\u00a0 module. There comes the time when sales rep finds it irritating to view opportunities Closed Won and Closed Lost under same subpanel. Lets make custom subpanels separating Closed Won and Closed Lost. In this blog post, we will add those subpanels under Accounts module. Step 1 :\u00a0Create custom\/Extension\/modules\/Accounts\/Ext\/Layoutdefs\/&lt;any_name>.php and write the [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,9],"tags":[14,12,13],"class_list":["post-141","post","type-post","status-publish","format-standard","hentry","category-sugarcrm","category-suitecrm","tag-subpanel","tag-sugarcrm","tag-suitecrm"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Add custom subpanel - TechCRM<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.techcrm.in\/blogs\/add-custom-subpanel\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Add custom subpanel - TechCRM\" \/>\n<meta property=\"og:description\" content=\"We have consider Accounts\u00a0 module. There comes the time when sales rep finds it irritating to view opportunities Closed Won and Closed Lost under same subpanel. Lets make custom subpanels separating Closed Won and Closed Lost. In this blog post, we will add those subpanels under Accounts module. Step 1 :\u00a0Create custom\/Extension\/modules\/Accounts\/Ext\/Layoutdefs\/&lt;any_name&gt;.php and write the [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.techcrm.in\/blogs\/add-custom-subpanel\/\" \/>\n<meta property=\"og:site_name\" content=\"TechCRM\" \/>\n<meta property=\"article:published_time\" content=\"2019-08-25T07:56:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-09-08T09:25:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.techcrm.in\/blogs\/wp-content\/uploads\/2019\/08\/blog-9-screen-1.jpg\" \/>\n<meta name=\"author\" content=\"Navin Rakhonde\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Navin Rakhonde\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.techcrm.in\/blogs\/add-custom-subpanel\/\",\"url\":\"https:\/\/www.techcrm.in\/blogs\/add-custom-subpanel\/\",\"name\":\"Add custom subpanel - TechCRM\",\"isPartOf\":{\"@id\":\"https:\/\/www.techcrm.in\/blogs\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.techcrm.in\/blogs\/add-custom-subpanel\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.techcrm.in\/blogs\/add-custom-subpanel\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.techcrm.in\/blogs\/wp-content\/uploads\/2019\/08\/blog-9-screen-1.jpg\",\"datePublished\":\"2019-08-25T07:56:46+00:00\",\"dateModified\":\"2020-09-08T09:25:35+00:00\",\"author\":{\"@id\":\"https:\/\/www.techcrm.in\/blogs\/#\/schema\/person\/992dfe427bb53dcdfd72dd80e3ef9dbc\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.techcrm.in\/blogs\/add-custom-subpanel\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.techcrm.in\/blogs\/add-custom-subpanel\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.techcrm.in\/blogs\/add-custom-subpanel\/#primaryimage\",\"url\":\"https:\/\/www.techcrm.in\/blogs\/wp-content\/uploads\/2019\/08\/blog-9-screen-1.jpg\",\"contentUrl\":\"https:\/\/www.techcrm.in\/blogs\/wp-content\/uploads\/2019\/08\/blog-9-screen-1.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.techcrm.in\/blogs\/add-custom-subpanel\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.techcrm.in\/blogs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SugarCRM\",\"item\":\"https:\/\/www.techcrm.in\/blogs\/category\/sugarcrm\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Add custom subpanel\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.techcrm.in\/blogs\/#website\",\"url\":\"https:\/\/www.techcrm.in\/blogs\/\",\"name\":\"TechCRM\",\"description\":\"Blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.techcrm.in\/blogs\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.techcrm.in\/blogs\/#\/schema\/person\/992dfe427bb53dcdfd72dd80e3ef9dbc\",\"name\":\"Navin Rakhonde\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.techcrm.in\/blogs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9cc8fd1b948255055b85e5d41dabfc6e704f806d180a1e21cb8fb378e2f5c022?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9cc8fd1b948255055b85e5d41dabfc6e704f806d180a1e21cb8fb378e2f5c022?s=96&d=mm&r=g\",\"caption\":\"Navin Rakhonde\"},\"sameAs\":[\"https:\/\/www.techcrm.in\/\"],\"url\":\"https:\/\/www.techcrm.in\/blogs\/author\/navin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Add custom subpanel - TechCRM","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.techcrm.in\/blogs\/add-custom-subpanel\/","og_locale":"en_US","og_type":"article","og_title":"Add custom subpanel - TechCRM","og_description":"We have consider Accounts\u00a0 module. There comes the time when sales rep finds it irritating to view opportunities Closed Won and Closed Lost under same subpanel. Lets make custom subpanels separating Closed Won and Closed Lost. In this blog post, we will add those subpanels under Accounts module. Step 1 :\u00a0Create custom\/Extension\/modules\/Accounts\/Ext\/Layoutdefs\/&lt;any_name>.php and write the [&hellip;]","og_url":"https:\/\/www.techcrm.in\/blogs\/add-custom-subpanel\/","og_site_name":"TechCRM","article_published_time":"2019-08-25T07:56:46+00:00","article_modified_time":"2020-09-08T09:25:35+00:00","og_image":[{"url":"https:\/\/www.techcrm.in\/blogs\/wp-content\/uploads\/2019\/08\/blog-9-screen-1.jpg"}],"author":"Navin Rakhonde","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Navin Rakhonde","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.techcrm.in\/blogs\/add-custom-subpanel\/","url":"https:\/\/www.techcrm.in\/blogs\/add-custom-subpanel\/","name":"Add custom subpanel - TechCRM","isPartOf":{"@id":"https:\/\/www.techcrm.in\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.techcrm.in\/blogs\/add-custom-subpanel\/#primaryimage"},"image":{"@id":"https:\/\/www.techcrm.in\/blogs\/add-custom-subpanel\/#primaryimage"},"thumbnailUrl":"https:\/\/www.techcrm.in\/blogs\/wp-content\/uploads\/2019\/08\/blog-9-screen-1.jpg","datePublished":"2019-08-25T07:56:46+00:00","dateModified":"2020-09-08T09:25:35+00:00","author":{"@id":"https:\/\/www.techcrm.in\/blogs\/#\/schema\/person\/992dfe427bb53dcdfd72dd80e3ef9dbc"},"breadcrumb":{"@id":"https:\/\/www.techcrm.in\/blogs\/add-custom-subpanel\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.techcrm.in\/blogs\/add-custom-subpanel\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.techcrm.in\/blogs\/add-custom-subpanel\/#primaryimage","url":"https:\/\/www.techcrm.in\/blogs\/wp-content\/uploads\/2019\/08\/blog-9-screen-1.jpg","contentUrl":"https:\/\/www.techcrm.in\/blogs\/wp-content\/uploads\/2019\/08\/blog-9-screen-1.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.techcrm.in\/blogs\/add-custom-subpanel\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.techcrm.in\/blogs\/"},{"@type":"ListItem","position":2,"name":"SugarCRM","item":"https:\/\/www.techcrm.in\/blogs\/category\/sugarcrm\/"},{"@type":"ListItem","position":3,"name":"Add custom subpanel"}]},{"@type":"WebSite","@id":"https:\/\/www.techcrm.in\/blogs\/#website","url":"https:\/\/www.techcrm.in\/blogs\/","name":"TechCRM","description":"Blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.techcrm.in\/blogs\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.techcrm.in\/blogs\/#\/schema\/person\/992dfe427bb53dcdfd72dd80e3ef9dbc","name":"Navin Rakhonde","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.techcrm.in\/blogs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9cc8fd1b948255055b85e5d41dabfc6e704f806d180a1e21cb8fb378e2f5c022?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9cc8fd1b948255055b85e5d41dabfc6e704f806d180a1e21cb8fb378e2f5c022?s=96&d=mm&r=g","caption":"Navin Rakhonde"},"sameAs":["https:\/\/www.techcrm.in\/"],"url":"https:\/\/www.techcrm.in\/blogs\/author\/navin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.techcrm.in\/blogs\/wp-json\/wp\/v2\/posts\/141","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.techcrm.in\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techcrm.in\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techcrm.in\/blogs\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techcrm.in\/blogs\/wp-json\/wp\/v2\/comments?post=141"}],"version-history":[{"count":1,"href":"https:\/\/www.techcrm.in\/blogs\/wp-json\/wp\/v2\/posts\/141\/revisions"}],"predecessor-version":[{"id":143,"href":"https:\/\/www.techcrm.in\/blogs\/wp-json\/wp\/v2\/posts\/141\/revisions\/143"}],"wp:attachment":[{"href":"https:\/\/www.techcrm.in\/blogs\/wp-json\/wp\/v2\/media?parent=141"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techcrm.in\/blogs\/wp-json\/wp\/v2\/categories?post=141"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techcrm.in\/blogs\/wp-json\/wp\/v2\/tags?post=141"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}