{"id":8718,"date":"2024-07-24T05:38:17","date_gmt":"2024-07-24T05:38:17","guid":{"rendered":"https:\/\/www.infinitivehost.com\/knowledge-base\/?p=8718"},"modified":"2024-08-23T09:40:43","modified_gmt":"2024-08-23T09:40:43","slug":"step-by-step-guide-to-creating-custom-modules-in-vtiger-crm-6-5","status":"publish","type":"post","link":"https:\/\/www.infinitivehost.com\/knowledge-base\/step-by-step-guide-to-creating-custom-modules-in-vtiger-crm-6-5\/","title":{"rendered":"Step-by-Step Guide to Creating Custom Modules in Vtiger CRM 6.5"},"content":{"rendered":"<div class='epvc-post-count'><span class='epvc-eye'><\/span>  <span class=\"epvc-count\"> 2,221<\/span><span class='epvc-label'> Views<\/span><\/div>\n<p>Creating a custom modules in Vtiger CRM 6.5 involves several steps, including setting up the module directory, creating necessary files, defining module components, and installing the module. Below are detailed steps to guide you through the process:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Set Up the Module Directory<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Navigate to the Modules Directory:<\/strong><br>Go to the <code>modules<\/code> directory in your Vtiger CRM installation path.<\/li>\n\n\n\n<li><strong>Create a New Directory:<\/strong><br>Create a new directory for your custom module. For example, if your module is named &#8220;CustomModule&#8221;, create a directory named <code>CustomModule<\/code>.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Create the Manifest File (manifest.xml)<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Create a manifest.xml File:<\/strong><br>In your module directory (<code>modules\/CustomModule<\/code>), create a file named <code>manifest.xml<\/code>. This file defines the module metadata.<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   <code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">&lt;module&gt;\n       &lt;name&gt;CustomModule&lt;\/name&gt;\n       &lt;label&gt;Custom Module&lt;\/label&gt;\n       &lt;parent&gt;Settings&lt;\/parent&gt;\n       &lt;type&gt;entity&lt;\/type&gt;\n       &lt;version&gt;1.0&lt;\/version&gt;\n       &lt;isentitytype&gt;true&lt;\/isentitytype&gt;\n       &lt;initfunction&gt;CustomModule_init&lt;\/initfunction&gt;\n       &lt;entityfieldname&gt;custommodule_name&lt;\/entityfieldname&gt;\n       &lt;entityidfield&gt;custommoduleid&lt;\/entityidfield&gt;\n       &lt;tables&gt;\n           &lt;table&gt;\n               &lt;name&gt;vtiger_custommodule&lt;\/name&gt;\n               &lt;sql&gt;CREATE TABLE vtiger_custommodule (\n                   custommoduleid INT NOT NULL AUTO_INCREMENT,\n                   custommodule_name VARCHAR(255),\n                   PRIMARY KEY (custommoduleid)\n               );&lt;\/sql&gt;\n           &lt;\/table&gt;\n       &lt;\/tables&gt;\n       &lt;blocks&gt;\n           &lt;block&gt;\n               &lt;label&gt;LBL_CUSTOMMODULE_INFORMATION&lt;\/label&gt;\n               &lt;fields&gt;\n                   &lt;field&gt;\n                       &lt;columnname&gt;custommodule_name&lt;\/columnname&gt;\n                       &lt;uitype&gt;2&lt;\/uitype&gt;\n                       &lt;typeofdata&gt;V~M&lt;\/typeofdata&gt;\n                       &lt;label&gt;LBL_CUSTOMMODULE_NAME&lt;\/label&gt;\n                   &lt;\/field&gt;\n               &lt;\/fields&gt;\n           &lt;\/block&gt;\n       &lt;\/blocks&gt;\n   &lt;\/module&gt;<\/mark><\/code><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Define Module Components<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Module Class:<\/strong><br>Create a PHP file named <code>CustomModule.php<\/code> in your module directory. This file defines the module class.<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   <code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">&lt;?php\n   class CustomModule extends CRMEntity {\n       public $table_name = 'vtiger_custommodule';\n       public $table_index = 'custommoduleid';\n       public $customFieldTable = Array('vtiger_custommodulecf', 'custommoduleid');\n       public $tab_name = Array('vtiger_crmentity', 'vtiger_custommodule', 'vtiger_custommodulecf');\n       public $tab_name_index = Array(\n           'vtiger_crmentity' =&gt; 'crmid',\n           'vtiger_custommodule' =&gt; 'custommoduleid',\n           'vtiger_custommodulecf' =&gt; 'custommoduleid'\n       );\n       public $list_fields = Array (\n           'Custom Module Name' =&gt; Array('custommodule', 'custommodule_name'),\n       );\n       public $list_fields_name = Array (\n           'Custom Module Name' =&gt; 'custommodule_name',\n       );\n       public $list_link_field = 'custommodule_name';\n       public $search_fields = Array(\n           'Custom Module Name' =&gt; Array('custommodule', 'custommodule_name'),\n       );\n       public $search_fields_name = Array (\n           'Custom Module Name' =&gt; 'custommodule_name',\n       );\n       public $popup_fields = Array ('custommodule_name');\n       public $def_basicsearch_col = 'custommodule_name';\n       public $def_detailview_recname = 'custommodule_name';\n       public $mandatory_fields = Array('custommodule_name');\n       public $default_order_by = 'custommodule_name';\n       public $default_sort_order='ASC';\n   }<\/mark><\/code><\/code><\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li><strong>Language File:<\/strong><br>Create a language file in <code>languages\/en_us\/CustomModule.php<\/code> to define the language strings for your module.<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   <code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">&lt;?php\n   $languageStrings = array(\n       'CustomModule' =&gt; 'Custom Module',\n       'SINGLE_CustomModule' =&gt; 'Custom Module',\n       'LBL_CUSTOMMODULE_INFORMATION' =&gt; 'Custom Module Information',\n       'LBL_CUSTOMMODULE_NAME' =&gt; 'Custom Module Name',\n   );<\/mark><\/code><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: Install the Module<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Zip the Module Directory:<\/strong><br>Compress the <code>CustomModule<\/code> directory into a <code>.zip<\/code> file.<\/li>\n\n\n\n<li><strong>Upload the Module:<\/strong><\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Go to the Vtiger CRM Settings page.<\/li>\n\n\n\n<li>Click on &#8220;Module Management&#8221; -&gt; &#8220;Module Manager&#8221;.<\/li>\n\n\n\n<li>Click on &#8220;Import Module from Zip&#8221; and upload your zipped file.<\/li>\n\n\n\n<li>Follow the instructions to complete the installation.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Step 5: Create Custom Pages<\/h3>\n\n\n\n<p>To create custom pages for your module, you need to define them in your module directory.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Create a Page File:<\/strong><br>Create a PHP file for your custom page, e.g., <code>CustomPage.php<\/code> in the <code>modules\/CustomModule<\/code> directory.<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   <code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">&lt;?php\n   require_once('include\/utils\/utils.php');\n   global $adb;\n   \/\/ Your custom page logic here<\/mark><\/code><\/code><\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li><strong>Define the Entry Point:<\/strong><br>Add an entry in the <code>module\/CustomModule\/manifest.xml<\/code> file to define the custom page entry point.<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   <code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">&lt;actions&gt;\n       &lt;action&gt;\n           &lt;module&gt;CustomModule&lt;\/module&gt;\n           &lt;actionname&gt;CustomPage&lt;\/actionname&gt;\n           &lt;path&gt;modules\/CustomModule\/CustomPage.php&lt;\/path&gt;\n       &lt;\/action&gt;\n   &lt;\/actions&gt;<\/mark><\/code><\/code><\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>Access the Custom Page:<\/strong><br>After installing the module, you can access your custom page using the following URL format:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   <code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">http:\/\/your_vtiger_url\/index.php?module=CustomModule&amp;action=CustomPage<\/mark><\/code><\/code><\/pre>\n\n\n\n<p>By following these steps, you can create a custom module and pages in Vtiger CRM 6.5. This process involves setting up the module directory, creating necessary files like manifest.xml and module class files, defining the module components, and installing the module through the Vtiger CRM interface.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>Creating any particular custom modules in Vtiger CRM 6.5 consists of numerous steps, including properly setting up the directory of the module, creating only crucial files, describing components of the module, and lastly, installing the cusom module. Above are complete steps to navigate you through the whole process. To create any specific module in CRM 6.5, it became very crucial to have the <a href=\"https:\/\/www.infinitivehost.com\/managed-vtiger-solutions\"><mark style=\"background-color:#8ed1fc\" class=\"has-inline-color has-black-color\"><strong>best Vtiger hosting solutions<\/strong><\/mark><\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>2,221 Views Creating a custom modules in Vtiger CRM 6.5 involves several steps, including setting up the module directory, creating necessary files, defining module components, and installing the module. Below are detailed steps to guide you through the process: Step 1: Set Up the Module Directory Step 2: Create the Manifest File (manifest.xml) Step 3: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[204],"tags":[],"class_list":["post-8718","post","type-post","status-publish","format-standard","hentry","category-vtiger-solutions"],"_links":{"self":[{"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/posts\/8718","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/comments?post=8718"}],"version-history":[{"count":2,"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/posts\/8718\/revisions"}],"predecessor-version":[{"id":8919,"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/posts\/8718\/revisions\/8919"}],"wp:attachment":[{"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/media?parent=8718"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/categories?post=8718"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/tags?post=8718"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}