With evolving time and business needs CRM implementing organizations come across needs for new modules to handle some newly needed features. The 2 ways to achieve this objective is by either doing the complete code or use module builder, a built-in feature provided by the SuiteCRM.
In this article we will go through complete end to end flow for a module development and deployment, and various actions and options available for the same.
Create new package for custom module
It is a best practice to create a separate package for each new module. Packages make it easy to maintain all the module related details in one place, like field details, layout/view details, relationship details etc. Making easy in later of deployment.
Creating Package
Following are the steps to create new package via module builder.
- Go to Admin > Module Builder and click ‘New Package’
- Enter values for the following fields to create new package
- Package Name: The package name is to uniquely identify the package you developed/are working on in the package panel
- Author: Developer / Team responsible for the development of the package
- Key: A 5 character string to identify / group module of the same package
- Description: Details for any person not already introduced to the purpose of the package
- Readme: Details intended to be shared with the user of the package.
- Save the new package
Steps to create the module
Steps to create a new module via module builder will be as follows.
- Navigate to the main panel and click on ‘New Module’.
- Enter the values for the following fields.
-
- Module Name: Module name is displayed on the packages and in-studio after deploying.
- Label: The label is displayed when the module is using sugar.
- Importing: Select the option to import the module.
- Navigation Tab: Select the navigation tab to add the module and module actions to the navigation bar.
- Type: while creating module we have to select the type related to the module.
Type | Description |
---|---|
Basic | Generic module with only the most basic fields defined by default. All other module types build on top of the basic module type. |
Company | Contains fields designed for company, account, or organization type records. Includes billing and shipping addresses and more. |
File | Contains fields designed for file upload or document records. Includes category, expiration date, status, filename, and more. |
Issue | Contains fields designed for bug, issue, or case record types. Includes issue number, status, priority, work log, and more. |
Person | Contains fields designed for people, contacts, or lead records. Includes first and last name, primary and alternate addresses, email addresses, phone numbers, and more |
Sale | Contains fields designed for sales, transactions, or opportunities. Includes, amount, currency and more. |
- Save the module by click on save.
Create a required field in the new module
- Click on Add field to create new fields as well as we change the existing fields in the module.
- The field name is required to create a field in the module.
- once the information is given the fields then click on save.
Once the field is created it is displayed on the editview and shown in the layouts.
Module Relationships
Relationships are the links between different modules in sugar Related records are displayed on the subpanels on modules detail page of depending upon the relationtype.
- When you create a new relationship between the two modules then the system automatically creates the subpanels to the modules.
- There are four relationships to relate to the modules.
- One to One.
- One to Many.
- Many to Many.
- Many to One.
Select the relation type and select the related module to add the relationship.
Module Layouts
We can add, remove, hide in the layouts and when the package is deployed fields are shown in views
Edit view:
Fields are arranged in the edit view and shown by keeping them in the panel by adding the new row and new panel.
Detail view:
When we give the values in the edit view, then we click on save then details are shown in the detail view. We can arrange the fields, what are the fields to be displayed by using layouts
List view:
Displays a list of records and provides links to the edit views and detail views of those records. The listview also allows some operations such as deleting and mass updating records. This is (usually) the default view for a module
Package Export:
The export button will create a zip file containing custom module package which can be migrated to other instance, for the package to be shared with / handover to other developers The export button will have the custom module appear in module builder, which will need to be deployed in the instance once it is ready for use.
Package Publish:
This is the mechanism for moving the package to a test environment and then ultimately to the production environment. The Publish button will produce a module loadable zip file, similar to the Export functionality, except that when the zip file is installed, the modules and customization will be directly installed into the instance, ready for use by the end use.
Package Deploy:
The deploy button is used when you want to make the package’s custom modules active and available within the Sugar instance in which it was built. Once the package is deployed, the custom module will be visible in Module Builder and Studio.
Conclusion:
Module Builder enables administrators to create, deploy, and maintain custom modules in Sugar. Modules can be created in Module Builder and then deployed within your instance of Sugar or exported for additional development and deployment to other instances of Sugar. This is convenient for testing new modules and for distributing a module to many different instances.