{"id":301,"date":"2020-05-21T17:08:55","date_gmt":"2020-05-21T17:08:55","guid":{"rendered":"https:\/\/www.techcrm.in\/blogs\/?p=301"},"modified":"2020-09-08T14:51:15","modified_gmt":"2020-09-08T09:21:15","slug":"how-to-create-a-custom-view-of-type-edit-in-sugarcrm-suitecrm","status":"publish","type":"post","link":"https:\/\/www.techcrm.in\/blogs\/how-to-create-a-custom-view-of-type-edit-in-sugarcrm-suitecrm\/","title":{"rendered":"How to create a custom view of type Edit in SugarCRM \/ SuiteCRM"},"content":{"rendered":"\n<p>In SugarCRM \/ SuiteCRM there is the standard EditView mask that allows you to insert\/modify an object of a specific module, there is also the QuickCreate that can be used to quickly insert an object.<\/p>\n\n\n\n<p>These two masks are standard and easy to manage with Studio.<\/p>\n\n\n\n<p>Sometimes, however, it can be useful to create a custom view of type Edit to manage personalized insert\/modify to be used in specific cases.<\/p>\n\n\n\n<p>To obtain this you need 3 steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>create the view in\u00a0<strong>custom\/modules\/<em>&lt;module_name><\/em>\/views\/view.<em>&lt;view_name><\/em>.php<\/strong>;<\/li><li>activate the view with the\u00a0<strong>custom\/modules\/<em>&lt;module_name><\/em>\/controller.php<\/strong>;<\/li><li>define the view in\u00a0<strong>custom\/modules\/<em>&lt;module_name><\/em>\/metadata\/<em>&lt;view_name><\/em>viewdefs.php<\/strong>.<\/li><\/ol>\n\n\n\n<p>After a &#8220;<strong>Quick Repair and Rebuild<\/strong>&#8220;, you are allowed to call the view with a link like this\u00a0<strong>&lt;crmurl>\/index.php?module=<em>&lt;module_name><\/em>&amp;action=<em>&lt;view_name><\/em>&amp;record=<em>&lt;objectid><\/em><\/strong>\u00a0eventually followed with other parameters you may need (managed in the file\u00a0<strong>view.<em>&lt;view_name><\/em>.php<\/strong>).<\/p>\n\n\n\n<p>Let&#8217;s start with the file\u00a0<strong>custom\/modules\/<em>&lt;module_name><\/em>\/views\/view.<em>&lt;view_name><\/em>.php<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n\nif (! defined('sugarEntry') || ! sugarEntry)\n    die('Not A Valid Entry Point');\n\nclass &lt;module_name>View&lt;view_name> extends ViewEdit {\n\n    public function preDisplay() {\n        $this->type = '&lt;view_name>';\n        parent::preDisplay();\n        $this->ev->view = '&lt;view_name>View';\n    }\n\n    public function display() {\n        parent::display();\n    }\n\n}\n?><\/code><\/pre>\n\n\n\n<p>Let&#8217;s examine the file\u00a0<strong>custom\/modules\/<em>&lt;module_name><\/em>\/controller.php<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\nif (! defined('sugarEntry') || ! sugarEntry)\n    die('Not A Valid Entry Point');\n\nclass &lt;module_name>Controller extends SugarController {\n\n    public function action_&lt;view_name>() {\n        $this->view = '&lt;view_name>';\n    }\n\n}\n?><\/code><\/pre>\n\n\n\n<p>Finally the file\u00a0<strong>custom\/modules\/<em>&lt;module_name><\/em>\/metadata\/<em>&lt;view_name><\/em>viewdefs.php<\/strong>\u00a0that will have the same syntax of the file\u00a0<strong>custom\/modules\/<em>&lt;module_name><\/em>\/metadata\/\u200beditviewdefs.php<\/strong>\u200b:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n$module_name = '&lt;module_name>';\n$_object_name = '&lt;object_name>';\n$viewdefs &#91;$module_name] = \narray (\n  'EditView' => \n  array (\n    'templateMeta' => \n    array (\n      'form' => \n      array (\n        'buttons' => \n        array (\n          0 => 'SAVE',\n          1 => 'CANCEL',\n        ),\n        'headerTpl' => 'include\/EditView\/header.tpl',\n        'footerTpl' => 'include\/EditView\/footer.tpl',\n      ),\n      'maxColumns' => '2',\n      'widths' => \n      array (\n        0 => \n        array (\n          'label' => '10',\n          'field' => '30',\n        ),\n        1 => \n        array (\n          'label' => '10',\n          'field' => '30',\n        ),\n      ),\n      'useTabs' => false,\n      'tabDefs' => \n      array (\n        'DEFAULT' => \n        array (\n          'newTab' => false,\n          'panelDefault' => 'expanded',\n        ),\n      ),\n    ),\n    'panels' => \n    array (\n      'default' => \n      array (\n        0 => \n        array (\n          0 => 'name'\n        ),\n      ),\n    ),\n  ),\n);\n?><\/code><\/pre>\n\n\n\n<p>In this example we put only the field &#8220;name&#8221;, but of course you can set it similarly to the file\u00a0<strong>custom\/modules\/<em>&lt;modulename><\/em>\/metadata\/\u200beditviewdefs.php<\/strong>\u200b.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><strong>Note :<\/strong><\/p><cite>1. <em>Here, &lt;module_name> means the module name you see in the URL, for example, Contacts, Leads, Accounts, etc.<\/em><br>2. <em>&lt;view_name> means the view name like editview, detailview<\/em>, etc<br>3. <em>&lt;object_name> means the module name you see in the URL, for example, Contacts, Leads, Accounts, etc.<\/em><\/cite><\/blockquote>\n\n\n\n<p>Hope 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.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In SugarCRM \/ SuiteCRM there is the standard EditView mask that allows you to insert\/modify an object of a specific module, there is also the QuickCreate that can be used to quickly insert an object. These two masks are standard and easy to manage with Studio. Sometimes, however, it can be useful to create a [&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":[78,77,12,13],"class_list":["post-301","post","type-post","status-publish","format-standard","hentry","category-sugarcrm","category-suitecrm","tag-custom-action","tag-custom-view","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>How to create a custom view of type Edit in SugarCRM \/ SuiteCRM - 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\/how-to-create-a-custom-view-of-type-edit-in-sugarcrm-suitecrm\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to create a custom view of type Edit in SugarCRM \/ SuiteCRM - TechCRM\" \/>\n<meta property=\"og:description\" content=\"In SugarCRM \/ SuiteCRM there is the standard EditView mask that allows you to insert\/modify an object of a specific module, there is also the QuickCreate that can be used to quickly insert an object. These two masks are standard and easy to manage with Studio. Sometimes, however, it can be useful to create a [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.techcrm.in\/blogs\/how-to-create-a-custom-view-of-type-edit-in-sugarcrm-suitecrm\/\" \/>\n<meta property=\"og:site_name\" content=\"TechCRM\" \/>\n<meta property=\"article:published_time\" content=\"2020-05-21T17:08:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-09-08T09:21:15+00:00\" \/>\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\/how-to-create-a-custom-view-of-type-edit-in-sugarcrm-suitecrm\/\",\"url\":\"https:\/\/www.techcrm.in\/blogs\/how-to-create-a-custom-view-of-type-edit-in-sugarcrm-suitecrm\/\",\"name\":\"How to create a custom view of type Edit in SugarCRM \/ SuiteCRM - TechCRM\",\"isPartOf\":{\"@id\":\"https:\/\/www.techcrm.in\/blogs\/#website\"},\"datePublished\":\"2020-05-21T17:08:55+00:00\",\"dateModified\":\"2020-09-08T09:21:15+00:00\",\"author\":{\"@id\":\"https:\/\/www.techcrm.in\/blogs\/#\/schema\/person\/992dfe427bb53dcdfd72dd80e3ef9dbc\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.techcrm.in\/blogs\/how-to-create-a-custom-view-of-type-edit-in-sugarcrm-suitecrm\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.techcrm.in\/blogs\/how-to-create-a-custom-view-of-type-edit-in-sugarcrm-suitecrm\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.techcrm.in\/blogs\/how-to-create-a-custom-view-of-type-edit-in-sugarcrm-suitecrm\/#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\":\"How to create a custom view of type Edit in SugarCRM \/ SuiteCRM\"}]},{\"@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":"How to create a custom view of type Edit in SugarCRM \/ SuiteCRM - 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\/how-to-create-a-custom-view-of-type-edit-in-sugarcrm-suitecrm\/","og_locale":"en_US","og_type":"article","og_title":"How to create a custom view of type Edit in SugarCRM \/ SuiteCRM - TechCRM","og_description":"In SugarCRM \/ SuiteCRM there is the standard EditView mask that allows you to insert\/modify an object of a specific module, there is also the QuickCreate that can be used to quickly insert an object. These two masks are standard and easy to manage with Studio. Sometimes, however, it can be useful to create a [&hellip;]","og_url":"https:\/\/www.techcrm.in\/blogs\/how-to-create-a-custom-view-of-type-edit-in-sugarcrm-suitecrm\/","og_site_name":"TechCRM","article_published_time":"2020-05-21T17:08:55+00:00","article_modified_time":"2020-09-08T09:21:15+00:00","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\/how-to-create-a-custom-view-of-type-edit-in-sugarcrm-suitecrm\/","url":"https:\/\/www.techcrm.in\/blogs\/how-to-create-a-custom-view-of-type-edit-in-sugarcrm-suitecrm\/","name":"How to create a custom view of type Edit in SugarCRM \/ SuiteCRM - TechCRM","isPartOf":{"@id":"https:\/\/www.techcrm.in\/blogs\/#website"},"datePublished":"2020-05-21T17:08:55+00:00","dateModified":"2020-09-08T09:21:15+00:00","author":{"@id":"https:\/\/www.techcrm.in\/blogs\/#\/schema\/person\/992dfe427bb53dcdfd72dd80e3ef9dbc"},"breadcrumb":{"@id":"https:\/\/www.techcrm.in\/blogs\/how-to-create-a-custom-view-of-type-edit-in-sugarcrm-suitecrm\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.techcrm.in\/blogs\/how-to-create-a-custom-view-of-type-edit-in-sugarcrm-suitecrm\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.techcrm.in\/blogs\/how-to-create-a-custom-view-of-type-edit-in-sugarcrm-suitecrm\/#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":"How to create a custom view of type Edit in SugarCRM \/ SuiteCRM"}]},{"@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\/301","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=301"}],"version-history":[{"count":3,"href":"https:\/\/www.techcrm.in\/blogs\/wp-json\/wp\/v2\/posts\/301\/revisions"}],"predecessor-version":[{"id":349,"href":"https:\/\/www.techcrm.in\/blogs\/wp-json\/wp\/v2\/posts\/301\/revisions\/349"}],"wp:attachment":[{"href":"https:\/\/www.techcrm.in\/blogs\/wp-json\/wp\/v2\/media?parent=301"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techcrm.in\/blogs\/wp-json\/wp\/v2\/categories?post=301"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techcrm.in\/blogs\/wp-json\/wp\/v2\/tags?post=301"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}