Overview
The Developer tools section displays options that enable you to build new modules and customize existing ones.
The Module Builder enables you to build custom modules; Studio enables you to customize existing modules. To create relationships between modules, see Creating Relationships.
After you build a module in Module Builder, you can deploy the module directly within the current instance, or you can use the Module Loader to install it in another Sugar instance. For more information, see Module Loader.
Module Builder
Use the Module Builder to create custom modules in Sugar.
The process of creating a custom module is as follows:
1.
|
Create a package to house the new module. You can create one or more modules within a package.
|
2.
|
Create a module using one of the following templates that Sugar provides for you.
|
Basic. This template provides basic fields such as ID, Date Entered, and Created By. Use this template to create a module from scratch.
Company. This template provides organization-specific fields such as Company Name, Industry, and Billing Address. Use this template to create a module that is similar to the Accounts module.
File. This template provides document-specific fields such as File Name and Document Type. Use this template to create a module that is similar to the Documents module.
Issue. This template provides case and bug-specific fields such as ID, Description, and Created By. Use this template to create a module that is similar to the Cases module or Bug Tracker module.
Person. This template provides individual-specific fields such as salutation, title, name, address, and phone number. Use this template to create a module that is similar to the Contacts module or the Leads module.
Sale. This template provides opportunity-specific fields such as Lead-Source and Probability. Use this template to create a module that is similar to the Opportunities module.
3.
|
Create new fields, if necessary. You can also rename default fields from the template.
|
Note:
|
Apart from field names, you cannot edit other field properties in a template. However, you can duplicate the fields and save them with a different name to customize them. You can choose which fields appear in the module layouts.
|
4.
|
Customize page layouts for List View, Edit View, Detail View, Sub-panels, Search form, and Sugar Dashlets, if necessary.
|
5.
|
Create relationships between the new module and other modules, if needed. A Sugar module, typically, has multiple relationships with other Sugar modules. When you create a custom module, you can define its relationship with other Sugar modules.
|
6.
|
Save the package and distribute it.
|
You can choose one of the following options to distribute the package:
¢
|
Publish. This option is designed for distribution to specific users or customers. The system creates a zip file, which you can save on your local machine. You can then email it to one or more individuals who can use the Module Loader to upload the zip file into their Sugar instance.
|
After the module is installed through Studio, you can add or remove fields and make other changes to a published module.
¢
|
Deploy. This option is designed to install the custom module on your Sugar instance and make it available to users in your organization. After deployment, if needed, you can make further changes to the module in Module Builder and deploy it again to update the installed module.
|
You can also add or remove fields and make other changes to a deployed module through Studio. However, note that if you change a deployed custom module in Studio and then re-deploy it from Module Builder, the following information will be lost:
l
|
Custom field labels will be lost and, hence, will not display in the page layouts even though the custom fields and the associated data exist in the database.
|
l
|
The layouts for the custom module will be lost and will have to be created again. If you created custom fields in Studio and added them to the layouts prior to re-deployment, you will have to add them again to the layouts in Module Builder.
|
l
|
Custom relationships will be lost. The relationship tables and relationships between records that are stored in those tables are deleted from the database.
|
¢
|
Export. This option is designed for distribution to developers. The system creates a zip file, which you can save on your local machine and email to other developers. Using the Module Loader, developers can install it on their Sugar instance and customize it further in Module Builder if necessary. The package is visible only in Module Builder and, hence, only administrators can access it until it has been deployed.
|
To create a package
1.
|
In the Developer Tools sub-panel, click Module Builder to view the Module Builder page.
|
2.
|
Click New Package.
|
Sugar displays the Package page on the screen.
3.
|
Enter a name for the package and click Save.
|
The system refreshes the page and displays options to duplicate, publish, deploy, export, and delete the package.
4.
|
Enter information for the following fields:
|
Author. Enter your name as the creator of the package.
Key. Enter an alphanumeric key to distinguish modules with similar names. The system will prefix all class names, directories and tables names with this key.
Description. Enter a brief description of the package.
5.
|
Click Save to create the package; to delete the package, click Delete.
|
6.
|
After you save the package, if you want to create a copy, click Duplicate.
|
The system appends a 1 to the package name and saves it as a new package.
7.
|
To publish the package after saving it, click Publish.
|
8.
|
To deploy the package on your Sugar instance after saving it, click Deploy.
|
9.
|
Click Export to save the package as a zip file on your local machine.
|
To create a module
1.
|
Click the New Module icon on the Package page.
|
The Module page displays on the screen
2.
|
Enter information for the following fields:
|
Module Name. Enter a name for the module.
Label. Enter a name for the module that you want displayed in the Sugar User Interface.
Importing. Selecting this option to allow data import into the module.
Navigation Tab. By default, this option is enabled to create a tab for the module that is identical to other Sugar module tabs.
Type. Click a template to select it for your module
3.
|
Click Save to save the module and add it to the package.
|
The system refreshes the page to display the selected template. The new module is nested within the package listed in the Packagespanel on the Module Builder home page.
The Packages panel on the left lists all the modules you create within a package. Default fields, labels, layouts, sub-panels, and relationships from the selected template are nested under the module. You can click them to view their details. You can also edit the default layouts, add new fields, and create relationships with other Sugar modules.
For information on customizing a layout or the Search form, see Editing Layouts for Sugar Modules. For information on creating new fields, see To add fields. For information on defining relationships, see Creating Relationships.
To edit Sugar Dashlets
1.
|
On the custom module page, click View Layouts. Alternatively, click Layouts in the Packages panel on the left.
|
2.
|
Click Sugar Dashlet.
|
You can edit the List View and the Search form for Sugar Dashlets.
3.
|
To edit the List View, click Sugar Dashlet List View and follow the procedure described in To edit List View.
|
To edit the Search form, click Sugar Dashlet Search and follow the procedure described in To edit the Search form.
To distribute or install a package
1.
|
In Module Builder, select the package and click Publish, Deploy,or Export.
|
When you select Publish or Export, the system saves it as a zip file that you can export to your local machine and distribute as needed. When you select Deploy, the system installs all the custom modules in the package on your Sugar instance.
2.
|
When you choose Publish or Export, select Save to Disk and click OK.
|
Use the Module Loader to upload the file from your machine into Sugar and install the module. For more information, seeModule Loader.
Deleting Packages
You can delete a package if necessary. When you delete a package, all the files that it contains are also deleted. If you delete a package after it has been deployed, you can uninstall the deployed package using the Module Loader. When you uninstall a package, you have the option of retaining or removing the database tables.
You do not need to delete a package before you install a newer version. The files from the new version will override any existing files from the earlier package. That is, any updates that you made to the package before re-deploying will override files from the earlier package.
Module Loader
Use the Module Loader to install Sugar modules, custom modules, upgrades, language packs, Sugar Dashlets, and themes.
You can create custom modules in the Module Builder. A custom module is contained within a package. When you deploy the package, it becomes available to other users in your organization. When you publish or export the package, you can save it as a zip file on your local machine and then use the Module Loader to upload them it into Sugar. For more information on creating packages, see Module Builder.
If you delete a package in Module Builder after it is already installed or deployed, you can uninstall the deployed module in the Module Loader. You can also disable installed modules through the Module Loader.
To install a module
1.
|
In the System sub-panel of the Administration Home page, click Module Loader.
|
If you deployed the package, it is listed in the top panel and has already been made available to other users in your organization. You can uninstall it or disable it by clicking the appropriate button.
2.
|
Click Browse to navigate to the location of the module’s zip file on your local machine.
|
3.
|
Select the file and then click Open.
|
The path to the zip file displays in the Module field.
4.
|
Click Upload.
|
The uploaded module displays in the bottom panel.
5.
|
Click Install.
|
The license agreement displays on the screen.
6.
|
Select Accept to accept the agreement and then click Commit to install the module.
|
If the installation is successful, the system displays a message stating that the module installed successfully.
7.
|
To go back to the Module Loader page, click Back to the Module Loader.
|
The new module’s tab is now visible to all users.
To disable and enable a module
1.
|
To disable a module, click the Disable button located next to the module’s name.
|
Sugar displays the License Agreement on the page.
2.
|
Click Accept to accept the agreement.
|
3.
|
Click Commit.
|
After the module has been disabled, Sugar displays a message stating that the module has been disabled.
4.
|
Click Back to Module Loader.
|
The Enable button displays next to the module’s name.
5.
|
To enable the module, click Enable.
|
To uninstall a module
1.
|
In the Module Loader, click the Uninstall button corresponding to the module’s name.
|
The system displays a message stating that the module is ready to be uninstalled and displays options to remove or retain the database tables that were created for the new module.
2.
|
To remove the tables from the database, select Remove Tables; if not, select Do Not Remove Tables.
|
3.
|
Click Commit to uninstall the module; click Cancel to retain the module.
|
4.
|
Click Save.
|
Studio
Studio enables you to customize modules by adding new fields, editing existing fields, field labels, page layouts, sub-panels, and Quick Create forms. After you customize a module, you can export it to your local machine and upload in into another Sugar instance using the Module Loader.
The Studio home page displays a list of existing modules in the left panel. These include the default Sugar modules as well as any custom modules that have been deployed. The associated fields, labels, layouts, and sub-panels for each module are grouped within the module. You can click the Plus sign (+) preceding the module name to view them. The right panel displays the same information in the form of icons. You can click a module in either panel to drill down to its fields, labels, layouts, and sub-panels.
The bottom of the page displays buttons to the (Developer Tools) Home, Studio, Module Builder, and the Dropdown Editor.
Editing a Module
You can create and edit custom fields, drop-down lists, and field labels for a module. You can also edit the default fields, layouts, and sub-panels. After you edit a module, the updated version will not be available to other users until you publish it. You can use Studio to make changes to a published module.
Note:
|
If you make changes to fields and layouts of a custom module in Studio, some information will be lost if the module is re-deployed from the Module Builder. For more information, see the description of Deploy in Module Builder
|
To edit a module
1.
|
In Studio, select the module that you want to edit.
|
2.
|
Select from the following options:
|
Labels: Select this option to edit field labels. For more information, see Editing Field Labels.
Fields: Select this option to create custom fields, and to edit default fields and custom fields. For more information, see To add fields. Select this option to edit and create drop-down lists. For more information, see Dropdown Editor.
Layouts: Select this option to edit the List View, Detail View, Edit View, Search, and Quick Create forms. For the Leads module, you can also edit the Convert Lead form. For more information, see Editing Layouts for Sugar Modules.
Relationships: Select this option to view existing relationships and create new ones between modules. After you create a relationship, you will need to deploy it to make it available to users. For more information, see Creating Relationships.
Subpanels: Select this option to edit one or more of the module’s sub-panels. For more information, see To edit a sub-panel.
3.
|
Click Save.
|
Editing Field Labels
You can edit field labels, button labels, link labels, module titles, and pop-up window messages using the Label editor. You can also change the default field labels for all the language packs that you have installed. Every module list displays the database fields and the labels they map to in the user interface.
Using the Label Editor instead of the Layout Editor to edit multiple labels for a module reduces the time to edit them.
To change field labels
1.
|
Select the module and click Labels.
|
A list of existing database fields and the labels to which they are mapped displays on the page.
2.
|
If you want to select a different language pack, select the appropriate one from the list of pre-installed language packs in the Language drop-down menu.
|
3.
|
Select the label that you want to edit and enter the new name.
|
4.
|
Click Save.
|
5.
|
To navigate back to a different module or to Studio, click the appropriate breadcrumb above the Save button.
|
Creating and editing Fields
You can add custom fields to any module in Sugar. When you add a custom field, the application adds the field to the appropriate database table and stores the generated metadata. You can then add the fields to the desired layout, such as Edit View and Detail View. For custom modules, you can create fields in the Module Builder.
Use Studio to edit fields in a custom module after it has been published.
The Field Editor allows you to edit some properties of custom fields and change the display label and some properties of standard fields such as the field length, row size, and column size. You can also mark a standard field as a required field or an audited field. These properties are described in To add fields.
Note:
|
You cannot change the field name or data type of existing fields. However, you can change the display label.
|
To add fields
1.
|
To add a new custom field to a module, select the module and click Fields.
|
The page displays the current default fields that Sugar provides as well as any existing custom fields.
2.
|
Click Add Fields.
|
The Field Editor displays the field types as shown below:
The information that you need to specify varies depending on the selected data type.
3.
|
In the Field Editor, enter values for the following:
|
Data Type. From the drop-down list, select one of the data types listed below.
¢
|
Text Field. Creates a text field for fields such as first name and last name.
|
¢
|
Address. Creates fields for street, city, postal, state, and country.
|
¢
|
Checkbox. Creates a checkbox for data fields with a Yes/No action; users can click the checkbox to turn on or turn off the action.
|
¢
|
Currency. Creates a field to enter a currency. The system automatically creates a field of the currency type if the field does not exist.
|
¢
|
Date. Creates a field to enter a date.
|
¢
|
DateTime. Creates a field to enter the date and time. Enter the default values in the field that displays when you select this data type. You can select a date and time, such as first day of next month, 12:00pm from the drop-down list below.
|
¢
|
DropDown. Creates a field that you can associate with a drop-down list of values. For more information on drop-down lists, see Dropdown Editor.
|
¢
|
Decimal. Creates a field to hold a number with a specified precision past the decimal point. Sugar stores the exact representation of the number in the database. For example, 1.23 is stored as 1.23.
|
¢
|
Float. Creates a field to hold a number with a specified precision past the decimal point. Sugar stores a very close approximation of the specified value. For example, 1.23 may be stored as 1.2345670000. Because using the Float data type instead of the Decimal data type enhances performance, it is recommended that you use it if exact precision is not required.
|
¢
|
HTML. Creates static HTML-formatted text to display in record views.
|
¢
|
IFrame. Creates an IFrame field. For more information, see Embedding Links and IFrames in a Layout.
|
¢
|
Integer. Creates a field to specify positive or negative numbers. You can specify a range with the Min and Max Value fields.
|
¢
|
MultiSelect. Creates a drop-down list of values. Users can select one or more values from the list.
|
¢
|
Flex Relate. Creates a drop-down list from which you can associate a related record. Because you can add only one Flex-Relate field to a module, this option does not display in the Data Type drop-down list if you attempt to add it to a module that already contains a Flex Relate field.
|
¢
|
Phone. Creates a field to enter a phone number.
|
¢
|
Radio. Creates a radio button.
|
¢
|
Relate. Creates a field to associate a record with another record as a one-way relationship. You can add multiple Relate fields to a module. The Users module can be selected for custom Relate fields that can be used to relate records to Users.
|
Note:
|
Relate fields and custom relationships are independent of each other. Changes made to either one are not reflected in the other.
|
¢
|
Text area. Creates a large field for a block of text.
|
¢
|
URL. Creates a field that links to a URL.
|
¢
|
TextField. Create a field for text.
|
Depending on the data type that you select, you will need to specify values for some of the fields listed below.
¢
|
Field Name. Enter a name for the field. The system adds it to the Sugar database. Do not use spaces or special characters.
|
¢
|
Display Label. The system uses the field name as the label that will display in the Sugar User Interface. You can enter a new value if needed.
|
¢
|
System Label. Sugar auto-populates this field with the label that it uses internally to refer to the field. This is the label that Sugar displays on the module’s Edit Labels page in Studio. You can change this value.
|
¢
|
Help Text. Enter descriptive text for the field. Sugar displays this text when the user points the cursor at the field. Regular users cannot view this text.
|
¢
|
Comment Text. Enter additional comments, if needed, about the field.
|
¢
|
Default Value. Enter a default value for the field, if necessary.
|
¢
|
HTML. Sugar displays this text box when you select the HTML data type. Enter the HTML code in this box.
|
¢
|
Max Size. Enter the maximum number of characters that users can enter in the field. This is for text data fields.
|
¢
|
Mass Update. Sugar displays this option when you select the DropDown data type or the Date data type. Use it to add the field to the module’s Mass Update section.
Data types that are available for Mass Update are listed below:
Data types that are not available for Mass Update are listed below:
The following field is available for Mass Update:
|
¢
|
Drop Down List. For DropDown, MultiSelect, and Radio field data types. For information on creating a drop-down list, see To create a drop-down list.
|
¢
|
Min Value. Sugar displays this field if you select the Integer data type. Enter a minimum value during data input.
|
¢
|
Max Value. Sugar displays this field when you select the Integer data type. Enter a maximum value during data input.
|
¢
|
Auto Increment Next Value. You can specify an incremental value for the next number for numerical fields such as bug numbers and case numbers.
|
¢
|
Precision. Sugar displays this field when you select the Decimal data type. Enter a number to specify the number of digits to the right of the decimal point.
|
¢
|
Required Field. Select this option to specify that users must enter a value for the field when creating a record.
|
¢
|
Audit. Select this option to display field values when a user clicks View Change Log on a record’s Detail View.
|
¢
|
Importable. From the drop-down list, select one of the following:
|