{"id":58,"date":"2019-08-24T06:55:05","date_gmt":"2019-08-24T06:55:05","guid":{"rendered":"https:\/\/www.techcrm.in\/blogs\/?p=58"},"modified":"2020-09-08T14:55:48","modified_gmt":"2020-09-08T09:25:48","slug":"remove-subpanel-from-detailview-if-it-doesnt-have-records","status":"publish","type":"post","link":"https:\/\/www.techcrm.in\/blogs\/remove-subpanel-from-detailview-if-it-doesnt-have-records\/","title":{"rendered":"Remove subpanel from detailview if it doesn&#8217;t have records"},"content":{"rendered":"\n<p>Sometimes Scrolling DetailView is annoying if many subpanel has no records into it.<\/p>\n\n\n\n<p>We come across interesting requirement in which we have to remove all those subpanel which has no records, so user are easily check the related records without much scrolling.<\/p>\n\n\n\n<p>We achieve the functionality as follows.<\/p>\n\n\n\n<p>For Example, We have to do changes for Accounts module.<\/p>\n\n\n\n<p>Steps are as below,<\/p>\n\n\n\n<p><strong>1. Create \/ Edit custom\/modules\/Accounts\/views\/view.detail.php<\/strong><\/p>\n\n\n\n<p>Add the following code into it.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function _displaySubPanels(){\nglobal $db;\nrequire_once ('include\/SubPanel\/SubPanelTiles.php');\n$subpanel = new SubPanelTiles($this->bean, $this->module);\n\n$subpanelLists = $subpanel->subpanel_definitions->layout_defs['subpanel_setup'];\nforeach($subpanelLists as $subpanelModuleName => $subpanelModuleDefinations)\n{\n     $notConsiderSubpanel = array('activities','history');\n     if(!in_array($subpanelModuleName,$notConsiderSubpanel) &amp;&amp; array_key_exists(\"get_subpanel_data\", $subpanelModuleDefinations) &amp;&amp; !empty($subpanelModuleDefinations['get_subpanel_data']))\n     {\n          $loadRelationshipName = $subpanelModuleDefinations['get_subpanel_data'];\n          $pos = strpos($loadRelationshipName, \"function:\");\n          if ($pos === false)\n          {\n               $this->bean->load_relationship($loadRelationshipName);\n               if(empty($this->bean->$loadRelationshipName->getBeans()))\n               {\n                    unset($subpanel->subpanel_definitions->layout_defs['subpanel_setup'][$subpanelModuleName]);\n               }\n          }\n     }\n}\n\necho $subpanel->display();\n}<\/code><\/pre>\n\n\n\n<p><strong> 2. Refresh the Account&#8217;s DetailView and see the effects. <\/strong><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"635\" src=\"https:\/\/www.techcrm.in\/blogs\/wp-content\/uploads\/2019\/08\/remove-subpanel-from-detailview-if-it-doesnt-have-records-output1.png\" alt=\"\" class=\"wp-image-61\"\/><figcaption> Before Customization <\/figcaption><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"1444\" height=\"706\" src=\"https:\/\/www.techcrm.in\/blogs\/wp-content\/uploads\/2019\/08\/remove-subpanel-from-detailview-if-it-doesnt-have-records-output2.png\" alt=\"\" class=\"wp-image-62\"\/><figcaption> After Customization <\/figcaption><\/figure><\/div>\n\n\n\n<p>\n\nHope you find this blog post helpful.<\/p>\n\n\n\n<p>Feel free to add comments and queries, that helps us to improve the quality of posts.<\/p>\n\n\n\n<p>You can contact us at&nbsp;<a rel=\"noreferrer noopener\" href=\"mailto:contact@urdhva-tech.com\" target=\"_blank\">info@techcrm.in<\/a><\/p>\n\n\n\n<p>Thank you.\n\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes Scrolling DetailView is annoying if many subpanel has no records into it. We come across interesting requirement in which we have to remove all those subpanel which has no records, so user are easily check the related records without much scrolling. We achieve the functionality as follows. For Example, We have to do changes [&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-58","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>Remove subpanel from detailview if it doesn&#039;t have records - 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\/remove-subpanel-from-detailview-if-it-doesnt-have-records\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Remove subpanel from detailview if it doesn&#039;t have records - TechCRM\" \/>\n<meta property=\"og:description\" content=\"Sometimes Scrolling DetailView is annoying if many subpanel has no records into it. We come across interesting requirement in which we have to remove all those subpanel which has no records, so user are easily check the related records without much scrolling. We achieve the functionality as follows. For Example, We have to do changes [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.techcrm.in\/blogs\/remove-subpanel-from-detailview-if-it-doesnt-have-records\/\" \/>\n<meta property=\"og:site_name\" content=\"TechCRM\" \/>\n<meta property=\"article:published_time\" content=\"2019-08-24T06:55:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-09-08T09:25:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.techcrm.in\/blogs\/wp-content\/uploads\/2019\/08\/remove-subpanel-from-detailview-if-it-doesnt-have-records-output1.png\" \/>\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=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.techcrm.in\/blogs\/remove-subpanel-from-detailview-if-it-doesnt-have-records\/\",\"url\":\"https:\/\/www.techcrm.in\/blogs\/remove-subpanel-from-detailview-if-it-doesnt-have-records\/\",\"name\":\"Remove subpanel from detailview if it doesn't have records - TechCRM\",\"isPartOf\":{\"@id\":\"https:\/\/www.techcrm.in\/blogs\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.techcrm.in\/blogs\/remove-subpanel-from-detailview-if-it-doesnt-have-records\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.techcrm.in\/blogs\/remove-subpanel-from-detailview-if-it-doesnt-have-records\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.techcrm.in\/blogs\/wp-content\/uploads\/2019\/08\/remove-subpanel-from-detailview-if-it-doesnt-have-records-output1.png\",\"datePublished\":\"2019-08-24T06:55:05+00:00\",\"dateModified\":\"2020-09-08T09:25:48+00:00\",\"author\":{\"@id\":\"https:\/\/www.techcrm.in\/blogs\/#\/schema\/person\/992dfe427bb53dcdfd72dd80e3ef9dbc\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.techcrm.in\/blogs\/remove-subpanel-from-detailview-if-it-doesnt-have-records\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.techcrm.in\/blogs\/remove-subpanel-from-detailview-if-it-doesnt-have-records\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.techcrm.in\/blogs\/remove-subpanel-from-detailview-if-it-doesnt-have-records\/#primaryimage\",\"url\":\"https:\/\/www.techcrm.in\/blogs\/wp-content\/uploads\/2019\/08\/remove-subpanel-from-detailview-if-it-doesnt-have-records-output1.png\",\"contentUrl\":\"https:\/\/www.techcrm.in\/blogs\/wp-content\/uploads\/2019\/08\/remove-subpanel-from-detailview-if-it-doesnt-have-records-output1.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.techcrm.in\/blogs\/remove-subpanel-from-detailview-if-it-doesnt-have-records\/#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\":\"Remove subpanel from detailview if it doesn&#8217;t have records\"}]},{\"@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":"Remove subpanel from detailview if it doesn't have records - 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\/remove-subpanel-from-detailview-if-it-doesnt-have-records\/","og_locale":"en_US","og_type":"article","og_title":"Remove subpanel from detailview if it doesn't have records - TechCRM","og_description":"Sometimes Scrolling DetailView is annoying if many subpanel has no records into it. We come across interesting requirement in which we have to remove all those subpanel which has no records, so user are easily check the related records without much scrolling. We achieve the functionality as follows. For Example, We have to do changes [&hellip;]","og_url":"https:\/\/www.techcrm.in\/blogs\/remove-subpanel-from-detailview-if-it-doesnt-have-records\/","og_site_name":"TechCRM","article_published_time":"2019-08-24T06:55:05+00:00","article_modified_time":"2020-09-08T09:25:48+00:00","og_image":[{"url":"https:\/\/www.techcrm.in\/blogs\/wp-content\/uploads\/2019\/08\/remove-subpanel-from-detailview-if-it-doesnt-have-records-output1.png"}],"author":"Navin Rakhonde","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Navin Rakhonde","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.techcrm.in\/blogs\/remove-subpanel-from-detailview-if-it-doesnt-have-records\/","url":"https:\/\/www.techcrm.in\/blogs\/remove-subpanel-from-detailview-if-it-doesnt-have-records\/","name":"Remove subpanel from detailview if it doesn't have records - TechCRM","isPartOf":{"@id":"https:\/\/www.techcrm.in\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.techcrm.in\/blogs\/remove-subpanel-from-detailview-if-it-doesnt-have-records\/#primaryimage"},"image":{"@id":"https:\/\/www.techcrm.in\/blogs\/remove-subpanel-from-detailview-if-it-doesnt-have-records\/#primaryimage"},"thumbnailUrl":"https:\/\/www.techcrm.in\/blogs\/wp-content\/uploads\/2019\/08\/remove-subpanel-from-detailview-if-it-doesnt-have-records-output1.png","datePublished":"2019-08-24T06:55:05+00:00","dateModified":"2020-09-08T09:25:48+00:00","author":{"@id":"https:\/\/www.techcrm.in\/blogs\/#\/schema\/person\/992dfe427bb53dcdfd72dd80e3ef9dbc"},"breadcrumb":{"@id":"https:\/\/www.techcrm.in\/blogs\/remove-subpanel-from-detailview-if-it-doesnt-have-records\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.techcrm.in\/blogs\/remove-subpanel-from-detailview-if-it-doesnt-have-records\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.techcrm.in\/blogs\/remove-subpanel-from-detailview-if-it-doesnt-have-records\/#primaryimage","url":"https:\/\/www.techcrm.in\/blogs\/wp-content\/uploads\/2019\/08\/remove-subpanel-from-detailview-if-it-doesnt-have-records-output1.png","contentUrl":"https:\/\/www.techcrm.in\/blogs\/wp-content\/uploads\/2019\/08\/remove-subpanel-from-detailview-if-it-doesnt-have-records-output1.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.techcrm.in\/blogs\/remove-subpanel-from-detailview-if-it-doesnt-have-records\/#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":"Remove subpanel from detailview if it doesn&#8217;t have records"}]},{"@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\/58","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=58"}],"version-history":[{"count":5,"href":"https:\/\/www.techcrm.in\/blogs\/wp-json\/wp\/v2\/posts\/58\/revisions"}],"predecessor-version":[{"id":101,"href":"https:\/\/www.techcrm.in\/blogs\/wp-json\/wp\/v2\/posts\/58\/revisions\/101"}],"wp:attachment":[{"href":"https:\/\/www.techcrm.in\/blogs\/wp-json\/wp\/v2\/media?parent=58"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techcrm.in\/blogs\/wp-json\/wp\/v2\/categories?post=58"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techcrm.in\/blogs\/wp-json\/wp\/v2\/tags?post=58"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}