{"id": "1daa17712cd0-0", "text": "User Interface\nOverview\nSugar's user interface is dependent on the client (i.e. base, mobile, or portal) being used to access the system. Clients are the various platforms that use Sugar's APIs to render the user interface. Each platform type will have a specific path for its components. While the Developer Guide mainly covers the base client type, the following sections will outline the various metadata locations.\nClients\nClients are the various platforms that access and use\u00c2\u00a0Sidecar to render content. Depending on the platform you are using, the layout, view, and metadata will be driven based on its client type. The following sections describe the client types.\nbase\nThe base client is the Sugar application that you use to access your data from a web browser. The framework's specific views, layouts, and fields are rendered using\u00c2\u00a0Sidecar. \u00c2\u00a0Files specific to this client type can be found in the following directories:\n./clients/base/\n./custom/clients/base/\n./modules//clients/base/\n./custom/modules//clients/base/\nmobile\nThe mobile client is the SugarCRM mobile application\u00c2\u00a0that you use to access data from your mobile device. The framework-specific views, layouts, and fields for this application are\u00c2\u00a0found in the following directories:\n./clients/mobile/\n./custom/clients/mobile/\n./modules//clients/mobile/\n./custom/modules//clients/mobile/\nportal\nThe portal client is the customer self-service portal application that comes with Sugar\u00c2\u00a0Enterprise and Sugar Ultimate.\u00c2\u00a0The framework-specific views, layouts, and fields for this application are\u00c2\u00a0found in the following directories:\n./clients/portal/\n./custom/clients/portal/\n./modules//clients/portal/\n./custom/modules//clients/portal/", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/index.html"} {"id": "1daa17712cd0-1", "text": "TopicsSidecarSidecar is a platform that moves processing to the client side to render pages as single-page web apps. Sidecar contains a complete Model-View-Controller (MVC) framework based on the Backbone.js library.EventsThe Backbone events module is a lightweight pub-sub pattern that gets mixed into each Backbone class (Model, View, Collection, Router, etc.). This means that you can listen to or dispatch custom named events from any Backbone object.RoutesRoutes determine where users are directed based on patterns in the URL.HandlebarsThe Handlebars library, located in ./sidecar/lib/handlebars/, is a JavaScript library that lets Sugar create semantic templates. Handlebars help render content for layouts, views, and fields for Sidecar. Using Handlebars, you can make modifications to the display of content such as adding HTML or CSS.LayoutsLayouts are component plugins that define the overall layout and positioning of the page. Layouts replace the previous concept of MVC views and are used system-wide to generate rows, columns, bootstrap fluid layouts, and pop-ups by wrapping and placing multiple views or nested layouts on a page.ViewsViews are component plugins that render data from a context. View components may contain field components and are typically made up of a controller JavaScript file (.js) and at least one Handlebars template (.hbs).FieldsFields are component plugins that render and format field values. They are made up of a controller JavaScript file (.js) and at least one Handlebars template (.hbt). For more information regarding the data handling of a field, please refer the data framework fields documentation. For information on creating custom field types, please refer the Creating Custom Field Types cookbook example.SubpanelsFor Sidecar, Sugar's subpanel layouts have been modified to work as simplified metadata. This page is an overview of the metadata framework for subpanels.DashletsDashlets are special view-component plugins that render data from a context and make use of the Dashlet plugin. They are typically made up", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/index.html"} {"id": "1daa17712cd0-2", "text": "that render data from a context and make use of the Dashlet plugin. They are typically made up of a controller JavaScript file (.js) and at least one Handlebars template (.hbs).DrawersThe drawer layout widget, located in ./clients/base/layouts/drawer/, is used to display a window of additional content to the user. This window can then be closed to display the content the user was previously viewing.AlertsThe alert view widget, located in ./clients/base/views/alert/, displays helpful information such as loading messages, notices, and confirmation messages to the user.LanguageThe language library, located in ./sidecar/src/core/language.js, is used to manage the user's display language as well as fetch labels and lists. For more information on customizing languages, please visit the language framework documentation.MainLayoutSugar's Main navigation is split into two components: Top-Header and Sidebar. The Top-Header is primarily used for search, notifications, and user actions and the Sidebar is the primary tool used to navigate the front end of the Sugar application.Administration LinksAdministration links are the shortcut URLs found on the Administration page in the Sugar application. Developers can create additional administration links using the extension framework.Legacy MVCThe legacy MVC Architecture.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/index.html"} {"id": "1daa17712cd0-3", "text": "Last modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/index.html"} {"id": "3537f8ac3d5e-0", "text": "Layouts\nOverview\nLayouts are component plugins that define the overall layout and positioning of the page. Layouts replace the previous concept of MVC views and are used system-wide to generate rows, columns, bootstrap fluid layouts, and pop-ups by wrapping and placing multiple views or nested layouts on a page.\nLayout components are typically made up of a controller JavaScript file (.js) and a PHP file (.php), however, layout types vary and are not dependent on having both files.\nHierarchy Diagram\nThe layout components are loaded in the following manner:\nNote: The Sugar application client type is \"base\". For more information on the various client types, please refer to\u00c2\u00a0the User Interface page.\nSidecar Layout Routing\nSidecar uses routing to determine where to direct the user. To route the user to a specific page in Sugar, refer to the following default URL formats:\nBehavior\nURL Format\nRoute the user to the list layout for a module\nhttp://{site url}/#/\nRoute the user to the record layout for a specific record\nhttp://{site url}/#/f82d09cb-48cd-a1fb-beae-521cf39247b5\nRoute the user to a custom layout for the module\nhttp://{site url}/#/layout/\nLayout Example\nThe list layout, located in ./clients/base/layouts/list/, handles the layout for the list view. The sections below outline the various files that render this view.\nJavaScript\nThe file list.js, shown below, contains the JavaScript used to place the layout content.\n./clients/base/layouts/list/list.js\n/**\n* Layout that places components using bootstrap fluid layout divs\n* @class View.Layouts.ListLayout\n* @extends View.FluidLayout\n*/\n({\n /**\n * Places a view's element on the page. \n * @param {View.View} comp", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Layouts/index.html"} {"id": "3537f8ac3d5e-1", "text": "* @param {View.View} comp\n * @protected\n * @method\n */\n _placeComponent: function(comp, def) {\n var size = def.size || 12;\n // Helper to create boiler plate layout containers\n function createLayoutContainers(self) {\n // Only creates the containers once\n if (!self.$el.children()[0]) {\n comp.$el.addClass('list');\n }\n }\n createLayoutContainers(this);\n // All components of this layout will be placed within the\n // innermost container div.\n this.$el.append(comp.el);\n }\n})\nLayout Definition\nThe layout definition is contained as an array in list.php. This layout definition contains four views:\nmassupdate\nmassaddtolist\nrecordlist\nlist-bottom\n./clients/base/layouts/list/list.php\n\n array(\n array(\n 'view' => 'massupdate',\n ),\n array(\n 'view' => 'massaddtolist',\n ),\n array(\n 'view' => 'recordlist',\n 'primary' => true,\n ),\n array(\n 'view' => 'list-bottom',\n ),\n ),\n 'type' => 'simple',\n 'name' => 'list',\n 'span' => 12,\n);\nApplication\nFor information on working with layouts, please refer to the Creating Layouts and Overriding Layouts pages for practical examples.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Layouts/index.html"} {"id": "3537f8ac3d5e-2", "text": "TopicsCreating LayoutsThis example explains how to create a custom layout to define the various components that load on a page.Overriding LayoutsThis page explains how to override a stock layout component. For this example, we will extend the stock record view and create a custom view named \"my-record\" that will be used in our record layout's override. This example involves two steps:\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Layouts/index.html"} {"id": "a9a9c9ff86a7-0", "text": "Overriding Layouts\nOverview\nThis page explains how to override a stock layout component. For this example, we will extend the stock record view and create a custom view named \"my-record\" that will be used in our record layout's override. This example involves two\u00c2\u00a0steps:\nOverride the Layout\nExtend the View\nThese steps are explained in the following sections.\nOverriding the Layout\nFirst,\u00c2\u00a0copy ./clients/base/layouts/record/record.php to ./custom/clients/base/layouts/record/record.php. Once copied, modify the following line from:\n'view' => 'record',\nTo:\n'view' => 'my-record',\nThat line will change the record layout from using the base record.js view, ./clients/base/views/record/record.js, to instead use a custom view that we will create in ./custom/clients/base/views/my-record/my-record.js. At this point, the\u00c2\u00a0custom layout override should be very similar to the example below:\n./custom/clients/base/layouts/record/record.php\n array(\n array(\n 'layout' => array(\n 'type' => 'default',\n 'name' => 'sidebar',\n 'components' => array(\n array(\n 'layout' => array(\n 'type' => 'base',\n 'name' => 'main-pane',\n 'css_class' => 'main-pane span8',\n 'components' => array(\n array(\n 'view' => 'my-record',\n 'primary' => true,\n ),\n array(\n 'layout' => 'extra-info',\n ),\n array(\n 'layout' => array(\n 'type' => 'filterpanel',", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Layouts/Overriding_Layouts/index.html"} {"id": "a9a9c9ff86a7-1", "text": "'layout' => array(\n 'type' => 'filterpanel',\n 'last_state' => array(\n 'id' => 'record-filterpanel',\n 'defaults' => array(\n 'toggle-view' => 'subpanels',\n ),\n ),\n 'refresh_button' => true,\n 'availableToggles' => array(\n array(\n 'name' => 'subpanels',\n 'icon' => 'fa-table',\n 'label' => 'LBL_DATA_VIEW',\n ),\n array(\n 'name' => 'list',\n 'icon' => 'fa-table',\n 'label' => 'LBL_LISTVIEW',\n ),\n array(\n 'name' => 'activitystream',\n 'icon' => 'fa-clock-o',\n 'label' => 'LBL_ACTIVITY_STREAM',\n ),\n ),\n 'components' => array(\n array(\n 'layout' => 'filter',\n 'xmeta' => array(\n 'layoutType' => '',\n ),\n 'loadModule' => 'Filters',\n ),\n array(\n 'view' => 'filter-rows',\n ),\n array(\n 'view' => 'filter-actions',\n ),\n array(\n 'layout' => 'activitystream',\n 'context' =>\n array(\n 'module' => 'Activities',\n ),\n ),\n array(\n 'layout' => 'subpanels',\n ),\n ),\n ),\n ),\n ),\n ),\n ),\n array(\n 'layout' => array(\n 'type' => 'base',\n 'name' => 'dashboard-pane',", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Layouts/Overriding_Layouts/index.html"} {"id": "a9a9c9ff86a7-2", "text": "'type' => 'base',\n 'name' => 'dashboard-pane',\n 'css_class' => 'dashboard-pane',\n 'components' => array(\n array(\n 'layout' => array(\n 'type' => 'dashboard',\n 'last_state' => array(\n 'id' => 'last-visit',\n )\n ),\n 'context' => array(\n 'forceNew' => true,\n 'module' => 'Home',\n ),\n 'loadModule' => 'Dashboards',\n ),\n ),\n ),\n ),\n array(\n 'layout' => array(\n 'type' => 'base',\n 'name' => 'preview-pane',\n 'css_class' => 'preview-pane',\n 'components' => array(\n array(\n 'layout' => 'preview',\n ),\n ),\n ),\n ),\n ),\n ),\n ),\n ),\n);\nExtending the View\nFor this example, we will extend the stock record view and create a custom view named my-record that will be used in our record layouts override.\n./custom/clients/base/views/my-record/my-record.js\n({\n extendsFrom: 'RecordView',\n initialize: function (options) {\n this._super(\"initialize\", [options]);\n //log this point\n console.log(\"**** Override called\");\n }\n})\nOnce the files are in place, navigate to Admin > Repair > Quick Repair and Rebuild.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Layouts/Overriding_Layouts/index.html"} {"id": "3177da3143e2-0", "text": "Creating Layouts\nOverview\nThis example\u00c2\u00a0explains how\u00c2\u00a0to create a custom layout to define the various components that load on a\u00c2\u00a0page.\u00c2\u00a0\nCreating the Layout\nThis example creates a component named \"my-layout\", which\u00c2\u00a0will render a custom view named \"my-view\".\n./custom/clients/base/layouts/my-layout/my-layout.php\n 'simple',\n 'components' => array(\n array(\n 'view' => 'my-view',\n ),\n ),\n );\nCreating a View\nThe view component will render the actual content we want to see on the page. The view below will display a clickable cube icon that will spin when clicked by the user.\n./custom/clients/base/views/my-view/my-view.js\n({\n className: 'my-view tcenter',\n cubeOptions: {\n spin: false\n },\n events: {\n 'click .sugar-cube': 'spinCube'\n },\n spinCube: function() {\n this.cubeOptions.spin = !this.cubeOptions.spin;\n this.render();\n }\n})\n./custom/clients/base/views/my-view/my-view.hbs\n\n

My View

\n{{{subFieldTemplate 'sugar-cube' 'detail' cubeOptions}}}\n

Click to spin the cube!

", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Layouts/Creating_Layouts/index.html"} {"id": "3177da3143e2-1", "text": "

Click to spin the cube!

\nOnce the files are in place, navigate to Admin > Repair and perform a Quick Repair and Rebuild.\nNavigating to the Layout\nTo see this new\u00c2\u00a0layout and view, navigate to http://{site url}/#/layout/my-layout.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Layouts/Creating_Layouts/index.html"} {"id": "033d501482fe-0", "text": "Language\nOverview\nThe language library, located in ./sidecar/src/core/language.js, is used to manage the user's display language as well as fetch labels and lists. For more information on customizing languages, please visit the language framework documentation.\nMethods\napp.lang.get(key, module, context)\nThe app.lang.get(key, module, context) method fetches a string for a given key. The method searches the module strings first and then falls back to the app strings. If the label is a template, it will be compiled and executed with the given context.\nParameters\nName\nRequired\nDescription\nkey\nyes\nThe key of the string to retrieve\nmodule\nno\nThe Sugar module that the label belongs to\ncontext\nno\nTemplate context\nExample\napp.lang.get('LBL_NAME', 'Accounts');\napp.lang.getAppString(key)\nThe app.lang.getAppString(key) method retrieves an application string for a given key.\nParameters\nName\nRequired\nDescription\nkey\nyes\nThe key of the string to retrieve\nExample\napp.lang.getAppString('LBL_MODULE');\napp.lang.getAppListStrings(key)\nThe app.lang.getAppListStrings(key) method retrieves an application list string or object.\nParameters\nName\nRequired\nDescription\nkey\nyes\nThe key of the string to retrieve\nExample\napp.lang.getAppListStrings('sales_stage_dom');\napp.lang.getModuleSingular(moduleKey)\nThe app.lang.getModuleSingular(moduleKey) method retrieves an application list string or object.\nParameters\nName\nRequired\nDescription\nmoduleKey\nyes\nThe module key of the singular module label to retrieve\nExample\napp.lang.getModuleSingular(\"Accounts\");\napp.lang.getLanguage()\nThe app.lang.getLanguage() method retrieves the current user's language key.\nExample\napp.lang.getLanguage();\napp.lang.updateLanguage(languageKey)", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Language/index.html"} {"id": "033d501482fe-1", "text": "Example\napp.lang.getLanguage();\napp.lang.updateLanguage(languageKey)\nThe app.lang.updateLanguage(languageKey) method updates the current user's language key.\nParameters\nName\nRequired\nDescription\nlanguageKey\nyes\nLanguage key of the language to set for the user\nExample\napp.lang.updateLanguage('en_us');\nTesting in Console\nTo test out the language library, you can trigger actions\u00c2\u00a0in your browsers developer tools by using the global Apps variable as shown below:\nApp.lang.getAppListStrings('sales_stage_dom');\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Language/index.html"} {"id": "3a76fdeb8516-0", "text": "Subpanels\nOverview\nFor Sidecar, Sugar's subpanel layouts have been modified to work as simplified metadata.\u00c2\u00a0This page is an\u00c2\u00a0overview of the metadata framework for subpanels.\u00c2\u00a0\nThe reason for this change is that previous versions of Sugar generated the metadata from various sources such as the SubPanelLayout and MetaDataManager classes. This eliminates the need for generating and processing the layouts and allows the metadata to be easily loaded to Sidecar.\nNote:\u00c2\u00a0Modules running in backward compatibility mode do not use the Sidecar subpanel layouts as they use the legacy MVC framework.\nHierarchy Diagram\nWhen loading the Sidecar subpanel layouts, the system processes the layout in the following manner:\nNote: The Sugar application's client type is \"base\". For more information on the various client types, please refer to\u00c2\u00a0the User Interface page.\nSubpanels and Subpanel Layouts\nSugar contains both a subpanels (plural) layout and a subpanel (singular) layout. The subpanels layout contains the collection of subpanels,\u00c2\u00a0whereas\u00c2\u00a0the subpanel layout renders the actual subpanel widget.\nAn example of a stock module's subpanels layout is:\n./modules/Bugs/clients/base/layouts/subpanels/subpanels.php\n array (\n array (\n 'layout' => 'subpanel',\n 'label' => 'LBL_DOCUMENTS_SUBPANEL_TITLE',\n 'context' => array (\n 'link' => 'documents',\n ),\n ),\n array (\n 'layout' => 'subpanel',\n 'label' => 'LBL_CONTACTS_SUBPANEL_TITLE',\n 'context' => array (\n 'link' => 'contacts',\n ),\n ),\n array (", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Subpanels/index.html"} {"id": "3a76fdeb8516-1", "text": "'link' => 'contacts',\n ),\n ),\n array (\n 'layout' => 'subpanel',\n 'label' => 'LBL_ACCOUNTS_SUBPANEL_TITLE',\n 'context' => array (\n 'link' => 'accounts',\n ),\n ),\n array (\n 'layout' => 'subpanel',\n 'label' => 'LBL_CASES_SUBPANEL_TITLE',\n 'context' => array (\n 'link' => 'cases',\n ),\n ),\n ),\n 'type' => 'subpanels',\n 'span' => 12,\n);\nYou can see that the layout incorporates the use of the subpanel layout for each module. As most of the subpanel data is similar, this approach allows us to use less duplicate code. The subpanel layout, shown below, shows the three views that make up the subpanel widgets users see.\n./clients/base/layouts/subpanel/subpanel.php\n array (\n array (\n 'view' => 'panel-top',\n )\n array (\n 'view' => 'subpanel-list',\n ),\n array (\n 'view' => 'list-bottom',\n ),\n ),\n 'span' => 12,\n 'last_state' => array(\n 'id' => 'subpanel'\n ),\n);\nAdding Subpanel Layouts", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Subpanels/index.html"} {"id": "3a76fdeb8516-2", "text": "),\n);\nAdding Subpanel Layouts\nWhen a new relationship is deployed from Studio, the relationship creation process will generate the layouts using the extension framework. You should note that for stock relationships and custom deployed relationships, layouts are generated for both Sidecar and Legacy MVC Subpanel formats. This is done to ensure that any related modules, whether in Sidecar or Backward Compatibility mode, display a related subpanel as expected.\nSidecar Layouts\nCustom Sidecar layouts, located in ./custom/Extension/modules//Ext/clients//layouts/subpanels/, are compiled into ./custom/modules//Ext/clients//layouts/subpanels/subpanels.ext.php using the extension framework. When a relationship is saved, layout files are created for both the \"base\" and \"mobile\" client types.\nFor example, deploying a 1:M relationship from Bugs to Leads will generate the following Sidecar files:\n./custom/Extension/modules/Bugs/Ext/clients/base/layouts/subpanels/bugs_leads_1_Bugs.php\n 'subpanel',\n 'label' => 'LBL_BUGS_LEADS_1_FROM_LEADS_TITLE',\n 'context' =>\n array (\n 'link' => 'bugs_leads_1',\n ),\n);\n./custom/Extension/modules/Bugs/Ext/clients/mobile/layouts/subpanels/bugs_leads_1_Bugs.php\n 'subpanel',\n 'label' => 'LBL_BUGS_LEADS_1_FROM_LEADS_TITLE',\n 'context' =>\n array (\n 'link' => 'bugs_leads_1',\n ),", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Subpanels/index.html"} {"id": "3a76fdeb8516-3", "text": "array (\n 'link' => 'bugs_leads_1',\n ),\n);\nNote: The additional legacy MVC layouts generated by a relationships deployment are described below.\nLegacy MVC Subpanel Layouts\nCustom Legacy MVC Subpanel layouts, located in ./custom/Extension/modules//Ext/Layoutdefs/, are compiled into ./custom/modules//Ext/Layoutdefs/layoutdefs.ext.php using the extension framework. You should also note that when a relationship is saved, wireless layouts, located in ./custom/Extension/modules//Ext/WirelessLayoutdefs/, are created and compiled into ./custom/modules//Ext/Layoutdefs/layoutdefs.ext.php.\nAn example of this is when deploying a 1-M relationship from Bugs to Leads, the following layoutdef files are generated:\n./custom/Extension/modules/Bugs/Ext/Layoutdefs/bugs_leads_1_Bugs.php\n 100,\n 'module' => 'Leads',\n 'subpanel_name' => 'default',\n 'sort_order' => 'asc',\n 'sort_by' => 'id',\n 'title_key' => 'LBL_BUGS_LEADS_1_FROM_LEADS_TITLE',\n 'get_subpanel_data' => 'bugs_leads_1',\n 'top_buttons' =>\n array (\n 0 =>\n array (\n 'widget_class' => 'SubPanelTopButtonQuickCreate',\n ),\n 1 =>\n array (\n 'widget_class' => 'SubPanelTopSelectButton',\n 'mode' => 'MultiSelect',\n ),\n ),\n);", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Subpanels/index.html"} {"id": "3a76fdeb8516-4", "text": "'mode' => 'MultiSelect',\n ),\n ),\n);\n./custom/Extension/modules/Bugs/Ext/WirelessLayoutdefs/bugs_leads_1_Bugs.php\n 100,\n 'module' => 'Leads',\n 'subpanel_name' => 'default',\n 'title_key' => 'LBL_BUGS_LEADS_1_FROM_LEADS_TITLE',\n 'get_subpanel_data' => 'bugs_leads_1',\n);\nFields Metadata\nSidecar's subpanel field layouts are initially defined by the subpanel list-view metadata.\nHierarchy Diagram\nThe subpanel list metadata is loaded in the following manner:\nNote: The Sugar application's client type is \"base\". For more information on the various client types, please refer to\u00c2\u00a0the User Interface page.\nSubpanel List Views\nBy default, all modules come with a default set of subpanel fields for when they are rendered as a subpanel. An example of this is can be found in the Bugs module:\n./modules/Bugs/clients/base/views/subpanel-list/subpanel-list.php\n\n array (\n 'type' => 'fullname',\n 'link' => true,\n 'studio' =>\n array (\n 'listview' => false,\n ),\n 'vname' => 'LBL_NAME',\n 'width' => '10%',\n 'default' => true,\n ),\n 'date_entered' =>\n array (\n 'type' => 'datetime',\n 'studio' =>\n array (", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Subpanels/index.html"} {"id": "3a76fdeb8516-5", "text": "'type' => 'datetime',\n 'studio' =>\n array (\n 'portaleditview' => false,\n ),\n 'readonly' => true,\n 'vname' => 'LBL_DATE_ENTERED',\n 'width' => '10%',\n 'default' => true,\n ),\n 'refered_by' =>\n array (\n 'vname' => 'LBL_LIST_REFERED_BY',\n 'width' => '10%',\n 'default' => true,\n ),\n 'lead_source' =>\n array (\n 'vname' => 'LBL_LIST_LEAD_SOURCE',\n 'width' => '10%',\n 'default' => true,\n ),\n 'phone_work' =>\n array (\n 'vname' => 'LBL_LIST_PHONE',\n 'width' => '10%',\n 'default' => true,\n ),\n 'lead_source_description' =>\n array (\n 'name' => 'lead_source_description',\n 'vname' => 'LBL_LIST_LEAD_SOURCE_DESCRIPTION',\n 'width' => '10%',\n 'sortable' => false,\n 'default' => true,\n ),\n 'assigned_user_name' =>\n array (\n 'name' => 'assigned_user_name',\n 'vname' => 'LBL_LIST_ASSIGNED_TO_NAME',\n 'widget_class' => 'SubPanelDetailViewLink',\n 'target_record_key' => 'assigned_user_id',\n 'target_module' => 'Employees',\n 'width' => '10%',\n 'default' => true,\n ),\n 'first_name' =>\n array (\n 'usage' => 'query_only',\n ),\n 'last_name' =>", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Subpanels/index.html"} {"id": "3a76fdeb8516-6", "text": "'usage' => 'query_only',\n ),\n 'last_name' =>\n array (\n 'usage' => 'query_only',\n ),\n 'salutation' =>\n array (\n 'name' => 'salutation',\n 'usage' => 'query_only',\n ),\n);\nTo modify this layout, navigate to Admin > Studio > {Parent Module} > Subpanels > Bugs and make your changes. Once saved, Sugar will generate ./custom/modules/Bugs/clients//views/subpanel-for-/subpanel-for-.php which will be used for rendering the fields you selected.\nYou should note that, just as Sugar mimics the Sidecar layouts in the legacy MVC framework for modules in backward compatibility, it also mimics the field list in ./modules//metadata/subpanels/default.php and ./custom/modules//metadata/subpanels/default.php. This is done to ensure that any related modules, whether in Sidecar or Backward Compatibility mode, display the same field list as expected.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Subpanels/index.html"} {"id": "80d585ae9be3-0", "text": "Legacy MVC\nOverview\nThe\u00c2\u00a0legacy MVC Architecture.\nYou should note that the MVC architecture is being deprecated and is being replaced with sidecar. Until the framework is fully deprecated, modules set in backward compatibility mode will still use the MVC framework.\nModel-View-Controller (MVC) Overview\nA model-view-controller, or MVC, is a design philosophy that creates a distinct separation between business-logic and display logic.\nModel : This is the data object built by the business/application logic needed to present in the user interface. For Sugar, it is represented by the SugarBean and all subclasses of the SugarBean.\nView : This is the display layer which is responsible for rendering data from the Model to the end-user.\nController : This is the layer that handles user events such as \"Save\" and determines what business logic actions to take to build the model, and which view to load for rendering the data to end users.\nSugarCRM MVC Implementation\nThe following is a sequence diagram that highlights some of the main components involved within the Sugar MVC framework.\n\u00c2\u00a0\nTopicsViewDisplaying information to the browser.ControllerThe basic actions of a module.MetadataAn overview of the legacy MVC metadata framework.ExamplesProvides an overview of example MVC customizations.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/index.html"} {"id": "fef8b569439a-0", "text": "Controller\nOverview\nThe basic actions of a module.\nControllers\nThe main controller, named SugarController, addresses the basic actions of a module from EditView and DetailView to saving a record. Each module can override this SugarController by adding a controller.php file into its directory. This file extends the SugarController, and the naming convention for the class is: Controller\nInside the controller, you define an action method. The naming convention for the method is: action_\nThere are more fine-grained control mechanisms that a developer can use to override the controller processing. For example, if a developer wanted to create a new save action, there are three places where they could possibly override.\naction_save: This is the broadest specification and gives the user full control over the save process.\npre_save: A user could override the population of parameters from the form.\npost_save: This is where the view is being set up. At this point, the developer could set a redirect URL, do some post-save processing, or set a different view.\nUpgrade-Safe Implementation\nYou can also add a custom Controller that extends the module's Controller if such a Controller already exists. For example, if you want to extend the Controller for a module, you should check if that module already has a module-specific controller. If so, you extend from that controller class. Otherwise, you extend from SugarController class. In both cases, you should place the custom controller class file in ./custom/modules//Controller.php instead of the module directory. Doing so makes your customization upgrade-safe.\nFile Structure\n./include/MVC/Controller/SugarController.php\n./include/MVC/Controller/ControllerFactory.php\n./modules//Controller.php\n./custom/modules//controller.php\nImplementation\nIf the module does not contain a controller.php file in ./modules//, you will create the following file:", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/Controller/index.html"} {"id": "fef8b569439a-1", "text": "./custom/modules//controller.php\nclass Controller extends SugarController\n{\n function action_()\n {\n $this->view = '';\n }\n}\nIf the module does contain a controller.php file, you will need to extend it by doing the following:\n./custom/modules//controller.php\nrequire_once 'modules//controller.php';\nclass CustomController extends Controller\n{\n function action_()\n {\n $this->view = '';\n }\n}\nNote: When creating or moving files you will need to rebuild the file map.\nMore information on rebuilding the file map can be found in the SugarAutoLoader.\nMapping Actions to Files\nYou can choose not to provide a custom action method as defined above, and instead, specify your mappings of actions to files in $action_file_map. Take a look at ./include/MVC/Controller/action_file_map.php as an example:\n$action_file_map['subpanelviewer'] = 'include/SubPanel/SubPanelViewer.php';\n$action_file_map['save2'] = 'include/generic/Save2.php';\n$action_file_map['deleterelationship'] = 'include/generic/DeleteRelationship.php';\n$action_file_map['import'] = 'modules/Import/index.php';\nHere the developer has the opportunity to map an action to a file. For example, Sugar uses a generic sub-panel file for handling subpanel actions. You can see above that there is an entry mapping the action 'subpanelviewer' to ./include/SubPanel/SubPanelViewer.php.\nThe base SugarController class loads the action mappings in the following path sequence:\n./include/MVC/Controller\n./modules/\n./custom/modules/\n./custom/include/MVC/Controller", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/Controller/index.html"} {"id": "fef8b569439a-2", "text": "./custom/modules/\n./custom/include/MVC/Controller\nEach one loads and overrides the previous definition if in conflict. You can drop a new action_file_map in the later path sequence that extends or overrides the mappings defined in the previous one.\nUpgrade-Safe Implementation\nIf you want to add custom action_file_map.php to an existing module that came with the SugarCRM release, you should place the file at ./custom/modules//action_file_map.php\nFile Structure\n./include/MVC/Controller/action_file_map.php\n./modules//action_file_map.php\n./custom/modules//action_file_map.php\nImplementation\n$action_file_map['soapRetrieve'] = 'custom/SoapRetrieve/soap.php';\nClassic Support (Not Recommended)\nClassic support allows you to have files that represent actions within your module. Essentially, you can drop in a PHP file into your module and have that be handled as an action. This is not recommended, but is considered acceptable for backward compatibility. The better practice is to take advantage of the action_ structure.\nFile Structure\n./modules//.php\nController Flow Overview\nFor example, if a request comes in for DetailView the controller will handle the request as follows:\nStart in index.php and load the SugarApplication instance.\nSugarApplication instantiates the SugarControllerFactory.\nSugarControllerFactory loads the appropriate Controller.\nSugarControllerFactory checks for ./custom/modules//Controller.php.\nIf not found, check for ./modules//Controller.php.\nIf not found, load SugarController.php.\nCalls on the appropriate action.\nLook for ./custom/modules//.php. If found and ./custom/modules//views/view..php is not found, use this view.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/Controller/index.html"} {"id": "fef8b569439a-3", "text": "If not found check for modules//.php. If found and ./modules//views/view..php is not found, then use the ./modules//.php action.\nIf not found, check for the method action_ in the controller.\nIf not found, check for an action_file_mapping.\nIf not found, report error \"Action is not defined\".\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/Controller/index.html"} {"id": "8de86a97c55a-0", "text": "View\nOverview\nDisplaying information to the browser.\nWhat are Views?\nViews, otherwise known as actions, are typically used to render views or to process logic. Views are not just limited to HTML data. You can send JSON encoded data as part of a view or any other structure you wish. As with the controllers, there is a default class called SugarView which implements much of the basic logic for views, such as handling of headers and footers.\nThere are five main actions for a module:\nDisplay Actions\nDetail View: A detail view displays a read-only view of a particular record. Usually, this is accessed via the list view. The detail view displays the details of the object itself and related items (subpanels). Subpanels are miniature list views of items that are related to the parent object. For example, Tasks assigned to a Project, or Contacts for an Opportunity will appear in subpanels in the Project or Opportunity detail view. The file .//metadata/detailviewdefs.php defines a module's detail view page layout. The file .//metadata/subpaneldefs.php defines the subpanels that are displayed in the module's detail view page.\nEdit View: The edit view page is accessed when a user creates a new record or edits details of an existing one. Edit view can also be accessed directly from the list view. The file .//metadata/editviewdefs.php defines a module's edit view page layout.\nList View: This Controller action enables the search form and search results for a module. Users can perform actions such as delete, export, update multiple records (mass update), and drill into a specific record to view and edit the details. Users can see this view by default when they click one of the module tabs at the top of the page. Files in each module describe the contents of the list and search view.\nProcess Actions", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/View/index.html"} {"id": "8de86a97c55a-1", "text": "Process Actions\nSave: This Controller action is processed when the user clicks Save in the record's edit view.\nDelete: This action is processed when the user clicks \"Delete\" in the detail view of a record or in the detail view of a record listed in a subpanel.\nImplementation\nClass File Structure\n./include/MVC/Views/SugarView.php\n./include/MVC/Views/view..php\n./custom/include/MVC/Views/view..php\n./modules//views/view..php\n./custom/modules//views/view..php\nClass Loading\nThe ViewFactory class loads the view based off the the following sequence loading the first file it finds:\n./custom/modules//views/view..php\n./modules//views/view..php\n./custom/include/MVC/View/view..php\n./include/MVC/Views/view..php\nMethods\nThere are two main methods to override within a view:\npreDisplay(): This performs pre-processing within a view. This method is relevant only for extending existing views. For example, the include/MVC/View/views/view.edit.php file uses it, and enables developers who wishes to extend this view to leverage all of the logic done in preDisplay() and either override the display() method completely or within your own display() method call parent::display().\ndisplay(): This method displays the data to the screen. Place the logic to display output to the screen here.\nCreating Views\nCreating a new/view action consists of a controller action and a view file. The first step is to define your controller action. If the module does not contain a controller.php file in ./modules// you will create the following file:\n./custom/modules//controller.php\nController extends SugarController\n{\n function action_MyView()", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/View/index.html"} {"id": "8de86a97c55a-2", "text": "class Controller extends SugarController\n{\n function action_MyView()\n {\n $this->view = 'myview';\n }\n}\nMore information on controllers can be found in the Controller section.\nThe next step is to define your view file. This example extends the ViewDetail class but you can extend any of the classes you choose in ./include/MVC/View/views/.\n./custom/modules//views/view.newview.php\nViewMyView extends ViewDetail\n{\n function display()\n {\n echo 'This is my new view
';\n }\n}\nOverriding Views\nThe following section will demonstrate how to extend and override a view. When overriding existing actions and views, you won't need to make any changes to the controller. This approach will be very similar for any view you may choose to modify. If the module you are extending the view for does not contain an existing view in its modules views directory ( ./modules//views/ ), you will need to extend the views base class. Otherwise, you will extend the view class found within the file.\nIn the case of a detail view, you would check for the file ./modules//views/view.detail.php. If this file does not exist, you will create ./custom/modules//views/view.detail.php and extend the base ViewDetail class with the name ViewDetail.\n./custom/modules//views/view.detail.php\nViewDetail extends ViewDetail\n{\n function display()\n {\n echo 'This is my addition to the DetailView
';\n //call parent display method\n parent::display();\n }\n}", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/View/index.html"} {"id": "8de86a97c55a-3", "text": "//call parent display method\n parent::display();\n }\n}\nIf ./modules//views/view.detail.php does exist, you would create ./custom/modules//views/view.detail.php and extend the base ViewDetail class with the name CustomViewDetail.\n./custom/modules//views/view.detail.php\n/views/view.detail.php');\nclass CustomViewDetail extends ViewDetail\n{\n function display()\n {\n echo 'This is my addition to the DetailView
';\n //call parent display method\n parent::display();\n }\n}\nDisplay Options for Views\nThe Sugar MVC provides developers with granular control over how the screen looks when a view is rendered. Each view can have a config file associated with it. In the case of an edit view, the developer would create the file ./customs/modules//views/view.edit.config.php . When the edit view is rendered, this config file will be picked up. When loading the view, ViewFactory class will merge the view config files from the following possible locations with precedence order (high to low):\n./customs/modules//views/view..config.php\n./modules//views/view..config.php\n./custom/include/MVC/View/views/view..config.php\n./include/MVC/View/views/view..config.php\nImplementation\nThe format of these files is as follows:\n$view_config = array(\n 'actions' =>\n array(\n 'popup' => array(\n 'show_header' => false,\n 'show_subpanels' => false,\n 'show_search' => false, \n 'show_footer' => false,\n 'show_JavaScript' => true,\n ),", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/View/index.html"} {"id": "8de86a97c55a-4", "text": "'show_JavaScript' => true,\n ),\n ),\n 'req_params' => array(\n 'to_pdf' => array(\n 'param_value' => true,\n 'config' => array(\n 'show_all' => false\n ),\n ),\n ),\n);\nTo illustrate this process, let us take a look at how the 'popup' action is processed. In this case, the system will go to the actions entry within the view_config and determine the proper configuration. If the request contains the parameter to_pdf, and is set to be true, then it will automatically cause the show_all configuration parameter to be set false, which means none of the options will be displayed.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/View/index.html"} {"id": "b7b52ac14944-0", "text": "Examples\nProvides an overview of example MVC customizations.\u00c2\u00a0\nTopicsChanging the ListView Default Sort OrderThis article addresses the need to customize the advanced search layout options for modules in backward compatibility mode to change the default sort order from ascending to descending.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/Examples/index.html"} {"id": "f14b3f143ead-0", "text": "Changing the ListView Default Sort Order\nOverview\nThis article addresses the need to customize the advanced search layout options for modules in backward compatibility mode to change the default sort order from ascending to descending.\nCustomization Information\nThis customization is only for modules in backward compatibility mode and involves creating custom files that extend stock files. You should note that this customization does not address all scenarios within the view that may assign a sort order.\nExtending the Search Form\nFirst, we will need to extend the SearchForm class. To do this, we will create a CustomSearchForm class that extends the original SearchForm class located in ./include/SearchForm/SearchForm2.php. We will then override the _displayTabs method to check the $_REQUEST['sortOrder'] and default it to descending if it isn't set.\n./custom/include/SearchForm/SearchForm2.php\ntabs to show as the current tab\n *\n * @return string html\n */\n function _displayTabs($currentKey)\n {\n //check and set the default sort order\n if (!isset($_REQUEST['sortOrder']))\n {\n $_REQUEST['sortOrder'] = 'DESC';\n }\n return parent::_displayTabs($currentKey);;\n }\n}\n?>\nExtending the List View\nNext, we will need to extend the ListView. We will create a ViewCustomList class that extends the original ListView located in ./include/MVC/View/views/view.list.php. In the ViewCustomList class, we will override the prepareSearchForm and getSearchForm2 methods to call the CustomSearchForm class.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/Examples/Changing_the_ListView_Default_Sort_Order/index.html"} {"id": "f14b3f143ead-1", "text": "./custom/include/MVC/View/views/view.customlist.php\nsearchForm = null;\n //search\n $view = 'basic_search';\n if(!empty($_REQUEST['search_form_view']) && $_REQUEST['search_form_view'] == 'advanced_search')\n $view = $_REQUEST['search_form_view'];\n $this->headers = true;\n if(!empty($_REQUEST['search_form_only']) && $_REQUEST['search_form_only'])\n $this->headers = false;\n elseif(!isset($_REQUEST['search_form']) || $_REQUEST['search_form'] != 'false')\n {\n if(isset($_REQUEST['searchFormTab']) && $_REQUEST['searchFormTab'] == 'advanced_search')\n {\n $view = 'advanced_search';\n }\n else\n {\n $view = 'basic_search';\n }\n }\n $this->view = $view;\n $this->use_old_search = true;\n if (SugarAutoLoader::existingCustom('modules/' . $this->module . '/SearchForm.html') &&\n !SugarAutoLoader::existingCustom('modules/' . $this->module . '/metadata/searchdefs.php')) {\n require_once('include/SearchForm/SearchForm.php');\n $this->searchForm = new SearchForm($this->module, $this->seed);\n } else {\n $this->use_old_search = false;\n //Updated to require the extended CustomSearchForm class\n require_once('custom/include/SearchForm/SearchForm2.php');\n $searchMetaData = SearchForm::retrieveSearchDefs($this->module);", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/Examples/Changing_the_ListView_Default_Sort_Order/index.html"} {"id": "f14b3f143ead-2", "text": "$searchMetaData = SearchForm::retrieveSearchDefs($this->module);\n $this->searchForm = $this->getSearchForm2($this->seed, $this->module, $this->action);\n $this->searchForm->setup($searchMetaData['searchdefs'], $searchMetaData['searchFields'], 'SearchFormGeneric.tpl', $view, $this->listViewDefs);\n $this->searchForm->lv = $this->lv;\n }\n }\n /**\n * Returns the search form object\n *\n * @return SearchForm\n */\n protected function getSearchForm2($seed, $module, $action = \"index\")\n {\n //Updated to use the extended CustomSearchForm class\n return new CustomSearchForm($seed, $module, $action);\n }\n}\n?>\nExtending the Sugar Controller\nFinally, we will create a CustomSugarController class that extends the orginal SugarController located in ./include/MVC/Controller/SugarController.php. We will then need to override the do_action and post_action methods to execute their parent methods as well as the action_listview method to assign the custom view to the view attribute.\n./custom/include/MVC/Controller/SugarController.php\nview = 'customlist';\n }\n}\n?>\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/Examples/Changing_the_ListView_Default_Sort_Order/index.html"} {"id": "02125e64959d-0", "text": "Metadata\nOverview\nAn overview of the legacy MVC metadata framework.\nYou should note that the MVC architecture is being deprecated and is being replaced with sidecar. Until the framework is fully deprecated, modules set in backward compatibility mode will still use the legacy MVC framework.\nMetadata Framework\nBackground\nMetadata is defined as information about data. In Sugar, metadata refers to the framework of using files to abstract the presentation and business logic found in the system. The metadata framework is described in definition files that are processed using PHP. The processing usually includes the use of Smarty templates for rendering the presentation and JavaScript libraries to handle some business logic that affects conditional displays, input validation, and so on.\nApplication Metadata\nAll application modules are defined in the modules.php file. It contains several variables that define which modules are active and usable in the application.\nThe file is located under the '/include' folder. It contains the $moduleList() array variable which contains the reference to the array key to look up the string to be used to display the module in the tabs at the top of the application. The coding standard is for the value to be in the plural of the module name; for example, Contacts, Accounts, Widgets, and so on.\nThe $beanList() array stores a list of all active beans (modules) in the application. The $beanList entries are stored in a 'name' => 'value' fashion with the 'name' value being in the plural and the 'value' being in the singular of the module name. The 'value' of a $beanList() entry is used to lookup values in our next modules.php variable, the $beanFiles() array.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/Metadata/index.html"} {"id": "02125e64959d-1", "text": "The $beanFiles variable is also stored in a 'name' => 'value' fashion. The 'name', typically in singular, is a reference to the class name of the object, which is looked up from the $beanList 'value', and the 'value' is a reference to the class file.\nThe remaining relevant variables in the modules.php file are the $modInvisList variable which makes modules invisible in the regular user interface (i.e., no tab appears for these modules), and the $adminOnlyList which is an extra level of security for modules that are accessible only by administrators through the Admin page.\nModule Metadata\nThe following table lists the metadata definition files found in the modules/[module]/metadata directory, and a brief description of their purpose within the system.\nFile\nDescription\nadditionalDetails.php\nUsed to render the popup information displayed when a user hovers the mouse cursor over a row in the List View.\neditviewdefs.php\nUsed to render a record's EditView.\ndetailviewdefs.php\nUsed to render a record's DetailView.\nlistviewdefs.php\nUsed to render the List View display for a module.\nmetafiles.php\nUsed to override the location of the metadata definition file to be used. The EditView, DetailView, List View, and Popup code check for the presence of these files.\npopupdefs.php\nUsed to render and handle the search form and list view in popups.\nsearchdefs.php\nUsed to render a module's basic and advanced search form displays.\nsidecreateviewdefs.php\nUsed to render a module's quick create form shown in the side shortcut panel.\nsubpaneldefs.php\nUsed to render a module's subpanels shown when viewing a record's DetailView.\nSearchForm Metadata\nThe search form layout for each module is defined in the module's metadata file searchdefs.php. A sample of the Accounts searchdefs.php appears as:", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/Metadata/index.html"} {"id": "02125e64959d-2", "text": " array(\n 'maxColumns' => '3',\n 'widths' => array(\n 'label' => '10', \n 'field' => '30'\n )\n ),\n 'layout' => array(\n 'basic_search' => array(\n 'name',\n 'billing_address_city',\n 'phone_office',\n array(\n 'name' => 'address_street',\n 'label' => 'LBL_BILLING_ADDRESS',\n 'type' => 'name',\n 'group' => 'billing_address_street'\n ),\n array( \n 'name' => 'current_user_only',\n 'label' => 'LBL_CURRENT_USER_FILTER',\n 'type'=>'bool'\n ),\n ),\n 'advanced_search' => array(\n 'name',\n array( \n 'name' => 'address_street',\n 'label' => 'LBL_ANY_ADDRESS',\n 'type' => 'name'\n ),\n array( \n 'name' => 'phone',\n 'label' => 'LBL_ANY_PHONE',\n 'type' => 'name'\n ),\n 'website',\n array( \n 'name' => 'address_city',\n 'label' => 'LBL_CITY',\n 'type' => 'name'\n ),\n array( \n 'name' => 'email',\n 'label' =>'LBL_ANY_EMAIL',\n 'type' => 'name'\n ),\n 'annual_revenue',\n array( \n 'name' => 'address_state',\n 'label' =>'LBL_STATE',\n 'type' => 'name'", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/Metadata/index.html"} {"id": "02125e64959d-3", "text": "'label' =>'LBL_STATE',\n 'type' => 'name'\n ),\n 'employees',\n array( \n 'name' => 'address_postalcode',\n 'label' =>'LBL_POSTAL_CODE',\n 'type' => 'name'\n ),\n array(\n 'name' => 'billing_address_country',\n 'label' =>'LBL_COUNTRY',\n 'type' => 'name'\n ),\n 'ticker_symbol',\n 'sic_code',\n 'rating',\n 'ownership',\n array( \n 'name' => 'assigned_user_id',\n 'type' => 'enum',\n 'label' => 'LBL_ASSIGNED_TO',\n 'function' => array(\n 'name' =>'get_user_array',\n 'params' => array(false)\n )\n ),\n 'account_type',\n 'industry',\n ),\n ),\n );\n?>\nThe searchdefs.php file contains the Array variable $searchDefs with one entry. The key is the name of the module as defined in $moduleList array defined in include/modules.php. The $searchDefsarray is another array that describes the search form layout and fields.\nThe 'templateMeta' key points to another array that controls the maximum number of columns in each row of the search form ('maxColumns'), as well as layout spacing attributes as defined by 'widths'. In the above example, the generated search form files will allocate 10% of the width spacing to the labels and 30% for each field respectively.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/Metadata/index.html"} {"id": "02125e64959d-4", "text": "The 'layout' key points to another nested array which defines the fields to display in the basic and advanced search form tabs. Each individual field definition maps to a SugarField widget. See the SugarField widget section for an explanation about SugarField widgets and how they are rendered for the search form, DetailView, and EditView.\nThe searchdefs.php file is invoked from the MVC framework whenever a module's list view is rendered (see include/MVC/View/views/view.list.php). Within view.list.php, checks are made to see if the module has defined a SearchForm.html file. If this file exists, the MVC will run in classic mode and use the aforementioned include/SearchForm/SearchForm.php file to process the search form. Otherwise, the new search form processing is invoked using include/SearchForm/SearchForm2.php and the searchdefs.php file is scanned for, first under the custom/modules/[module]/metadata directory and then in modules/[module]/metadata.\nThe processing flow for the search form using the metadata subpaneldefs.php file is similar to that of EdiView and DetailView.\nDetailView and EditView Metadata\nMetadata files are PHP files that declare nested Array values that contain information about the view, such as buttons, hidden values, field layouts, and more. Following is a visual diagram representing how the Array values declared in the Metadata file are nested:\nThe following diagram highlights the process of how the application determines which Metadata file is to be used when rendering a request for a view:\nThe \"Classic Mode\" on the right hand side of the diagram represents the SugarCRM pre-5.x rendering of a Detail/Editview. This section will focus on the MVC/Metadata mode.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/Metadata/index.html"} {"id": "02125e64959d-5", "text": "When the view is first requested, the preDisplay method will attempt to find the correct Metadata file to use. Typically, the Metadata file will exist in the [root level]/modules/[module]/metadata directory, but in the event of edits to a layout through the Studio interface, a new Metadata file will be created and placed in the [root level]/custom/modules/[module]/metadata directory. This is done so that changes to layouts may be restored to their original state through Studio, and also to allow changes made to layouts to be upgrade-safe when new patches and upgrades are applied to the application. The metafiles.php file that may be loaded allows for the loading of Metadata files with alternate naming conventions or locations. An example of the metafiles.php contents can be found for the Accounts module (though it is not used by default in the application).\n$metafiles['Accounts'] = array(\n 'detailviewdefs' => 'modules/Accounts/metadata/detailviewdefs.php',\n 'editviewdefs' => 'modules/Accounts/metadata/editviewdefs.php',\n 'ListViewdefs' => 'modules/Accounts/metadata/ListViewdefs.php',\n 'searchdefs' => 'modules/Accounts/metadata/searchdefs.php',\n 'popupdefs' => 'modules/Accounts/metadata/popupdefs.php',\n 'searchfields' => 'modules/Accounts/metadata/SearchFields.php',\n);\nAfter the Metadata file is loaded, the preDisplay method also creates an EditView object and checks if a Smarty template file needs to be built for the given Metadata file. The EditView object does the bulk of the processing for a given Metadata file (creating the template, setting values, setting field level ACL controls if applicable, etc.). Please see the EditView process diagram for more detailed information about these steps.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/Metadata/index.html"} {"id": "02125e64959d-6", "text": "After the preDisplay method is called in the view code, the display method is called, resulting in a call to the EditView object's process method, as well as the EditView object's display method.\nThe EditView class is responsible for the bulk of the Metadata file processing and creation of the resulting display. The EditView class also checks to see if the resulting Smarty template is already created. It also applies the field level ACL controls for Sugar Sell, Serve, Ultimate, Enterprise, Corporate, and Professional.\nThe classes responsible for displaying the Detail View and SearchForm also extend and use the EditView class. The ViewEdit, ViewDetail and ViewSidequickcreate classes use the EditView class to process and display their contents. Even the file that renders the quick create form display (SubpanelQuickCreate.php) uses the EditView class. DetailView (in DetailView2.php) and SearchForm (in SearchForm2.php) extend the EditView class while SubpanelQuickCreate.php uses an instance of the EditView class. The following diagram highlights these relationships.\nThe following diagram highlights the EditView class's main responsibilities and their relationships with other classes in the system. We will use the example of a DetailView request although the sequence will be similar for other views that use the EditView class.\nOne thing to note is the EditView class's interaction with the TemplateHandler class. The TemplateHandler class is responsible for generating a Smarty template in the cache/modules/ directory. For example, for the Accounts module, the TemplateHandler will create the Smarty file, cache/modules/Accounts/DetailView.tpl, based on the Metadata file definition and other supplementary information from the EditView class. The TemplateHandler class actually uses Smarty itself to generate the resulting template that is placed in the aforementioned cache directory.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/Metadata/index.html"} {"id": "02125e64959d-7", "text": "Some of the modules that are available in the SugarCRM application also extend the ViewDetail class. One example of this is the DetailView for the Projects module. As mentioned in the MVC section, it is possible to extend the view classes by placing a file in the modules//views directory. In this case, a view.detail.php file exists in the modules/Projects/views folder. This may serve as a useful example in studying how to extend a view and apply additional field/layout settings not provided by the EditView class.\nThe following diagram shows the files involved with the DetailView example in more detail:\nA high level processing summary of the components for DetailViews follows:\nThe MVC framework receives a request to process the DetaiView.php (A) action for a module. For example, a record is selected from the list view shown on the browser with URL:\nindex.php?action=DetailView&module=Opportunities&record=46af9843-ccdf-f489-8833\nAt this point the new MVC framework checks to see if there is a DetailView.php (A2) file in the modules/Opportunity directory that will override the default DetailView.php implementation. The presence of a DetailView.php file will trigger the \"classic\" MVC view. If there is no DetailView.php (A2) file in the directory, the MVC will also check if you have defined a custom view to handle the DetailView rendering in MVC (that is, checks if there is a file modules/Opportunity/views/view.detail.php). See the documentation for the MVC architecture for more information. Finally, if neither the DetailView.php (A2) nor the view.detail.php exists, then the MVC will invoke include/DetailView/DetailView.php (A).\nThe MVC framework (see views.detail.php in include/MVC/View/views folder) creates an instance of the generic DetailView (A)\n// Call DetailView2 constructor", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/Metadata/index.html"} {"id": "02125e64959d-8", "text": "// Call DetailView2 constructor\n$dv = new DetailView2();\n// Assign by reference the Sugar_Smarty object created from MVC\n// We have to explicitly assign by reference to back support PHP 4.x\n$dv->ss =& $this->ss;\n// Call the setup function\n$dv->setup($this->module, $this->bean, $metadataFile, 'include/DetailView/DetailView.tpl');\n// Process this view\n$dv->process();\n// Return contents to the buffer\necho $dv->display();\nWhen the setup method is invoked, a TemplateHandler instance (D) is created. A check is performed to determine which detailviewdefs.php metadata file to used in creating the resulting DetailView. The first check is performed to see if a metadata file was passed in as a parameter. The second check is performed against the custom/studio/modules/[Module] directory to see if a metadata file exists. For the final option, the DetailView constructor will use the module's default detailviewdefs.php metadata file located under the modules/[Module]/metadata directory. If there is no detailviewdefs.php file in the modules/[Module]/metadata directory, but a DetailView.html exists, then a \"best guess\" version is created using the metadata parser file in include/SugarFields/Parsers/DetailViewMetaParser.php (not shown in diagram).\nThe TemplateHandler also handles creating the quick search (Ajax code to do look ahead typing) as well as generating the JavaScript validation rules for the module. Both the quick search and JavaScript code should remain static based on the definitions of the current definition of the metadata file. When fields are added or removed from the file through Studio, this template and the resulting updated quick search and JavaScript code will be rebuilt.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/Metadata/index.html"} {"id": "02125e64959d-9", "text": "It should be noted that the generic DetailView (A) defaults to using the generic DetailView.tpl smarty template file (F). This may also be overridden through the constructor parameters. The generic DetailView (A) constructor also retrieves the record according to the record id and populates the $focus bean variable.\nThe process() method is invoked on the generic DetailView.php instance:\nfunction process()\n{\n //Format fields first\n if($this->formatFields) \n {\n $this->focus->format_all_fields();\n }\n parent::process();\n}\nThis, in turn, calls the EditView->process() method since DetailView extends from EditView. The EditView->process() method will eventually call the EditView->render() method to calculate the width spacing for the DetailView labels and values. The number of columns and the percentage of width to allocate to each column may be defined in the metadata file. The actual values are rounded as a total percentage of 100%. For example, given the templateMeta section's maxColumns and widths values:\n'templateMeta' => array(\n 'maxColumns' => '2',\n 'widths' => array(\n array(\n 'label' => '10', \n 'field' => '30'\n ),\n array(\n 'label' => '10', \n 'field' => '30'\n )\n ),\n),\nWe can see that the labels and fields are mapped as a 1-to-3 ratio. The sum of the widths only equals a total of 80 (10 + 30 x 2) so the actual resulting values written to the Smarty template will be at a percentage ratio of 12.5-to-37.5. The resulting fields defined in the metadata file will be rendered as a table with the column widths as defined:", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/Metadata/index.html"} {"id": "02125e64959d-10", "text": "The actual metadata layout will allow for variable column lengths throughout the displayed table. For example, the metadata portion defined as:\n'panels' => array(\n 'default' => array(\n array(\n 'name',\n array(\n 'name' => 'amount',\n 'label' => '{$MOD.LBL_AMOUNT} ({$CURRENCY})',\n ),\n ),\n array(\n 'account_name',\n ),\n array(\n '',\n 'opportunity_type',\n )\n )\n)\nThis specifies a default panel under the panels section with three rows. The first row has two fields (name and amount). The amount field has some special formatting using the label override option. The second row contains the account_name field and the third row contains the opportunity_type column.\nNext, the process() method populates the $fieldDefs array variable with the vardefs.php file (G) definition and the $focus bean's value. This is done by calling the toArray () method on the $focus bean instance and combining these values with the field definition specified in the vardefs.php file (G).\nThe display() method is then invoked on the generic DetailView instance for the final step. When the display() method is invoked, variables to the DetailView.tpl Smarty template are assigned and the module's HTML code is sent to the output buffer.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/Metadata/index.html"} {"id": "02125e64959d-11", "text": "Before HTML code is sent back, the TemplateHandler (D) first performs a check to see if an existing DetailView template already exists in the cache respository (H). In this case, it will look for file cache/modules/Opportunity/DetailView.tpl. The operation of creating the Smarty template is expensive so this operation ensures that the work will not have to be redone. As a side note, edits made to the DetailView or EditView through the Studio application will clear the cache file and force the template to be rewritten so that the new changes are reflected.\nIf the cache file does not exist, the TemplateHandler (D) will create the template file and store it in the cache directory. When the fetch() method is invoked on the Sugar_Smarty class (E) to create the template, the DetailView.tpl file is parsed.\nTopicsExamplesLegacy MVC metadata examples.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/Metadata/index.html"} {"id": "eeb75bb5de8c-0", "text": "Examples\nLegacy MVC metadata examples.\nTopicsHiding the Quotes Module PDF ButtonsHow to hide the PDF buttons on a Quote.Manipulating Buttons on Legacy MVC LayoutsHow to add custom buttons to the EditView and DetailView layouts.Manipulating Layouts ProgrammaticallyHow to manipulate and merge layouts programmatically.Modifying Layouts to Display Additional ColumnsHow to add additional columns to layouts.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/Metadata/Examples/index.html"} {"id": "9b014ffdc085-0", "text": "Manipulating Buttons on Legacy MVC Layouts\nOverview\nHow to add custom buttons to the EditView and DetailView layouts.\nNote: This customization is only applicable for modules in backward compatibility mode.\nMetadata\nBefore adding buttons to your layouts, you will need to understand how the metadata framework is used. Detailed information on the metadata framework can be found in the Legacy Metadata section.\nCustom Layouts\nBefore you can add a button to your layout, you will first need to make sure you have a custom layout present. The stock layouts are located in ./modules//metadata/ and must be recreated in ./custom/modules//metadata/.\nThere are two ways to recreate a layout in the custom directory if it does not already exist. The first is to navigate to:\nStudio > {Module} > Layouts > {View}\nOnce there, you can click the \"Save & Deploy\" button. This will create the layoutdef for you. Alternatively, you can also manually copy the layoutdef from the stock folder to the custom folder.\nEditing Layouts\nWhen editing layouts you have three options in having your changes reflected in the UI.\nDeveloper Mode\nYou can turn on Developer Mode:\nAdmin > System Settings\nDeveloper Mode will remove the caching of the metadata framework. This will cause your changes to be reflected when the page is refreshed. Make sure this setting is deactivated when you are finished with your customization.\nQuick Repair and Rebuild\nYou can run a Quick Repair and Rebuild:\nAdmin > Repair > Quick Repair and Rebuild\nDoing this will rebuild the cache for the metadata.\nSaving & Deploying the Layout in Studio\nYou may also choose to load the layout in studio and then save & deploy it:\nAdmin > Studio > {Module} > Layouts > {View}", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/Metadata/Examples/Manipulating_Buttons_on_Layouts/index.html"} {"id": "9b014ffdc085-1", "text": "Admin > Studio > {Module} > Layouts > {View}\nThis process can be a bit confusing, however, once a layout is changed, you can then choose to load the layout in studio and then click \"Save & Deploy\" . This will rebuild the cache for that specific layout. Please note that any time you change the layout, you will have to reload the Studio layout view before deploying in order for this to work correctly.\nAdding Custom Buttons\nWhen adding buttons, there are several things to consider when determining how the button should be rendered. The following sections will outline these scenarios when working with the accounts editviewdefs located in ./custom/modules/Accounts/metadata/editviewdefs.php.\nJavaScript Actions\nIf you are adding a button solely to execute JavaScript (no form submissions), you can do so by adding the button HTML to:\n$viewdefs['']['']['templateMeta']['form']['buttons']\nExample\n\n array (\n 'templateMeta' =>\n array (\n 'form' =>\n array (\n 'buttons' =>\n array (\n 0 => 'EDIT',\n 1 => 'DUPLICATE',\n 2 => 'DELETE',\n 3 => 'FIND_DUPLICATES',\n 4 => 'CONNECTOR',\n 5 =>\n array (\n 'customCode' => '',\n ),\n ),\n ),\nSubmitting the Stock View Form", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/Metadata/Examples/Manipulating_Buttons_on_Layouts/index.html"} {"id": "9b014ffdc085-2", "text": "),\n ),\n ),\nSubmitting the Stock View Form\nIf you intend to submit the stock layout form ('formDetailView' or 'formEditView') to a new action, you can do so by adding a the button HTML with an onclick event as shown below to:\n$viewdefs['']['']['templateMeta']['form']['buttons']\nExample\n\n array (\n 'templateMeta' =>\n array (\n 'form' =>\n array (\n 'hidden' =>\n array (\n 0 => '',\n ),\n 'buttons' =>\n array (\n 0 => 'EDIT',\n 1 => 'DUPLICATE',\n 2 => 'DELETE',\n 3 => 'FIND_DUPLICATES',\n 4 => 'CONNECTOR',\n 5 =>\n array (\n 'customCode' => '',\n ),\n ),\n ),\nYou should note in this example that there is also a 'hidden' index. This is where you should add any custom hidden inputs:\n $viewdefs[''][\n ''][\n 'templateMeta'][\n 'form'][\n 'hidden']\nSubmitting Custom Forms", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/Metadata/Examples/Manipulating_Buttons_on_Layouts/index.html"} {"id": "9b014ffdc085-3", "text": "'templateMeta'][\n 'form'][\n 'hidden']\nSubmitting Custom Forms\nIf you intend to submit a custom form, you will first need to set 'closeFormBeforeCustomButtons' to true. This will close out the current views form and allow you to create your own.\n$viewdefs['']['']['templateMeta']['form']['closeFormBeforeCustomButtons']\nNext, you will add the form and button HTML as shown below to:\n$viewdefs['']['']['templateMeta']['form']['buttons']\nExample\n\n array (\n 'templateMeta' =>\n array (\n 'form' =>\n array (\n 'closeFormBeforeCustomButtons' => true,\n 'buttons' =>\n array (\n 0 => 'EDIT',\n 1 => 'DUPLICATE',\n 2 => 'DELETE',\n 3 => 'FIND_DUPLICATES',\n 4 => 'CONNECTOR',\n 5 =>\n array (\n 'customCode' => '
',\n ),\n ),\n ),\nRemoving Buttons\nTo remove a button from the detail view will require modifying the ./modules//metadata/detailviewdefs.php.\nThe code is originally defined as:\n$viewdefs[$module_name] = array (\n 'DetailView' => array (\n 'templateMeta' => array (", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/Metadata/Examples/Manipulating_Buttons_on_Layouts/index.html"} {"id": "9b014ffdc085-4", "text": "'DetailView' => array (\n 'templateMeta' => array (\n 'form' => array (\n 'buttons' => array (\n 'EDIT',\n 'DUPLICATE',\n 'DELETE',\n 'FIND_DUPLICATES'\n ),\n ),\nTo remove one or more buttons, simply remove the 'buttons' attribute(s) that you do not want on the view.\n$viewdefs[$module_name] = array (\n 'DetailView' => array (\n 'templateMeta' => array (\n 'form' => array (\n 'buttons' => array (\n 'DELETE',\n ),\n ),\n\u00c2\u00a0\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/Metadata/Examples/Manipulating_Buttons_on_Layouts/index.html"} {"id": "7878859e520f-0", "text": "Modifying Layouts to Display Additional Columns\nOverview\nHow to add additional columns to layouts.\nBy default, the editview, detailview, and quickcreate layouts for each module display two columns of fields. The number of columns to display can be customized on a per-module basis with the following steps.\nNote: This customization is only applicable for modules in backward compatibility mode.\nResolution\nSugarCloud\nFirst, you will want to ensure your layouts are deployed in the custom directory. If you have not previously customized your layouts via Studio, go to Admin > Studio > {Module Name} > Layouts. From there, select each layout you wish to add additional columns to and click 'Save & Deploy'. This action will create a corresponding layout file under the ./custom/modules/{Module Name}/metadata/ directory. The files will be named editviewdefs.php, detailviewdefs.php, and quickcreatedefs.php depending on the layouts deployed.\nTo access your custom files, go to Admin > Diagnostic Tool, uncheck all the boxes except for \"SugarCRM Custom directory\" and then click \"Execute Diagnostic\". This will generate an archive of your instance's custom directory to download, and you will find the layout files in the above path. Open the custom layout file, locate the 'maxColumns' value, and change it to the number of columns you would like to have on screen:\n'maxColumns' => '3',\nOnce that is updated, locate the 'widths' array to define the spacing for your new column(s). You should have a label and field entry for each column in your layout:\n'widths' => array (\n 0 => array (\n 'label' => '10',\n 'field' => '30',\n ),\n 1 => array (\n 'label' => '10',\n 'field' => '30',\n ),\n 2 => array (", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/Metadata/Examples/Modifying_Layouts_to_Display_Additional_Columns/index.html"} {"id": "7878859e520f-1", "text": "'field' => '30',\n ),\n 2 => array (\n 'label' => '10',\n 'field' => '30',\n ),\n),\nAfter this is completed, you will need to create a module-loadable package to install the changes on your SugarCloud instance. More information on creating this package can be found in\u00c2\u00a0Creating an Installable Package that Creates New Fields. To upload and install the package, go to Admin > Module Loader.\nNote: Sugar Sell Essentials customers do not have the ability to upload custom file packages to Sugar using Module Loader.\nOnce the installation completes, you can navigate to Studio and add fields to your new column in the layout. For any rows that already contain two fields, the second field will automatically span the second and third column. Simply click the minus (-) icon to contract the field to one column and expose the new column space:\nAfter you have added the desired fields in Studio, click 'Save & Deploy', and you are ready to go!\nOn-Site\nFirst, you will want to ensure your layouts are deployed in the custom directory. If you have not previously customized your layouts via Studio, go to Admin > Studio > {Module Name} > Layouts. From there, select each layout you wish to add additional columns to and click 'Save & Deploy'. This action will create a corresponding layout file under the ./custom/modules/{Module Name}/metadata/ directory. The files will be named editviewdefs.php, detailviewdefs.php, and quickcreatedefs.php depending on the layouts deployed.\nNext, open the custom layout file, locate the 'maxColumns' value, and change it to the number of columns you would like to have on screen:\n'maxColumns' => '3',", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/Metadata/Examples/Modifying_Layouts_to_Display_Additional_Columns/index.html"} {"id": "7878859e520f-2", "text": "'maxColumns' => '3',\nOnce that is updated, locate the 'widths' array to define the spacing for your new column(s). You should have a label and field entry for each column in your layout:\n'widths' => array (\n 0 => array (\n 'label' => '10',\n 'field' => '30',\n ),\n 1 => array (\n 'label' => '10',\n 'field' => '30',\n ),\n 2 => array (\n 'label' => '10',\n 'field' => '30',\n ),\n),\nOnce this is completed, you can navigate to Studio and add fields to your new column in the layout. For any rows that already contain two fields, the second field will automatically span the second and third column. Simply click the minus (-) icon to contract the field to one column and expose the new column space:\nAfter you have added the desired fields in Studio, click 'Save & Deploy', and you are ready to go!\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/Metadata/Examples/Modifying_Layouts_to_Display_Additional_Columns/index.html"} {"id": "121ae268bdfb-0", "text": "Manipulating Layouts Programmatically\nOverview\nHow to manipulate and merge layouts programmatically.\nNote: This customization is only applicable for modules in backward compatibility mode.\nThe ParserFactory\nThe ParserFactory can be used to manipulate layouts such as editviewdefs or detailviewdefs. This is a handy when creating custom plugins and needing to merge changes into an existing layout. The following example will demonstrate how to add a button to the detail view:\n''\n);\n//Add button into the parsed layout\narray_push($parser->_viewdefs['templateMeta']['form']['buttons'], $button);\n//Save the layout\n$parser->handleSave(false);\n\u00c2\u00a0\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/Metadata/Examples/Manipulating_Layouts_Programmatically/index.html"} {"id": "792544b4014b-0", "text": "Hiding the Quotes Module PDF Buttons\nOverview\nHow to hide the PDF buttons on a Quote.\nThe PDF buttons on quotes are rendered differently than the standard buttons on most layouts. Since these buttons can't be removed directly from the DetailView in the detailviewdefs, the best approach is using jQuery to hide the buttons.\nNote: This customization is only applicable for the quotes module as it is in backward compatibility mode.\nHidding the PDF Buttons\nThis approach involves modifying the detailviewdefs.php in the custom/modules/Quotes/metadata directory to include a custom JavaScript file. If a custom detailviewdefs.php file doesn't exist, you will need to create it through Studio or by manually\n coping the detailviewdefs.php from the Quotes stock module metadata directory.\nFirst, we will create a javascript file, say removePdfBtns.js, in the ./custom/modules/Quotes directory. This javascript file will contain the jQuery statements to hide the Quotes \"Download PDF\" and \"Email PDF\" buttons on the DetailView of the Quote.\n \n./custom/modules/Quotes/removePdfBtns.js\nSUGAR.util.doWhen(\"typeof $ != 'undefined'\", function(){\n YAHOO.util.Event.onDOMReady(function(){\n $(\"#pdfview_button\").hide();\n $(\"#pdfemail_button\").hide();\n });\n});\nNext, we will modify the custom detailviewdefs.php file to contain the 'includes' array element in the templateMeta array as follows:\n./custom/modules/Quotes/metadata/detailviewdefs.php\n$viewdefs['Quotes'] = array (\n 'DetailView' =>\n array (\n 'templateMeta' =>\n array (\n 'form' =>\n array (\n 'closeFormBeforeCustomButtons' => true,\n 'buttons' =>\n array (\n 0 => 'EDIT',\n 1 => 'SHARE',", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/Metadata/Examples/Hidding_the_Quotes_Module_PDF_Buttons/index.html"} {"id": "792544b4014b-1", "text": "array (\n 0 => 'EDIT',\n 1 => 'SHARE',\n 2 => 'DUPLICATE',\n 3 => 'DELETE',\n 4 =>\n array (\n 'customCode' => '
\n \n \n id}\">\n \n user_name}\">\n \n \n \n \n \n \n \n
',", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/Metadata/Examples/Hidding_the_Quotes_Module_PDF_Buttons/index.html"} {"id": "792544b4014b-2", "text": "),\n ),\n 'footerTpl' => 'modules/Quotes/tpls/DetailViewFooter.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 'includes' =>\n array (\n 0 =>\n array (\n 'file' => 'custom/modules/Quotes/removePdfBtns.js',\n ),\n ),\n 'useTabs' => false,\n 'tabDefs' =>\n array (\n 'LBL_QUOTE_INFORMATION' =>\n array (\n 'newTab' => false,\n 'panelDefault' => 'expanded',\n ),\n 'LBL_PANEL_ASSIGNMENT' =>\n array (\n 'newTab' => false,\n 'panelDefault' => 'expanded',\n ),\n ),\n ),\n ...\nFinally, navigate to: Admin > Repair > Quick Repair and Rebuild\nThe buttons will then be removed from the DetailView layouts.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Legacy_MVC/Metadata/Examples/Hidding_the_Quotes_Module_PDF_Buttons/index.html"} {"id": "d50cf2fe841d-0", "text": "Events\nOverview\nThe Backbone events module is a lightweight pub-sub pattern that gets mixed into each Backbone class (Model, View, Collection, Router, etc.). This means that you can listen to or dispatch custom named events from any Backbone object.\nBackbone events should not be confused with a\u00c2\u00a0jQuery events, which are used for working with DOM events in an API. Backbone supports an events hash on views that can be used to attach event handlers to DOM using jQuery. These are not Backbone events. This can be confusing because, among other similarities, both interfaces include an on() function\u00c2\u00a0and allow you to attach an event handler. The targets for jQuery events are DOM elements. The target for Backbone events are Backbone objects.\nSidecar classes extend these base Backbone classes. So each Sidecar object (Layouts, Views, Fields, Beans, Contexts, etc.) supports Backbone\u00c2\u00a0events.\nExisting Backbone Event Catalog\nThe current catalog of Backbone events\u00c2\u00a0is supported and triggered by the Sugar application. For example, we can listen to built-in Backbone router events, such as the route event, that is triggered by Sidecar. Try running the following JavaScript code from your browser's console:\nSUGAR.App.router.on('route', function(arguments) {\n console.log(arguments);\n});\nAs you click through the Sugar application, each time the router is called, you will see routing events appear in your browser console.\nSidecar Events\nGlobal Application Events\nApplication events are all triggered on the\u00c2\u00a0app.events (SUGAR.App.events) object. Below is a list of application events with a description of when you can expect them to fire. However, please note that these events can be triggered in more than one place\u00c2\u00a0and some events, such as app:sync:error, can trigger events such as\u00c2\u00a0app:logout.\nName\nDescription\napp:init", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Events/index.html"} {"id": "d50cf2fe841d-1", "text": "Name\nDescription\napp:init\nTriggered after the Sidecar application initializesNote: Initialization registers events, builds out Sidecar API objects, loads public metadata and config, and initializes modules.\napp:start\nTriggered after the Sidecar application starts\napp:sync\nTriggered when metadata is being synced with the user interface,\u00c2\u00a0for example, after login has occurred\napp:sync:complete\nTriggered after metadata has completely synced\napp:sync:error\nTriggered when metadata sync fails\napp:sync:public:error\nTriggered when public metadata sync fails during initialization\napp:view:change\nTriggered when a new view is loaded\napp:locale:change\nTriggered when the locale changes\nlang:direction:change\nTriggered when the locale changes and the direction of the language is different\napp:login\nTriggered when the \"Login\" route is called\napp:login:success\nTriggered after a successful login\napp:logout\nTriggered when the application is logging out\napp:logout:success\nTriggered after a successful logout\nBean Events\nThe following table lists bean object events.\nName\nDescription\nacl:change\nTriggered when the ACLs change for that module\nacl:change:\nTriggered when the ACLs change for a particular field in that module\nvalidation:success\nTriggered when bean validation is valid\nvalidation:complete\nTriggered when bean validation completes\nerror:validation\nTriggered when bean validation has an error\nerror:validation:\nTriggered when a particular field has a bean validation error\nattributes:revert\nTriggered when the bean reverts to the previous attributes\nContext Events", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Events/index.html"} {"id": "d50cf2fe841d-2", "text": "attributes:revert\nTriggered when the bean reverts to the previous attributes\nContext Events\nThe context object is used to facilitate communication between different Sidecar components on the page using events. For example, the button:save_button:click event triggers whenever a user clicks the Save button. The record view uses this event to run Save routines without being tightly coupled to a particular Save button. A list of these contextual events is not plausible because the user interface is continuously changing between versions, and there are many more possibilities based on the views and layouts in each version.\nUtilizing Events\nApplication events can be bound to in any custom JavaScript controller or any JavaScript file loaded into Sugar and included on the page (such as via JSGroupings framework). An example below shows how one could add custom JavaScript code to trigger after the application log out.\n./custom/include/javascript/myAppLogoutSuccessEvent.js\n(function(app){\n app.events.on('app:logout:success', function(data) {\n //Add Logic Here\n console.log(data);\n });\n})(SUGAR.App);\nWith the custom event JavaScript file written and in place, include it into the system using the JSGroupings extension.\n./custom/Extension/application/Ext/JSGroupings/myAppLogoutSuccessEvent.php\nforeach ($js_groupings as $key => $groupings) {\n foreach ($groupings as $file => $target) {\n \t//if the target grouping is found\n if ($target == 'include/javascript/sugar_grp7.min.js') {\n //append the custom JavaScript file\n $js_groupings[$key]['custom/include/javascript/myAppLogoutSuccessEvent.js'] = 'include/javascript/sugar_grp7.min.js';\n }\n break;\n }\n}", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Events/index.html"} {"id": "d50cf2fe841d-3", "text": "}\n break;\n }\n}\nOnce in place, navigate to Admin > Repair > Rebuild JS Grouping Files. After the JSGroupings are rebuilt, clear your browser cache and the custom JavaScript will now trigger after a successful logout.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Events/index.html"} {"id": "9bd7b857ec71-0", "text": "Alerts\nOverview\nThe alert view widget, located in ./clients/base/views/alert/, displays helpful information such as loading messages, notices, and confirmation messages to the user.\nMethods\napp.alert.show(id, options)\nThe app.alert.show(id, options) method displays an alert message to the user with the options provided.\nParameters\nName\nDescription\nid\nThe id of the alert message. Used for dismissing specific messages.\noptions.level\nThe alert level\noptions.title\nThe alert's title, which corresponds to the alert's level\noptions.messages\nThe message that the user sees Note: Process alerts do not display messages.\noptions.autoClose\nWhether or not to auto-close the alert popup\noptions.onClose\nCallback handler for closing confirmation alerts\noptions.onCancel\nCallback handler for canceling confirmation alerts\noptions.onLinkClick\nCallback handler for click actions on a link inside of the alert\nDefault Alert Values\nAlert Level\nAlert Appearance\nAlert Title\ninfo\nblue\n\"Notice\"\nsuccess\ngreen\n\"Success\"\nwarning\nyellow\n\"Warning!\"\nerror\nred\n\"Error\"\nprocess\nloading message\n\"Loading...\"\nconfirmation\nconfirmation dialog\n\"Warning\"\nAlert Examples\nStandard Alert\napp.alert.show('message-id', {\n level: 'success',\n messages: 'Task completed!',\n autoClose: true\n});\nConfirmation Alert\napp.alert.show('message-id', {\n level: 'confirmation',\n messages: 'Confirm?',\n autoClose: false,\n onConfirm: function(){\n alert(\"Confirmed!\");\n },\n onCancel: function(){\n alert(\"Cancelled!\");\n }\n});\nProcess Alert\napp.alert.show('message-id', {\n level: 'process',\n title: 'In Process...' //change title to modify display from 'Loading...'\n});\napp.alert.dismiss(id)", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Alerts/index.html"} {"id": "9bd7b857ec71-1", "text": "});\napp.alert.dismiss(id)\nThe app.alert.dismiss(id) method dismisses an alert message from view based on the message id.\nParameters\nName\nDescription\nid\nThe id of the alert message to dismiss.\nExample\napp.alert.dismiss('message-id');\napp.alert.dismissAll\nThe app.alert.dismissAll dismisses all alert messages from view.\nExample\napp.alert.dismissAll();\nTesting in Console\nTo test alerts, you can trigger them in your browser's developer tools by using the global App variable as shown below:\nApp.alert.show('message-id', {\n level: 'success',\n messages: 'Successful!',\n autoClose: false\n});\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Alerts/index.html"} {"id": "07a7367e4dd7-0", "text": "Administration Links\nOverview\nAdministration links are the shortcut URLs found\u00c2\u00a0on\u00c2\u00a0the Administration\u00c2\u00a0page\u00c2\u00a0in the Sugar application. Developers can create additional administration links\u00c2\u00a0using the extension framework.\nThe global links extension directory is located at ./custom/Extension/modules/Administration/Ext/Administration/.\u00c2\u00a0After a Quick Repair and Rebuild, the PHP files in this directory\u00c2\u00a0are\u00c2\u00a0compiled into ./custom/modules/Administration/Ext/Administration/administration.ext.php. Additional information on this can be found in the extensions Administration section of the Extension Framework documentation. The current links defined in the administration section can be found in ./modules/Administration/metadata/adminpaneldefs.php.\nExample\nThe following example will create a new panel on the Admin page:\n./custom/Extension/modules/Administration/Ext/Administration/.php\n'] = array(\n //Icon name. Available icons are located in ./themes/default/images\n 'Administration',\n \n //Link name label \n 'LBL_LINK_NAME',\n \n //Link description label\n 'LBL_LINK_DESCRIPTION',\n \n //Link URL - For Sidecar modules\n 'javascript:void(parent.SUGAR.App.router.navigate(\"/\", {trigger: true}));',\n \n //Alternatively, if you are linking to BWC modules\n //'./index.php?module=&action=',\n );\n $admin_group_header[] = array(\n //Section header label\n 'LBL_SECTION_HEADER',\n \n //$other_text parameter for get_form_header()\n '',\n \n //$show_help parameter for get_form_header()\n false,\n \n //Section links\n $admin_option_defs,", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Administration_Links/index.html"} {"id": "07a7367e4dd7-1", "text": "//Section links\n $admin_option_defs, \n \n //Section description label\n 'LBL_SECTION_DESCRIPTION'\n );\nTo define labels for administration links in the new panel:\n./custom/Extension/modules/Administration/Ext/Language/en_us..php\n Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and the panel will appear on the Admin page.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Administration_Links/index.html"} {"id": "d9df790905a1-0", "text": "Dashlets\nOverview\nDashlets are special view-component plugins that render data from a context and make use of the Dashlet plugin. They are typically made up of a controller JavaScript file (.js) and at least one Handlebars template (.hbs).\nHierarchy Diagram\nSugar loads the dashlet view components in the following manner:\nNote: The Sugar application's client type is \"base\". For more information on the various client types, please refer to\u00c2\u00a0the User Interface page.\nDashlet Views\nThe are three views when working with dashlets: Preview, Dashlet View, and Configuration View. The following sections discuss the differences between views.\nPreview\nThe preview view is used when selecting dashlets to add to your homepage. Preview variables in the metadata will be assigned to the custom model variables.\n'preview' => array(\n 'key1' => 'value1',\n),\nThe values in the preview metadata can be retrieved using:\nthis.model.get(\"key1\");\nDashlet View\nThe dashlet view will render the content for the dashlet. It will also contain the settings for editing, removing, and refreshing the dashlet.\nConfiguration View\nThe configuration view is displayed when a user clicks the 'edit' option on the dashlet frame's drop-down menu. Config variables in the metadata will be assigned to the custom model variables\n'config' => array(\n //key value pairs of attributes\n 'key1' => 'value1',\n),\nThe values in the config metadata can be retrieved using:\nthis.model.get(\"key1\");\nDashlet Example\nThe RSS\u00c2\u00a0feed\u00c2\u00a0dashlet, located in ./clients/base/views/rssfeed/, handles the display of RSS\u00c2\u00a0feeds to the user. The sections below outline the various files that render this dashlet.\nMetadata\nThe Dashlet view contains the 'dashlets' metadata:\nParameters\nType\nRequired", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Dashlets/index.html"} {"id": "d9df790905a1-1", "text": "The Dashlet view contains the 'dashlets' metadata:\nParameters\nType\nRequired\nDescription\nlabel\nString\nyes\nThe name of the dashlet\ndescription\nString\nno\nA description of the dashlet\nconfig\nObject\nyes\nPre-populated variables in the configuration viewNote:\u00c2\u00a0Config variables in the metadata are\u00c2\u00a0assigned to the custom model variables.\npreview\nObject\nyes\u00c2\u00a0\nPre-populated variables in the preview\nfilter\nObject\nno\nFilter for display\nThe\u00c2\u00a0RSS feed\u00c2\u00a0dashlets metadata is located in:\n./clients/base/views/rssfeed/rssfeed.php\n array(\n array(\n 'label' => 'LBL_RSS_FEED_DASHLET',\n 'description' => 'LBL_RSS_FEED_DASHLET_DESCRIPTION',\n 'config' => array(\n 'limit' => 5,\n 'auto_refresh' => 0,\n ),\n 'preview' => array(\n 'limit' => 5,\n 'auto_refresh' => 0,\n 'feed_url' => 'http://blog.sugarcrm.com/feed/',\n ),\n ),\n ),\n 'panels' => array(\n array(\n 'name' => 'panel_body',", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Dashlets/index.html"} {"id": "d9df790905a1-2", "text": "array(\n 'name' => 'panel_body',\n 'columns' => 2,\n 'labelsOnTop' => true,\n 'placeholders' => true,\n 'fields' => array(\n array(\n 'name' => 'feed_url',\n 'label' => 'LBL_RSS_FEED_URL',\n 'type' => 'text',\n 'span' => 12,\n 'required' => true,\n ),\n array(\n 'name' => 'limit',\n 'label' => 'LBL_RSS_FEED_ENTRIES_COUNT',\n 'type' => 'enum',\n 'options' => 'tasks_limit_options',\n ),\n array(\n 'name' => 'auto_refresh',\n 'label' => 'LBL_DASHLET_REFRESH_LABEL',\n 'type' => 'enum',\n 'options' => 'sugar7_dashlet_reports_auto_refresh_options',\n ),\n ),\n ),\n ),\n);\nController\nThe rssfeed.js controller file, shown below, contains the JavaScript to render the news articles on the dashlet. The Dashlet view must include 'Dashlet' plugin and can override initDashlet to add additional custom process while it is initializing.\n./clients/base/views/rssfeed/rssfeed.js\n/*\n * Your installation or use of this SugarCRM file is subject to the applicable\n * terms available at\n * http://support.sugarcrm.com/Resources/Master_Subscription_Agreements/.\n * If you do not agree to all of the applicable terms or do not have the\n * authority to bind the entity as an authorized representative, then do not\n * install or use this SugarCRM file.\n *\n * Copyright (C) SugarCRM Inc. All rights reserved.\n */\n/**", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Dashlets/index.html"} {"id": "d9df790905a1-3", "text": "*\n * Copyright (C) SugarCRM Inc. All rights reserved.\n */\n/**\n * RSS Feed dashlet consumes an RSS Feed URL and displays it's content as a list\n * of entries.\n * \n * The following items are configurable.\n *\n * - {number} limit Limit imposed to the number of records pulled.\n * - {number} refresh How often (minutes) should refresh the data collection.\n *\n * @class View.Views.Base.RssfeedView\n * @alias SUGAR.App.view.views.BaseRssfeedView\n * @extends View.View\n */\n({\n plugins: ['Dashlet'],\n /**\n * Default options used when none are supplied through metadata.\n *\n * Supported options:\n * - timer: How often (minutes) should refresh the data collection.\n * - limit: Limit imposed to the number of records pulled.\n *\n * @property {Object}\n * @protected\n */\n _defaultOptions: {\n limit: 5,\n auto_refresh: 0\n },\n /**\n * @inheritdoc\n */\n initialize: function(options) {\n options.meta = options.meta || {};\n this._super('initialize', [options]);\n this.loadData(options.meta);\n },\n /**\n * Init dashlet settings\n */\n initDashlet: function() {\n // We only need to handle this if we are NOT in the configure screen\n if (!this.meta.config) {\n var options = {};\n var self = this;\n var refreshRate;\n // Get and set values for limits and refresh\n options.limit = this.settings.get('limit') || this._defaultOptions.limit;\n this.settings.set('limit', options.limit);", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Dashlets/index.html"} {"id": "d9df790905a1-4", "text": "this.settings.set('limit', options.limit);\n options.auto_refresh = this.settings.get('auto_refresh') || this._defaultOptions.auto_refresh;\n this.settings.set('auto_refresh', options.auto_refresh);\n // There is no default for this so there's no pointing in setting from it\n options.feed_url = this.settings.get('feed_url');\n // Set the refresh rate for setInterval so it can be checked ahead\n // of time. 60000 is 1000 miliseconds times 60 seconds in a minute.\n refreshRate = options.auto_refresh * 60000;\n // Only set up the interval handler if there is a refreshRate higher\n // than 0\n if (refreshRate > 0) {\n if (this.timerId) {\n clearInterval(this.timerId);\n }\n this.timerId = setInterval(_.bind(function() {\n if (self.context) {\n self.context.resetLoadFlag();\n self.loadData(options);\n }\n }, this), refreshRate);\n }\n }\n // Validation handling for individual fields on the config\n this.layout.before('dashletconfig:save', function() {\n // Fields on the metadata\n var fields = _.flatten(_.pluck(this.meta.panels, 'fields'));\n // Grab all non-valid fields from the model\n var notValid = _.filter(fields, function(field) {\n return field.required && !this.dashModel.get(field.name);\n }, this);\n // If there no invalid fields we are good to go\n if (notValid.length === 0) {\n return true;\n }\n // Otherwise handle notification of invalidation\n _.each(notValid, function(field) {\n var fieldOnView = _.find(this.fields, function(comp, cid) {", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Dashlets/index.html"} {"id": "d9df790905a1-5", "text": "var fieldOnView = _.find(this.fields, function(comp, cid) { \n return comp.name === field.name;\n });\n fieldOnView.model.trigger('error:validation:' + field.name, {required: true});\n }, this);\n // False return tells the drawer that it shouldn't close\n return false;\n }, this);\n },\n /**\n * Handles the response of the feed consumption request and sets data from \n * the result\n * \n * @param {Object} data Response from the rssfeed API call\n */\n handleFeed: function (data) {\n if (this.disposed) {\n return;\n }\n // Load up the template\n _.extend(this, data);\n this.render();\n },\n /**\n * Loads an RSS feed from the RSS Feed endpoint.\n * \n * @param {Object} options The metadata that drives this request\n */\n loadData: function(options) {\n if (options && options.feed_url) {\n var callbacks = {success: _.bind(this.handleFeed, this), error: _.bind(this.handleFeed, this)},\n limit = options.limit || this._defaultOptions.limit,\n params = {feed_url: options.feed_url, limit: limit},\n apiUrl = app.api.buildURL('rssfeed', 'read', '', params);\n app.api.call('read', apiUrl, {}, callbacks);\n }\n },\n /**\n * @inheritdoc\n *\n * New model related properties are injected into each model:\n *\n * - {Boolean} overdue True if record is prior to now.\n */\n _renderHtml: function() {\n if (this.meta.config) {", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Dashlets/index.html"} {"id": "d9df790905a1-6", "text": "_renderHtml: function() {\n if (this.meta.config) {\n this._super('_renderHtml');\n return;\n }\n this._super('_renderHtml');\n }\n})\nWorkflow\nWhen triggered, the following procedure will render the view area:\nRetrieving Data\nUse the following commands to retrieve the corresponding data:\nData Location\nElement\nCommand\nMain pane\nRecord View\nthis.model\nRecord View\nthis.context.parent.get(\"model\")\nList View\nthis.context.parent.get(\"collection\")\nMetadata\n\u00c2\u00a0\nthis.dashletConfig['metadata_key']\nModule vardefs\n\u00c2\u00a0\napp.metadata.getModule(\"ModuleName\")\nRemote data\nBean\nnew app.data.createBean(\"Module\")new app.data.createBeanCollection(\"Module\")\nRestAPI\u00c2\u00a0\napp.api.call(method, url, data, callbacks, options)\nAjax Call\u00c2\u00a0\n$.ajax()\nUser inputs\n\u00c2\u00a0\nthis.settings.get(\"custom_key\")\nHandlebar Template\nThe rssfeed.hbs template file defines the content of the view. This view is used for rendering the markup rendering in the dashlet content.\n./clients/base/views/rssfeed/rssfeed.hbs\n{{!--\n/*\n * Your installation or use of this SugarCRM file is subject to the applicable\n * terms available at\n * http://support.sugarcrm.com/Resources/Master_Subscription_Agreements/.\n * If you do not agree to all of the applicable terms or do not have the\n * authority to bind the entity as an authorized representative, then do not\n * install or use this SugarCRM file.\n *\n * Copyright (C) SugarCRM Inc. All rights reserved.\n */\n--}}\n{{#if feed}}\n
\n

", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Dashlets/index.html"} {"id": "d9df790905a1-7", "text": "
\n

\n {{#if feed.link}}{{/if}}\n {{feed.title}}\n {{#if feed.link}}{{/if}}\n

\n
    \n {{#each feed.entries}}\n
  • \n Dashlets\n {{#if author}} - {{str \"LBL_RSS_FEED_AUTHOR\"}} {{author}}{{/if}}\n
  • \n {{/each}}\n
\n
\n{{else}}\n
\n {{#if errorThrown}}\n {{str \"LBL_NO_DATA_AVAILABLE\"}}\n {{else}}\n {{loading 'LBL_ALERT_TITLE_LOADING'}}\n {{/if}}\n
\n{{/if}} \n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Dashlets/index.html"} {"id": "2ee769f6e3c0-0", "text": "Sidecar\nOverview\nSidecar is a platform that moves processing to the client side to render pages as single-page web apps. Sidecar contains a complete Model-View-Controller (MVC) framework based on the Backbone.js library.\nBy creating a single-page web app, server load drastically decreases while\u00c2\u00a0the client's performance increases because the application is sending pure JSON data in place of HTML. The JSON data, returned by the v10 API, defines the application's modules, records, and ACLs, allowing UI processing to happen on the client side and significantly reducing the amount of data to transfer.\u00c2\u00a0\n\u00c2\u00a0\nComposition\nSidecar contains\u00c2\u00a0the following parts, which are briefly explained in the sections below:\nBackbone.js\nComponents (Layouts,\u00c2\u00a0Views, and Fields)\nContext\nBackbone.js\nBackbone.js is a lightweight JavaScript framework based on MVP (model\u00e2\u0080\u0093view\u00e2\u0080\u0093presenter) application design. It allows developers to easily interact with a RESTful JSON API to fetch models and collections for use within their user interface.\nFor more information about Backbone.js, please refer to their documentation at\u00c2\u00a0Backbone.js.\nComponents\nEverything that is renderable on the page is a component. A layout is a component that serves as a canvas for one or more views and other layouts. All pages will have at least one master layout, and that master layout can contain multiple nested layouts.\nLayouts\nLayouts are components that render the overall page. They define the rows, columns, and fluid layouts of content that gets delivered to the end user.\nExample layouts include:\nRows\nColumns\nBootstrap fluid layouts\nDrawers and dropdowns\nFor more information about the various layouts, please refer to the Layouts page of this documentation.\nViews", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Sidecar/index.html"} {"id": "2ee769f6e3c0-1", "text": "Views\nViews are components that render data from a context and may or may not include field components. Example views include not only record and list views but also widgets such as:\nGraphs or other data visualizations\nExternal data views such as Twitter, LinkedIn, or other web service integrations\nThe global header\nFor more information about views, please refer to\u00c2\u00a0the Views page\u00c2\u00a0of this documentation.\nFields\nFields render widgets for individual values that have been pulled from the models and also handle formatting (or stripping the formatting of) field values. Like layouts and views, fields extend Backbone views.\u00c2\u00a0\nFor more information about the various layouts, please refer to\u00c2\u00a0the Fields page of this documentation.\nContext\nA Context is a container for the relevant data for a page, and it has three major attributes:\nModule : The name of the module this context is based on\nModel : The primary or selected model for this context\nCollection : The set of models currently loaded in this context\nContexts are used to retrieve related data and to paginate through lists of data.\n\u00c2\u00a0\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Sidecar/index.html"} {"id": "2bfef099996c-0", "text": "Routes\nOverview\nRoutes determine where users are directed\u00c2\u00a0based on patterns in the URL.\nRoutes\nRoutes, defined in ./include/javascript/sugar7.js, are URL\u00c2\u00a0patterns signified by a\u00c2\u00a0hashtag (\"#\") in the\u00c2\u00a0URL.\u00c2\u00a0An example module\u00c2\u00a0URL pattern for the Sugar application is\u00c2\u00a0http://{site url}/#.\u00c2\u00a0This route would\u00c2\u00a0direct a user to the list view for a given module. The following sections will outline routes and how they are defined.\nRoute Definitions\nThe router accepts route definitions in the following format:\nroutes = [\n {\n name: \"My First Route\",\n route: \"pattern/to/match\",\n callback: function()\n {\n //handling logic here.\n }\n },\n {\n name: \"My Second Route\",\n route: \"pattern/:variable\",\n callback: \"\"\n }\n]\nA route takes in three properties: the name of the route, the route pattern to match, and the callback to be called when the route is matched. If a default callback is desired, you can specify the callback name as a string.\nRoute Patterns\nRoute patterns determine where to direct the user. An example of routing is done when navigating to an account record. When doing this you may notice that your URL is:\nhttp://{site url}/#Accounts/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee\nA stock\u00c2\u00a0route's definition is defined in ./include/javascript/sugar7.js as:\n{\n name: \"record\",\n route: \":module/:id\"\n},\nVariables in the route pattern are\u00c2\u00a0prefixed with a colon such as\u00c2\u00a0:variable. The route pattern above contains two variables:\nmodule\nid\nCustom Routes", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Routes/index.html"} {"id": "2bfef099996c-1", "text": "module\nid\nCustom Routes\nAs of 7.8.x, you can add the routes during the initialization of the Router, so custom routes can be registered in the Sidecar router during both router:init and\u00c2\u00a0router:start\u00c2\u00a0events. It\u00c2\u00a0is recommended to register them in the Initialization event\u00c2\u00a0before any routing has occurred. There are two methods in the Sidecar Router, which allow for adding custom routes:\nroute()\nArguments\nName\nRequired\nType\nDescription\nroute\ntrue\nstring\nThe Route pattern to be matched by the URL Fragment\nname\ntrue\nstring\u00c2\u00a0\nThe unique name of the Route\ncallback\ntrue\nfunction\u00c2\u00a0\nThe callback function for the Route\nExample\nThe following example registers a custom Route during the router:init event, using the route() method.\n./custom/javascript/customRoutes.js\n(function(app){\n app.events.on(\"router:init\", function(){\n //Register the route #test/123\n app.router.route(\"test/:id\", \"test123\", function() {\n console.log(arguments);\n app.controller.loadView({\n layout: \"custom_layout\",\n create: true\n });\n });\n })\n})(SUGAR.App);\naddRoutes()", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Routes/index.html"} {"id": "2bfef099996c-2", "text": "});\n });\n })\n})(SUGAR.App);\naddRoutes()\nWhen you need to add multiple routes, you can define the routes in an array and pass the entire array to the addRoutes() method on the Sidecar Router to ensure they are registered. Please note, the addRoutes() method utilizes the above route() method to register the routes with the Backbone Router. The Backbone router redirects\u00c2\u00a0after the first matching route. Due to this, the order in which the routes are listed in the array is important\u00c2\u00a0as it will determine which route will\u00c2\u00a0be used by the application. It is recommended that the most specific routes be listed first in the array so that they are recognized first, instead of those routes which may contain a variable.\nArguments\nName\nRequired\nType\nDescription\nroutes\ntrue\narray\nAn array of route definition as defined above.\nExample\nThe following example registers custom Route during the router:init event, using the addRoutes() method.\nThe\u00c2\u00a0route's JavaScript controller can exist anywhere you'd like. For our purposes, we created it in\u00c2\u00a0./custom/javascript/customRoutes.js. This file will contain your custom route definitions.\n./custom/javascript/customRoutes.js\n(function(app){\n app.events.on(\"router:init\", function(){\n var routes = [\n \t {\n route: 'test/doSomething',\n name: 'testDoSomething',\n callback: function(){\n \t alert(\"Doing something...\");\n }\n },\n {\n route: 'test/:id',\n name: 'test123',\n callback: function(){\n \t console.log(arguments);\n app.controller.loadView({\n layout: \"custom_layout\",\n create: true\n });\n }\n }\n ];\n app.router.addRoutes(routes);\n })", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Routes/index.html"} {"id": "2bfef099996c-3", "text": "}\n }\n ];\n app.router.addRoutes(routes);\n })\n})(SUGAR.App);\nNext, create the JSGrouping extension. This file will allow Sugar to recognize that you've added custom routes.\u00c2\u00a0\n./custom/Extension/application/Ext/JSGroupings/myCustomRoutes.php\n $groupings) {\n\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 $target = current(array_values($groupings));\n\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 //if the target grouping is found\n\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 if ($target == 'include/javascript/sugar_grp7.min.js') {\n\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 //append the custom JavaScript file\n\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 $js_groupings[$key]['custom/javascript/customRoutes.js'] = 'include/javascript/sugar_grp7.min.js';\n\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 }\n}\nOnce your files are in place, navigate to Admin > Repairs > Quick Repair & Rebuild. For additional information, please refer to the\u00c2\u00a0JSGroupings\u00c2\u00a0framework.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Routes/index.html"} {"id": "bedb57e1e5c8-0", "text": "Handlebars\nOverview\nThe Handlebars library, located in ./sidecar/lib/handlebars/, is a JavaScript library that lets Sugar create\u00c2\u00a0semantic templates. Handlebars help render content for layouts, views, and fields for Sidecar. Using Handlebars, you can make modifications to the display of content such as adding HTML or CSS.\u00c2\u00a0\u00c2\u00a0\nFor more information on the Handlebars library, please refer to their website at\u00c2\u00a0http://handlebarsjs.com.\u00c2\u00a0\nTemplates\nThe Handlebars templates are stored in the filesystem as .hbs files. These files are stored along with the view, layout, and field metadata and are loaded according to the inheritance\u00c2\u00a0you have selected in your controller. To view the list of available templates, or to see if a custom-created template is available, you can open your browser's console window and inspect the Handlebars.templates namespace.\nDebugging Templates\nWhen working with Handlebar templates, it can be difficult to identify where an issue is occurring or what a variable contains. To assist with troubleshooting this, you can use the log helper. The log helper will output the contents of this and the variable passed to it in your browser's console.\nThis is an example of using the logger in a\u00c2\u00a0handlebars template:\n{{log this}}\nHelpers\nHandlebar Helpers are a way of adding custom functionality to the templates. Helpers are located in the following places:\n./sidecar/src/view/hbs-helpers.js\u00c2\u00a0: Sidecar uses these helpers by default\n./include/javascript/sugar7/hbs-helpers.js\u00c2\u00a0:\u00c2\u00a0Additional helpers used by the base client\nCreating Helpers\nWhen working with Handlebar templates, you may need to create your helper. To do this, follow these steps:", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Handlebars/index.html"} {"id": "bedb57e1e5c8-1", "text": "Create a\u00c2\u00a0Handlebars helper file in the\u00c2\u00a0./custom/ directory. For this example, we will create two functions to convert a string to uppercase or lowercase:\n./custom/JavaScript/my-handlebar-helpers.js\u00c2\u00a0\n/**\n * Handlebars helpers.\n *\n * These functions are to be used in handlebars templates.\n * @class Handlebars.helpers\n * @singleton\n */\n(function(app) {\n app.events.on(\"app:init\", function() {\n /**\n * convert a string to upper case\n */\n Handlebars.registerHelper(\"customUpperCase\", function (text)\n {\n return text.toUpperCase();\n });\n /**\n * convert a string to lower case\n */\n Handlebars.registerHelper(\"customLowerCase\", function (text)\n {\n return text.toLowerCase();\n });\n });\n})(SUGAR.App);\nNext, create a\u00c2\u00a0JSGrouping extension in ./custom/Extension/application/Ext/JSGroupings/.\u00c2\u00a0Name the file uniquely for your customization. For this example,\u00c2\u00a0we will create:\n\u00c2\u00a0./custom/Extension/application/Ext/JSGroupings/my-handlebar-helpers.php\n $groupings) {\n foreach($groupings as $file => $target) {\n if ($target == 'include/javascript/sugar_grp7.min.js') {\n //append the custom helper file\n $js_groupings[$key]['custom/JavaScript/my-handlebar-helpers.js'] = 'include/javascript/sugar_grp7.min.js';\n }\n break;\n }\n}\nFinally, navigate to Admin > Repair and perform the following two repair sequences to include the changes:\nQuick Repair and Rebuild", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Handlebars/index.html"} {"id": "bedb57e1e5c8-2", "text": "Quick Repair and Rebuild\nRebuild JS Groupings.\nYou can now\u00c2\u00a0use your custom helpers in the HBS\u00c2\u00a0files by using:\n{{customUpperCase \"MyString\"}} \n{{customLowerCase \"MyString\"}}\nNote: You can also access the helpers function from your browsers developer console using\u00c2\u00a0Handlebars.helpers\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Handlebars/index.html"} {"id": "990e16c02ed2-0", "text": "Views\nOverview\nViews are component plugins that render data from a context. View components may contain field components and are typically made up of a controller JavaScript file (.js) and at least one Handlebars template (.hbs).\nLoad Order Hierarchy Diagram\nThe view components are loaded in the following manner:\nNote: The Sugar application's client type is \"base\". For more information on the various client types, please refer to\u00c2\u00a0the User Interface page.\nComponents\nViews are made up of a controller and a Handlebar template.\nController\nThe view's controller is what controls the view in how data is loaded, formatted, and manipulated. The controller is the JavaScript file named after the view. A controller file can be found in any of the directories shown in the\u00c2\u00a0hierarchy diagram\u00c2\u00a0above. In the example of the record view, the main controller file is located in ./clients/base/views/record/record.js\u00c2\u00a0and any\u00c2\u00a0modules extending this controller will have a file located in ./modules//clients/base/views/record/record.js. \u00c2\u00a0\nHandlebar Template\nThe views template is built on Handlebars and is what adds the display markup for\u00c2\u00a0the data. The template is typically named after the view or an action in the view. In the example of the record view, the main template us located in ./clients/base/views/record/record.hbs. This template will take the data fetched from the REST API\u00c2\u00a0to render the display for\u00c2\u00a0the user. More information on templates can be found in the Handlebars\u00c2\u00a0section.\nExtending Views", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Views/index.html"} {"id": "990e16c02ed2-1", "text": "Extending Views\nWhen working with module views, it is important to understand the difference between overriding and extending a view. Overriding is essentially creating or copying\u00c2\u00a0a view to be used by your application that is not extending its parent. By default, some module views already extend the core ./clients/base/views/record/record.js controller. An example of this is the accounts RecordView\n./modules/Accounts/clients/base/views/record/record.js\n({\n extendsFrom: 'RecordView',\n /**\n * @inheritdoc\n */\n initialize: function(options) {\n this.plugins = _.union(this.plugins || [], ['HistoricalSummary']);\n this._super('initialize', [options]);\n }\n})\nAs you can see, this view has the property:\u00c2\u00a0extendsFrom: 'RecordView'. This property tells Sidecar that the view is going to extend its parent RecordView. In addition to this, you can see that the initialize method is also calling\u00c2\u00a0this._super('initialize', [options]);. Calling this._super tells Sidecar\u00c2\u00a0to execute the parent function. The major benefit of doing this is that any updates to ./clients/base/views/record/record.js will be reflected for the module without\u00c2\u00a0any modifications being made to ./modules/Accounts/clients/base/views/record/record.js. You should note that when using extendsFrom, the parent views are called\u00c2\u00a0similarly to the load hierarchy:\u00c2\u00a0\n\u00c2\u00a0\nCreate View and Record View Inheritance\nThe diagram below demonstrates the inheritance of the create and record views for the Quotes module. This inheritance structure is the same for stock and custom modules alike.\u00c2\u00a0\nBasic View Example", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Views/index.html"} {"id": "990e16c02ed2-2", "text": "Basic View Example\nA simple view for beginners is the access-denied view. The view is located in ./clients/base/views/access-denied/ and is what handles the display for restricted access. The sections below will outline the various files that render this view.\nController\nThe access-denied.js, shown below, controls the manipulation actions\u00c2\u00a0of the view.\n./clients/base/views/access-denied/access-denied.js\n({\n className: 'access-denied tcenter',\n cubeOptions: {spin: false},\n events: {\n 'click .sugar-cube': 'spinCube'\n },\n spinCube: function() {\n this.cubeOptions.spin = !this.cubeOptions.spin;\n this.render();\n }\n})\nAttributes\nAttribute\nDescription\nclassName\nThe CSS class to apply to the view.\ncubeOptions\nA set of options that are passed to the spinCube function when called.\nevents\nA list of the view events. This view executes the spinCube function when the sugar cube is clicked.\nspinCube\nFunction to control the start and stop of the cube spinning.\nHandlebar Template\nThe access-denied.hbs file defines the format of the views content. As this view is used for restricting access, it displays a message to the user describing the restriction.\n./clients/base/views/access-denied/access-denied.hbs\n
\n

{{str 'ERR_NO_VIEW_ACCESS_TITLE'}}

\n

{{str 'ERR_NO_VIEW_ACCESS_REASON'}}

\n

{{str 'ERR_NO_VIEW_ACCESS_ACTION'}}

\n
\n{{{subFieldTemplate 'sugar-cube' 'detail' cubeOptions}}}\nHelpers\nName\nDescription\nstr\nHandlebars helper to render the label string\nsubFieldTemplate", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Views/index.html"} {"id": "990e16c02ed2-3", "text": "Name\nDescription\nstr\nHandlebars helper to render the label string\nsubFieldTemplate\nHandlebars helper to render the cube content\nCookbook Examples\nWhen working with views, you may find the follow cookbook examples helpful:\nAdding Buttons to the Record View\nAdding Field Validation to the Record View\nPassing_Data_to_Templates\nTopicsMetadataThis page is an overview of the metadata framework for Sidecar modules.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Views/index.html"} {"id": "e55f007621df-0", "text": "Metadata\nOverview\nThis page is an overview of the metadata framework for Sidecar modules.\nView Metadata Framework\nA module's view-specific metadata can be found in the modules view file:\n./modules//clients//views//.php\nAny edits made in Admin > Studio will be reflected in the file:\n./custom/modules//clients//views//.php\nNote: The Sugar application's client type is \"base\". For more information on the various client types, please refer to the User Interface page.\nNote: In the case of metadata, custom view metadata files are respected over the stock view metadata files.\nView Metadata\nThe Sidecar views metadata is very similar to that of the MVC metadata, however, there are some basic differences. All metadata for Sidecar follows the format:\n$viewdefs['']['base']['view'][''] = array();\nAn example of this is the account's record layout shown below:\n./modules/Accounts/clients/base/views/record/record.php\n array(\n array(\n 'name' => 'panel_header',\n 'header' => true,\n 'fields' => array(\n array(\n 'name' => 'picture',\n 'type' => 'avatar',\n 'width' => 42,\n 'height' => 42,\n 'dismiss_label' => true,\n 'readonly' => true,\n ),\n 'name',\n array(\n 'name' => 'favorite',\n 'label' => 'LBL_FAVORITE',\n 'type' => 'favorite',\n 'dismiss_label' => true,\n ),\n array(", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Views/Metadata/index.html"} {"id": "e55f007621df-1", "text": "'dismiss_label' => true,\n ),\n array(\n 'name' => 'follow',\n 'label'=> 'LBL_FOLLOW',\n 'type' => 'follow',\n 'readonly' => true,\n 'dismiss_label' => true,\n ),\n )\n ),\n array(\n 'name' => 'panel_body',\n 'columns' => 2,\n 'labelsOnTop' => true,\n 'placeholders' => true,\n 'fields' => array(\n 'website',\n 'industry',\n 'parent_name',\n 'account_type',\n 'assigned_user_name',\n 'phone_office',\n ),\n ),\n array(\n 'name' => 'panel_hidden',\n 'hide' => true,\n 'columns' => 2,\n 'labelsOnTop' => true,\n 'placeholders' => true,\n 'fields' => array(\n array(\n 'name' => 'fieldset_address',\n 'type' => 'fieldset',\n 'css_class' => 'address',\n 'label' => 'Billing Address',\n 'fields' => array(\n array(\n 'name' => 'billing_address_street',\n 'css_class' => 'address_street',\n 'placeholder' => 'LBL_BILLING_ADDRESS_STREET',\n ),\n array(\n 'name' => 'billing_address_city',\n 'css_class' => 'address_city',\n 'placeholder' => 'LBL_BILLING_ADDRESS_CITY',\n ),\n array(\n 'name' => 'billing_address_state',\n 'css_class' => 'address_state',\n 'placeholder' => 'LBL_BILLING_ADDRESS_STATE',\n ),", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Views/Metadata/index.html"} {"id": "e55f007621df-2", "text": "'placeholder' => 'LBL_BILLING_ADDRESS_STATE',\n ),\n array(\n 'name' => 'billing_address_postalcode',\n 'css_class' => 'address_zip',\n 'placeholder' => 'LBL_BILLING_ADDRESS_POSTALCODE',\n ),\n array(\n 'name' => 'billing_address_country',\n 'css_class' => 'address_country',\n 'placeholder' => 'LBL_BILLING_ADDRESS_COUNTRY',\n ),\n ),\n ),\n array(\n 'name' => 'fieldset_shipping_address',\n 'type' => 'fieldset',\n 'css_class' => 'address',\n 'label' => 'Shipping Address',\n 'fields' => array(\n array(\n 'name' => 'shipping_address_street',\n 'css_class' => 'address_street',\n 'placeholder' => 'LBL_SHIPPING_ADDRESS_STREET',\n ),\n array(\n 'name' => 'shipping_address_city',\n 'css_class' => 'address_city',\n 'placeholder' => 'LBL_SHIPPING_ADDRESS_CITY',\n ),\n array(\n 'name' => 'shipping_address_state',\n 'css_class' => 'address_state',\n 'placeholder' => 'LBL_SHIPPING_ADDRESS_STATE',\n ),\n array(\n 'name' => 'shipping_address_postalcode',\n 'css_class' => 'address_zip',\n 'placeholder' => 'LBL_SHIPPING_ADDRESS_POSTALCODE',\n ),\n array(\n 'name' => 'shipping_address_country',\n 'css_class' => 'address_country',\n 'placeholder' => 'LBL_SHIPPING_ADDRESS_COUNTRY',\n ),\n array(\n 'name' => 'copy',", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Views/Metadata/index.html"} {"id": "e55f007621df-3", "text": "),\n array(\n 'name' => 'copy',\n 'label' => 'NTC_COPY_BILLING_ADDRESS',\n 'type' => 'copy',\n 'mapping' => array(\n 'billing_address_street' => 'shipping_address_street',\n 'billing_address_city' => 'shipping_address_city',\n 'billing_address_state' => 'shipping_address_state',\n 'billing_address_postalcode' => 'shipping_address_postalcode',\n 'billing_address_country' => 'shipping_address_country',\n ),\n ),\n ),\n ),\n array(\n 'name' => 'phone_alternate',\n 'label' => 'LBL_OTHER_PHONE',\n ),\n 'email',\n 'phone_fax',\n 'campaign_name',\n array(\n 'name' => 'description',\n 'span' => 12,\n ),\n 'sic_code',\n 'ticker_symbol',\n 'annual_revenue',\n 'employees',\n 'ownership',\n 'rating',\n array(\n 'name' => 'date_entered_by',\n 'readonly' => true,\n 'type' => 'fieldset',\n 'label' => 'LBL_DATE_ENTERED',\n 'fields' => array(\n array(\n 'name' => 'date_entered',\n ),\n array(\n 'type' => 'label',\n 'default_value' => 'LBL_BY',\n ),\n array(\n 'name' => 'created_by_name',\n ),\n ),\n ),\n 'team_name',\n array(\n 'name' => 'date_modified_by',\n 'readonly' => true,\n 'type' => 'fieldset',", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Views/Metadata/index.html"} {"id": "e55f007621df-4", "text": "'readonly' => true,\n 'type' => 'fieldset',\n 'label' => 'LBL_DATE_MODIFIED',\n 'fields' => array(\n array(\n 'name' => 'date_modified',\n ),\n array(\n 'type' => 'label',\n 'default_value' => 'LBL_BY',\n ),\n array(\n 'name' => 'modified_by_name',\n ),\n ),\n ),\n ),\n ),\n ),\n);\nThe metadata for a given view can be accessed\u00c2\u00a0using app.metadata.getView\u00c2\u00a0within your controller. An example fetching the view metadata for the Accounts RecordView is shown below:\napp.metadata.getView('Accounts', 'record');\nYou should note that this can also be accessed in your browser's console window by using the global App Identifier:\nApp.metadata.getView('Accounts', 'record');\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Views/Metadata/index.html"} {"id": "b5fe9c4d7611-0", "text": "MainLayout\nOverview\nSugar's Main navigation is split into two components: Top-Header and Sidebar. The Top-Header is primarily used for search, notifications, and user actions and the Sidebar is the primary tool used\u00c2\u00a0to\u00c2\u00a0navigate the front end of the Sugar application.\nLayout Components\nThe Main layout is\u00c2\u00a0composed of Top-Header (header-nav) and Sidebar/Rail (sidebar-nav) layouts, and each of those layouts host views.\u00c2\u00a0\nTop Header (header-nav)\nThe Top Header (header-nav) layout, located in ./clients/base/layouts/header-nav/header-nav.php, is composed of the\u00c2\u00a0quicksearch layout as well as the header-nav-logos,\u00c2\u00a0\u00c2\u00a0notifications, profileactions\u00c2\u00a0views. To customize these components, you can create your own layout by extending it at\u00c2\u00a0./custom/Extension/application/Ext/custom/clients/base/layouts/header-nav/header-nav.php to reference your own custom components.\n\u00c2\u00a0\nSidebar/Rail (sidebar-nav)\nThe Sidebar/Rail layout hosts overall Menu options by grouping them into layouts separated by a line/divisor within the sidebar-nav definition.\nRail is collapsed by default and contains two main clickable actions: Primary and Secondary.\u00c2\u00a0\nLink Actions\nThe following properties define the\u00c2\u00a0navigation, display, and visibility of all links in the system:\nName\nDescription\nacl_action\nThe ACL action is used to verify the user has access to a specific action\u00c2\u00a0required for the\u00c2\u00a0link\nacl_module\nThe ACL module\u00c2\u00a0is used to verify if the user has access to a specific module required for the link\nicon\nThe bootstrap icon to display next to the link (the full list of icons are listed\u00c2\u00a0in Admin > Styleguide > Core Elements > Base CSS > Icons)\nlabel\nThe label key that contains your link's display text\nopenwindow", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/MainLayout/index.html"} {"id": "b5fe9c4d7611-1", "text": "label\nThe label key that contains your link's display text\nopenwindow\nSpecifies whether or not the link should\u00c2\u00a0open in a new window\nroute\nThe route to direct the user. For sidecar modules, this is #,\u00c2\u00a0but\u00c2\u00a0modules in backward compatibility mode are routed as #bwc/index.php?module=. Note:\u00c2\u00a0External links\u00c2\u00a0require the full URL as well as openwindow set to true.\nflyoutComponents\nAn array of sub-navigation linksNote:\u00c2\u00a0Sub-navigation links contain these same basic\u00c2\u00a0link properties.\nPrimary Action\nPrimary\u00c2\u00a0actions are triggered by the click of a button on the\u00c2\u00a0sidebar-nav's\u00c2\u00a0views. By default if a\u00c2\u00a0route\u00c2\u00a0property is provided in the view object in the layout metadata, the Primary Action will be a link to the route provided. For example:\n$viewdefs[...] = [\n 'layout' => [\n 'type' => 'sidebar-nav-item-group',\n 'name' => 'sidebar-nav-item-group-bottom',\n 'css_class' => 'flex-grow-0 flex-shrink-0',\n 'components' => [\n [\n 'view' => [\n 'name' => 'greeting-nav-item',\n 'type' => '',\n 'route' => '#Accounts',\n ...\n ],\n ],\n ],\n ],\n];\nOtherwise, if you're using a custom view and the controller has a\u00c2\u00a0primaryActionOnClick\u00c2\u00a0method defined, that will be used in addition to the\u00c2\u00a0route\u00c2\u00a0property.\u00c2\u00a0\nSecondary Action", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/MainLayout/index.html"} {"id": "b5fe9c4d7611-2", "text": "Secondary Action\nWith the introduction of the sidebar-nav-item component, we're now introducing secondary actions. These appear by way of a kebab menu when hovering on the\u00c2\u00a0sidebar-nav-item\u00c2\u00a0container to which they are added.\u00c2\u00a0Secondary Actions do have\u00c2\u00a0some default behavior. If the template has the following markup present, the kebab will render on hover:\n\nIf metadata is provided with certain keys, clicking on the kebab icon will render a flyout menu, for example, a metadata definition such as:\n [\n 'type' => 'sidebar-nav-item-group',\n 'name' => 'sidebar-nav-item-group-bottom',\n 'css_class' => 'flex-grow-0 flex-shrink-0',\n 'components' => [\n [\n 'view' => [\n 'name' => 'greeting-nav-item',\n 'type' => 'greeting-nav-item',\n 'route' => '#Accounts',\n 'icon' => 'sicon-bell-lg',\n 'label' => 'Hello!',\n 'flyoutComponents' => [\n [\n 'view' => 'sidebar-nav-flyout-header',\n 'title' => 'Greetings',\n ],\n [\n 'view' => [\n 'type' => 'sidebar-nav-flyout-actions',\n 'actions' => [\n [\n 'route' => '#Accounts',\n 'label' => 'LBL_ACCOUNTS',\n 'icon' => 'sicon-account-lg',\n ],\n ],", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/MainLayout/index.html"} {"id": "b5fe9c4d7611-3", "text": "'icon' => 'sicon-account-lg',\n ],\n ],\n ],\n ],\n ],\n ],\n ],\n ],\n ],\n];\nThe flyoutComponents array will render all the views that are passed to it. In this case, we load a\u00c2\u00a0sidebar-nav-item-header\u00c2\u00a0component and a\u00c2\u00a0sidebar-nav-item-flyout-actions\u00c2\u00a0component. Similar to a Primary Action, you can override the default\u00c2\u00a0secondaryActionOnClick\u00c2\u00a0method in your custom view controller to change the behavior of clicking on the kebab menu.\u00c2\u00a0\n$viewdefs[...] = [\n 'layout' => [\n 'type' => 'sidebar-nav-item-group',\n 'name' => 'sidebar-nav-item-group-bottom',\n 'css_class' => 'flex-grow-0 flex-shrink-0',\n 'components' => [\n [\n 'view' => [\n 'name' => 'greeting-nav-item',\n 'type' => 'greeting-nav-item',\n 'route' => '#Accounts',\n ...\n ],\n ],\n ],\n ],\n];\n\u00c2\u00a0\nThe following components define how the Sidebar/Rail layout is displayed.\nHome\nThe first group before the line/divisor contains the \"hamburger\" icon menu whose sole purpose is to expand/collapse the side nav.\nThe second group contains:\nHome menu dedicated to Dashboards\nQuick Create menu dedicated to creating new records\nHome Menu", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/MainLayout/index.html"} {"id": "b5fe9c4d7611-4", "text": "Home menu dedicated to Dashboards\nQuick Create menu dedicated to creating new records\nHome Menu\nThe Home menu view is composed of the sidebar-nav-flyout-module-menu\u00c2\u00a0(responsible to display the Secondary Action menus with dashboards and recent items),\u00c2\u00a0sidebar-nav-item-module\u00c2\u00a0(responsible to display the menu's title) views. To customize these components, you can create your own layout by extending them at\u00c2\u00a0./custom/Extension/application/Ext/custom/clients/base/views\u00c2\u00a0and locating its folder with the same name\u00c2\u00a0for your own custom components.\nQuick Create\n\u00c2\u00a0\nQuick Create view has been redesigned and presents the modules on click.\nNote this view does not require secondary action as others do with submenu\nQuick Create View\nThe Quick Create view is composed of the sidebar-nav-item-quickcreate\u00c2\u00a0(responsible to display the Quick Create menu and its icon),\u00c2\u00a0sidebar-nav-flyout-header\u00c2\u00a0(responsible to display the menu's title) and sidebar-quickcreate\u00c2\u00a0(responsible to display Secondary Action/submenu) views. To customize these components, you can create your own layout by extending them at\u00c2\u00a0./custom/Extension/application/Ext/custom/clients/base/views\u00c2\u00a0and locating its folder with the same name\u00c2\u00a0for your own custom components.\nModules", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/MainLayout/index.html"} {"id": "b5fe9c4d7611-5", "text": "Modules\nThe Modules layout, located in ./clients/base/layouts/sidebar-nav-item-group-modules/sidebar-nav-item-group-modules.js, contains the logic to load modules metadata, build the module list and display them accordingly depending on the Sidebar/Rail state (expanded or collapsed) as well as respect the Pinned Items and order it should be displayed.\u00c2\u00a0To customize this component, you can create your own by extending it at\u00c2\u00a0./custom/Extension/application/Ext/custom/clients/base/layouts/sidebar-nav-item-group-modules/sidebar-nav-item-group-modules.js,\u00c2\u00a0to reference your own custom logic and make sure you extend from the view SidebarNavItemModuleView or layout\u00c2\u00a0SidebarNavItemGroupModulesLayout\n\u00c2\u00a0\n\u00c2\u00a0\nif (isset($viewdefs['']['base']['menu']['header'])) {\n foreach ($viewdefs['']['base']['menu']['header'] as $key => $moduleAction) {\n //remove the link by label key\n if (in_array($moduleAction['label'], array(''))) {\n unset($viewdefs['']['base']['menu']['header'][$key]);\n }\n }\n}\nOnce you have created the\u00c2\u00a0extension files, navigate to Admin > Repair > Quick Repair and Rebuild.\u00c2\u00a0This will\u00c2\u00a0remove\u00c2\u00a0the\u00c2\u00a0menu\u00c2\u00a0action\u00c2\u00a0item from the existing list of links.\n\u00c2\u00a0\nProfile Action Links\nProfile actions are the links listed under the user's profile menu on the right side of the Top Header. Profile action extension files are\u00c2\u00a0located in\u00c2\u00a0./custom/Extension/application/Ext/clients/base/views/profileactions/ and are compiled into \u00c2\u00a0./custom/application/Ext/clients/base/views/profileactions/profileactions.ext.php.\nAdding Profile Action Links", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/MainLayout/index.html"} {"id": "b5fe9c4d7611-6", "text": "Adding Profile Action Links\nThe example below demonstrates how to add a profile action link to the Styleguide. To define your own profile action link, create your own label extension for the link's display label.\u00c2\u00a0\n./custom/Extension/application/Ext/Language/en_us.addProfileActionLink.php\n '#Styleguide',\n 'label' => 'LNK_STYLEGUIDE_C',\n 'icon' => 'icon-link',\n);\nOnce you have created the\u00c2\u00a0extension files, navigate to Admin > Repair > Quick Repair and Rebuild.\u00c2\u00a0This will append your profile action\u00c2\u00a0item to the existing list of links.\nNote: You may need to refresh the page to see the new profile menu items.\nRemoving Profile Action Links\nTo remove a profile action link, loop through the list of profile actions and remove the item by one of its properties. For your reference, the stock profile actions can be found in ./clients/base/views/profileactions/profileactions.php.\n./custom/Extension/application/Ext/clients/base/views/profileactions/removeProfileActionLink.php\n $profileAction) {\n //remove the link by label key\n if (in_array($profileAction['label'], array('LNK_ABOUT'))) {\n unset($viewdefs['base']['view']['profileactions'][$key]);\n }\n }\n}", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/MainLayout/index.html"} {"id": "b5fe9c4d7611-7", "text": "}\n }\n}\nOnce you have created the\u00c2\u00a0extension files, navigate to Admin > Repair > Quick Repair and Rebuild.\u00c2\u00a0This will remove\u00c2\u00a0the\u00c2\u00a0profile action\u00c2\u00a0item from the existing list of links.\nNote:\u00c2\u00a0You may need to refresh the page to see the profile menu items removed.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/MainLayout/index.html"} {"id": "324948df69ba-0", "text": "Drawers\nOverview\nThe drawer layout widget, located in ./clients/base/layouts/drawer/, is used to display a window of additional content to the user. This window can then be closed to display the content the user was previously viewing.\nMethods\napp.drawer.open(layoutDef, onClose)\nThe app.drawer.open(layoutDef, onClose) method\u00c2\u00a0displays a new content window over the current view.\nParameters\nName\nRequired\nDescription\nlayoutDef.layout\nyes\nThe id of the layout to load.\nlayoutDef.context\nno\nAdditional data you would like to pass to the drawer. Data passed in can be retrieved from the view using:\nthis.context.get('');\nNote: Be very careful about what you pass in as data to the drawer. As the data is passed in by reference, when the drawer is closed, the context is destroyed.\nonClose\nno\nOptional callback handler for when the drawer is closed.\nExample\napp.drawer.open({\n layout: 'my-layout',\n context: {\n myData: data\n },\n},\nfunction() {\n //on close, throw an alert\n alert('Drawer closed.');\n});\napp.drawer.close(callbackOptions)\nThe app.drawer.close(callbackOptions) method dismisses the topmost drawer.\nParameters\nName\nRequired\nDescription\ncallbackOptions\nno\nAny parameters passed into the close method will be passed to the callback.\nStandard Example\napp.drawer.close();\nCallback Example\n//open drawer\napp.drawer.open({\n layout: 'my-layout',\n},\nfunction(message1, message2) {\n alert(message1);\n alert(message2);\n});\n//close drawer\napp.drawer.close('message 1', 'message 2');\napp.drawer.load(options)\nLoads a new layout into an existing drawer.\nParameters\nName\nDescription\noptions.layout", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Drawers/index.html"} {"id": "324948df69ba-1", "text": "Loads a new layout into an existing drawer.\nParameters\nName\nDescription\noptions.layout\nThe id of the layout to load.\nExample\napp.drawer.load({\n layout: 'my-second-layout',\n});\napp.drawer.reset(triggerBefore)\nThe app.drawer.reset(triggerBefore) method destroys all drawers at once. By default, whenever the application is routed to another page, reset() is called.\nParameters\nName\nRequired\nDescription\ntriggerBefore\nno\nDetermines whether to triggerBefore. Defaults to false.\nExample\napp.drawer.reset();\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Drawers/index.html"} {"id": "69766d6cc067-0", "text": "Fields\n\u00c2\u00a0\nOverview\nFields are component plugins that render and format field values. They\u00c2\u00a0are made up of a controller JavaScript file (.js) and at least one Handlebars template (.hbt). For more information regarding the data handling of a field, please refer the data framework fields documentation. For information on creating custom field types, please refer the Creating Custom Field Types cookbook example.\nHierarchy Diagram\nThe field components are loaded in the following manner:\nNote: The Sugar application's client type is \"base\". For more information on the various client types, please refer to\u00c2\u00a0the User Interface page.\nField Example\nThe bool field, located in ./clients/base/fields/bool/, handles the display of\u00c2\u00a0checkbox boolean values. The sections below outline the various files that render this field type.\nController\nThe bool.js, file is shown below, overrides the base _render function to disable the field. The format and unformat functions handle the manipulation of the field's value.\n./clients/base/fields/bool/bool.js\n({\n _render: function() {\n app.view.Field.prototype._render.call(this);\n if(this.tplName === 'disabled') {\n this.$(this.fieldTag).attr(\"disabled\", \"disabled\");\n }\n },\n unformat:function(value){\n value = this.$el.find(\".checkbox\").prop(\"checked\") ? \"1\" : \"0\";\n return value;\n },\n format:function(value){\n value = (value==\"1\") ? true : false;\n return value;\n }\n})\nAttributes\nAttribute\nDescription\n_render\nFunction to render the field.\nunformat\nFunction to dynamically check the checkbox based on the value.\nformat\nFunction to format the value for storing in the database.\nHandlebar Templates", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Fields/index.html"} {"id": "69766d6cc067-1", "text": "format\nFunction to format the value for storing in the database.\nHandlebar Templates\nThe edit.hbs file defines the display of the control when the edit view is used. This layout is for displaying the editable form element that renders a clickable checkbox control for the user.\n./clients/base/fields/bool/edit.hbs\n{{#if def.text}}\n \n{{else}}\n \n{{/if}}\nHelpers\nHelpers\nDescription\nstr\nHandlebars helper to render the label string.\nThe detail.hbs file defines the display of the control when the detail view is used. This layout is for viewing purposes only so the control is disabled by default.\n./clients/base/fields/bool/detail.hbs\n\nThe list.hbs file defines the display of the control when the list view is used. This view is also for viewing purposes only so the control is disabled by default.\n./clients/base/fields/bool/list.hbs\n\nCookbook Examples\nWhen working with fields, you may find the follow cookbook examples helpful:\nCreating Custom Field Types\nConverting Address' Country Field to a Dropdown\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/User_Interface/Fields/index.html"} {"id": "6cea69957584-0", "text": "Architecture\nOverview\nThis section of Sugar's Developer Guide begins with a high-level overview of the Sugar platform's architecture and contains documentation on granular concepts in Sugar such as logic hooks, caching, logging, extensions, job queue, and more.\nPlease continue to the bottom of this page or use the navigation on the left to explore\u00c2\u00a0the related content.\nPlatform\nSugar\u00c2\u00ae is built on open standards and technology such as HTML5, PHP, and JavaScript, and runs on a variety of free and open-source technology like Linux, MySQL, and Elasticsearch. The Sugar platform also supports common proprietary databases such as Oracle, IBM DB2, and Microsoft SQL Server.\nAll of Sugar's customers and partners have access to source code that they can choose to deploy on-premise or utilize Sugar's cloud service for a SaaS deployment.\nOut of the box, Sugar uses a consistent platform across all clients and devices (e.g. mobile, web, plug-ins, etc.).\nFront-End Framework\nOur clients are based on a front-end framework called Sidecar. Sidecar is built on open source technology: Backbone.js, jQuery, Handlebars.js, and Bootstrap. The Sidecar framework provides a responsive UI (to support a variety of form factors) and uses modern, single-page client architecture. Sugar clients connect to Sugar server application via our client REST API. The REST API is implemented in PHP and drives server-side business logic and interacts with a database. If it can be accomplished via one of our clients, then its equivalent functionality can be accomplished using our REST API.\nThe Sugar platform uses modules. Modules are a vertically integrated application component that is traditionally organized around a single feature or record type (or underlying database table). For example, contact records are managed via a Contacts module that contains all the business logic, front-end interface definitions, REST APIs, data schema,\u00c2\u00a0and\u00c2\u00a0relationships with other modules.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/index.html"} {"id": "6cea69957584-1", "text": "Custom modules can be created and deployed as needed in order to add new features to a Sugar application instance.\u00c2\u00a0\nMetadata\nSugar's modules are defined primarily using Metadata. There are two types of metadata definitions within Sugar: Vardefs, which define the data model for Sugar modules; and Viewdefs, which define the user interface components that are used with a module.\nSugar Metadata is implemented as PHP files that can be modified directly by a Sugar Developer making filesystem changes, or indirectly through the use of Sugar Studio and Module Builder by a Sugar Administrator.\nMetadata allows you to configure solutions instead of having to write countless lines of custom code in order to implement common customizations such as adding custom fields, calculated values, and changing user interface layouts.\nExtensions\nBeyond metadata, Sugar is highly customizable and includes an extensive Extensions Framework that provides Sugar Developers the capability to contribute to pre-defined extension points within the application in a way that is upgrade-safe and will not conflict with other customizations that exist in the system.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/index.html"} {"id": "6cea69957584-2", "text": "TopicsAutoloaderThe autoloader is an API that allows the unified handling of customizations and customizable metadata while reducing the number of filesystem accesses and improving performance.CachingMuch of Sugar's user interface is built dynamically using a combination of templates, metadata and language files. A file caching mechanism improves the performance of the system by reducing the number of static metadata and language files that need to be resolved at runtime. This cache directory stores the compiled files for JavaScript files, Handlebars templates, and language files.UploadsThe upload directory is used to store files uploaded for imports, attachments, documents, and module loadable packages.EmailOutlines the relationships between emails, email addresses, and bean records.Email AddressesRecommended approaches when working with email addresses in Sugar.LoggingThere are two logging systems implemented in the Sugar application: SugarLogger and PSR-3. PSR-3 is Sugar's preferred logger solution and should be used going forward.Logic HooksThe Logic Hook framework allows you to append actions to system events such as when creating, editing, and deleting records.LanguagesSugar as an application platform is internationalized and localizable. Data is stored and presented in the UTF-8 codepage, allowing for all character sets to be used. Sugar provides a language-pack framework that allows developers to build support for any language in the display of user interface labels. Each language pack has its own set of display strings which is the basis of language localization. You can add or modify languages using the information in this guide.ExtensionsThe extension framework, defined in ./ModuleInstall/extensions.php, provides the capability to modify Sugar metadata such as vardefs and layouts in a safe way that supports installing, uninstalling, enabling, and disabling without interfering with other customizations.FiltersFilters are a way to predefine searches on views that render a list of records such as list views, pop-up searches, and lookups. This page explains how to implement the various types of filters for record list views.Duplicate CheckThe duplicate-check framework provides the capability", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/index.html"} {"id": "6cea69957584-3", "text": "implement the various types of filters for record list views.Duplicate CheckThe duplicate-check framework provides the capability to alter how the system searches for duplicate records in the database when creating records. For information on duplicate checking during imports, please refer to the index documentation.Elastic SearchThe focus of this document is to guide developers on how Sugar integrates with Elastic Search.Global SearchHow to customize the global search results.Sugar LogicSugar Logic, a feature in all Sugar products, enables custom business logic that is easy to create, manage, and reuse on both the server and client.AdministrationThe Administration class is used to manage settings stored in the database config table.ConfiguratorThe Configurator class, located in ./modules/Configurator/Configurator.php, handles the config settings found in ./config.php and ./config_override.php.Module LoaderModule Loader is used when installing customizations, plugins,language packs, and hotfixes, and other customizations into a Sugar instance in the form of a Module Loadable Package. This documentation covers the basics and best practices for creating module loadable packages for a Sugar installation.Module BuilderThe Module Builder tool allows programmers to create custom modules without writing code and to create relationships between new and existing CRM modules. To illustrate how to use Module Builder, this article will show how to create and deploy a custom module.QuotesAs of Sugar 7.9.0.0, the quotes module has been moved out of Backward Compatibility mode into Sidecar. Customizations to the Quotes interface will need to be rewritten for the new Sidecar framework as an automated migration of these customizations is not possible. This document will outline common customizations and implementation methods.SugarBPMSugarBPM\u00e2\u0084\u00a2 automation suite is the next-generation workflow management tool for Sugar. Introduced in 7.6, SugarBPM is loosely based on BPMN process notation standards and provides a simple drag-and-drop user interface along with an intelligent flow designer to allow for the creation of easy yet powerful process", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/index.html"} {"id": "6cea69957584-4", "text": "user interface along with an intelligent flow designer to allow for the creation of easy yet powerful process definitions.Entry PointsEntry points, defined in ./include/MVC/Controller/entry_point_registry.php, were used to ensure that proper security and authentication steps are applied consistently across the entire application. While they are still used in some areas of Sugar, any developers using custom entry points should adjust their customizations to use the latest REST API endpoints instead.Job QueueThe Job Queue executes automated tasks in Sugar through a scheduler, which integrates with external UNIX systems and Windows systems to run jobs that are scheduled through those systems. Jobs are the individual runs of the specified function from a scheduler.Access Control ListsAccess Control Lists (ACLs) are used to control access to the modules, data, and actions available to users in Sugar. By default, Sugar comes with a default ACL Strategy that is configurable by an Admin through the Roles module via Admin > Role Management. Sugar also comes with other ACL strategies that are located in the ./data/acl/ folder, and are used in other parts of the system such as the Administration module, Emails module, Locked Fields functionality, and many others. They can also be leveraged by customizations and custom ACL strategies can be implemented to control your own customizations.TeamsTeams provide the ability to limit access at the record level, allowing sharing flexibility across functional groups. Developers can manipulate teams programmatically provided they understand Sugar's visibility framework.TagsThe tagging feature allows a user to apply as many \"tags\" as they choose on any record they want to categorize. This allows the user to effectively group records together from any source within the application and relate them together. Please note that the tag field and Tags module do not support customization at this time.TinyMCEThis section contains information about working with the TinyMCE editor in Sugar.SugarPDFThis section contains information on generating PDFs and configuring PDF settings and fonts in Sugar.DateTimeThe SugarDateTime class, located in,", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/index.html"} {"id": "6cea69957584-5", "text": "generating PDFs and configuring PDF settings and fonts in Sugar.DateTimeThe SugarDateTime class, located in, ./include/SugarDateTime.php, extends PHP's built in DateTime class and can be used to perform common operations on date and time values.ShortcutsShortcuts is a framework to add shortcut keys to the application. When shortcut keys are registered, they are registered to a particular shortcut session. Shortcut sessions group shortcut keys, and they can be activated, deactivated, saved, and restored. Global shortcut keys can be registered, but they are not tied to a particular shortcut session. They are rather applied everywhere in the application and can only be applied once.ThemesHow to customize the Sugar theme.Web AccessibilityLearn about the Sugar Accessibility Plugin for Sidecar.Validation ConstraintsThis article will cover how to add validation constraints to your custom code.CLISugar on-premise deployments include a command line interface tool built using the Symfony Console Framework. Sugar's CLI is intended to be an administrator or developer level power tool to execute PHP code in the context of Sugar's code base. These commands are version specific and can be executed on a preinstalled Sugar instance or on an installed Sugar instance. Sugar's CLI is not intended to be used as a tool to interact remotely with an instance nor is it designed to interact with multiple instances.Performance TuningThe Performance Tuning section contains information that will help maximize system performance for your Sugar instance.Backward CompatibilityAs of Sugar\u00c2\u00ae 7, modules are built using the Sidecar framework. Any modules that still use the MVC architecture and have not yet migrated to the Sidecar framework are set in what Sugar refers to as \"backward compatibility\" (BWC) mode.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/index.html"} {"id": "6cea69957584-6", "text": "Last modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/index.html"} {"id": "cd28755f551c-0", "text": "Extensions\nOverview\nThe extension framework,\u00c2\u00a0defined in\u00c2\u00a0./ModuleInstall/extensions.php, provides the capability to modify Sugar metadata such as vardefs and layouts in a safe way that supports installing, uninstalling, enabling, and disabling without interfering with other customizations.\nApplication extensions are stored under ./custom/Extension/application/Ext/ and module extensions are under ./custom/Extension/modules//Ext/. The files in each of these directories are aggregated into a single file with a predefined name for the system to use. An example of this is the vardefs extension. The vardef extension directory for Accounts is located in ./custom/Extension/modules/Accounts/Ext/Vardefs/. When a module is installed, uninstalled, enabled, or disabled, the files contained in this directory are merged into ./custom/modules/Accounts/Ext/Vardefs/vardefs.ext.php. A Quick Repair & Rebuild will also cause the files to merge.\nThe core extension mappings are listed in the Topics section at the bottom of this page.\nExtensions Properties\nEach extension contains the following properties:\nProperty\nDescription\nExtension Scope\nAll\u00c2\u00a0: Extension can be applied to the ./custom/application/ or ./custom// directory\nApplication\u00c2\u00a0: Extension can only be applied to the ./custom/application/ directory\nModule\u00c2\u00a0: Extension can only be applied to the ./custom// directory\nDefinition\u00c2\u00a0Variable\nThe variable that Sugar\u00c2\u00a0for utilizing the extension definition. If defined, this variable must be set with the appropriate definition properties.\nExtension Directory\nThe directory that the extension compiles files from\nIf the customization is for the application, the extension file should be placed in ./custom/Extension/application/Ext//\nIf the customization is for a module, the extension file should be placed in ./custom/Extension/modules//Ext//\nCompiled Extension File\nThe name of the compiled extension file", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/index.html"} {"id": "cd28755f551c-1", "text": "Compiled Extension File\nThe name of the compiled extension file\nIf the extension is for the application, the compiled file will be located in ./custom/application/Ext//.ext.php\nIf the extension is for a module, the compiled file will be located in ./custom/modules//Ext//.ext.php\nManifest Installdef\nThe index of the $installdef in the manifest file for module loadable packages.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/index.html"} {"id": "cd28755f551c-2", "text": "TopicsActionFileMapThe ActionFileMap extension maps actions to files, which helps you map a file to a view outside of ./custom/modules//views/view..php. This page is only applicable to modules running in backward compatibility mode.ActionReMapThe ActionReMap extension maps new actions to existing actions. This extension is only applicable to modules running in backward compatibility mode.ActionViewMapThe ActionViewMap extension maps additional actions for a module.AdministrationThe Administration extension adds new panels to Sugar's Administration page.Application SchedulersApplication Scheduler extensions add custom functions that can be used by scheduler jobs.ConsoleThe Console extension adds custom CLI commands to Sugar. More information on creating custom commands can be found in the CLI documentation.DependenciesDependencies create dependent actions for fields and forms that can leverage more complicated logic.EntryPointRegistryThe EntryPointRegistry extension maps additional entry points to the system. Please note that entry points will soon be deprecated. Developers should move custom logic to endpoints. For more information, please refer to the Entry Points page.ExtensionsThis extension allows for developers to create custom extensions within the framework. Custom extensions are used alongside the extensions found in ./ModuleInstaller/extensions.php.FileAccessControlMapThe FileAccessControlMap extension restricts specific view actions from users of the system.IncludeThe Modules extension maps additional modules in the system, typically when Module Builder deploys a module.JSGroupingsThe JSGroupings extension allows for additional JavaScript grouping files to be created or added to existing groupings within the system.LanguageThe Language extension adds or overrides language strings.LayoutdefsThe Layoutdefs extension adds or overrides subpanel definitions.LogicHooksThe LogicHooks extension adds actions to specific events such as, for example, before saving a bean. For more information on logic hooks in Sugar, please refer to the Logic Hooks documentation.ModulesThe Modules extension maps additional modules in the system, typically when Module Builder deploys a module.PlatformsThe Platforms extension adds allowed REST API platforms when restricting custom platforms through the use of the disable_unknown_platforms", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/index.html"} {"id": "cd28755f551c-3", "text": "Platforms extension adds allowed REST API platforms when restricting custom platforms through the use of the disable_unknown_platforms configuration setting.ScheduledTasksThe ScheduledTasks extension adds custom functions that can be used by scheduler jobs. For more information about schedulers in Sugar, please refer to the Schedulers documentation.SidecarThe Sidecar extension installs metadata files to their appropriate directories.TinyMCEThe TinyMCE extension affects the TinyMCE WYSIWYG editor's configuration for backward compatible modules such as PDF Manager and Campaign Email Templates.UserPageThe UserPage extension adds sections to the User Management view.UtilsThe Utils extension adds functions to the global utility function list.VardefsThe Vardefs extension adds or overrides system vardefs, which provide the Sugar application with information about SugarBeans.WirelessLayoutdefsThe WirelessLayoutdefs extension adds additional subpanels to wireless views. This extension is only applicable to modules running in backward compatibility mode.WirelessModuleRegistryThe WirelessModuleRegistry extension adds modules to the available modules for mobile.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/index.html"} {"id": "cd28755f551c-4", "text": "Last modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/index.html"} {"id": "0de4b2b31aa9-0", "text": "This page refers to content that is only available in modules running in backward compatibility mode.\nActionFileMap\nOverview\nThe ActionFileMap extension maps actions to files, which helps\u00c2\u00a0you map a file to a view outside of ./custom/modules//views/view..php. This page is only applicable to modules running in backward compatibility mode.\nProperties\nThe following extension properties are available.\u00c2\u00a0For more information, please refer to the Extension Property documentation.\nProperty\nValue\nExtension Scope\nModule\nSugar Variable\n$action_file_map\nExtension Directory\n./custom/Extension/modules//Ext/ActionFileMap/\nCompiled Extension File\n./custom//Ext/ActionFileMap/action_file_map.ext.php\nManifest Installdef\n$installdefs['action_file_map']\nImplementation\nThe following sections illustrate the various ways to implement a customization to a Sugar instance.\nFile System\nWhen working directly with the filesystem, you can create a file in ./custom/Extension/modules//Ext/ActionFileMap/ to map a new action in the system. The following example will create a new action called \"example\" in a module:\n./custom/Extension/modules//Ext/ActionFileMap/.php\n/new_action.php';\nNext, create your action file:\n./custom/modules//new_action.php\n\nNext, navigate to Admin > Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and compile your customization into\u00c2\u00a0./custom/modules//Ext/ActionFileMap/action_file_map.ext.php\nModule Loadable Package\nWhen building a module-loadable package, you can use the $installdefs['action_file_map'] index to install the extension file.\u00c2", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/ActionFileMap/index.html"} {"id": "0de4b2b31aa9-1", "text": "Installdef Properties\nName\nType\nDescription\nfrom\nString\nThe basepath of the file to be installed.\u00c2\u00a0\nto_module\nString\nThe key of the module the file is to be installed to.\nThe example below demonstrates the proper install definition that should be used in the ./manifest.php file in order to add the Action File Map file to a specific module. You should note that when using this approach, you still need to use the $installdefs['copy'] index for the Action file, but Sugar will automatically execute Rebuild Extensions to reflect the new Action in the system.\n./manifest.php\n 'ActionRemap_Example',\n 'action_file_map' => array(\n array(\n 'from' => '/Files/custom/Extension/modules//Ext/ActionFileMap/.php',\n 'to_module' => '',\n )\n ),\n 'copy' => array(\n array(\n 'from' => '/Files/custom/example.php',\n 'to' => 'custom/example.php'\n )\n )\n);\nAlternatively, you may use the $installdefs['copy'] index for the Action File Map Extension file. When using this approach, you may need to manually run repair actions such as a Quick Repair and Rebuild. For more information\u00c2\u00a0on the $installdefs['copy'] index and module-loadable packages, please refer to the Introduction to the Manifest page.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/ActionFileMap/index.html"} {"id": "cae115c73927-0", "text": "This page refers to content that is only available in modules running in backward compatibility mode.\nWirelessLayoutdefs\nOverview\nThe WirelessLayoutdefs extension adds additional subpanels to wireless views. This extension is only applicable to modules running in backward compatibility mode.\nProperties\nThe following extension properties are available.\u00c2\u00a0For more information, please refer to the Extension Property documentation.\nProperty\nValue\nExtension Scope\nModule\nSugar Variable\n$layout_defs\nExtension Directory\n./custom/Extension/modules//Ext/WirelessLayoutdefs/\nCompiled Extension File\n./custom//Ext/WirelessLayoutdefs/wireless.subpaneldefs.ext.php\nManifest Installdef\n$installdefs['wireless_subpanels']\nImplementation\nThe following sections illustrate the various ways to implement a customization to a Sugar instance.\nFile System\nWhen working directly with the filesystem, you can create a file in ./custom/Extension/modules//Ext/WirelessLayoutdefs/ to add a subpanel to a module in the system. The following example will add a new subpanel to a specified module:\n./custom/Extension/modules//Ext/WirelessLayoutdefs/.php\n']['subpanel_setup'][''] = array(\n 'order' => 10,\n 'module' => '',\n 'get_subpanel_data' => '',\n 'title_key' => 'LBL_SUBPANEL_TITLE',\n);\nNavigate to Admin > Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and compile your customization into ./custom/modules//Ext/WirelessLayoutdefs/wireless.subpaneldefs.ext.php.\nModule Loadable Package\nWhen building a module loadable package, you can use the $installdefs['wireless_subpanels'] index to install the extension file.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/WirelessLayoutdefs/index.html"} {"id": "cae115c73927-1", "text": "Installdef Properties\nName\nType\nDescription\nfrom\nString\nThe base path of the file to be installed\nto_module\nString\nThe key for the module where the file will be installed\nThe example below will demonstrate the proper install definition that should be used in the ./manifest.php file in order to add the subpanel file to a specific module. You should note that when using this approach Sugar will automatically execute Rebuild Extensions to reflect the subpanel in the system.\n./manifest.php\n 'wirelessLayoutdefs_Example',\n 'wireless_subpanels' => array(\n array(\n 'from' => '/Files/custom/Extension/modules//Ext/WirelessLayoutdefs/.php',\n 'to_module' => '',\n )\n )\n);\nAlternatively, you may use the $installdefs['copy'] index to copy the file. When using this approach, you may need to manually run repair actions such as a Quick Repair and Rebuild. For more information on the $installdefs['copy'] index and module-loadable packages, please refer to the Introduction to the Manifest page.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/WirelessLayoutdefs/index.html"} {"id": "b7a86d4ba843-0", "text": "Modules\nOverview\nThe Modules extension maps additional modules in the system, typically when Module Builder deploys a module.\nProperties\nThe following extension properties are available.\u00c2\u00a0For more information, please refer to the Extension Property documentation.\nProperty\nValue\nExtension Scope\nApplication\nSugar Variable\n$beanList, $beanFiles, $moduleList\nExtension Directory\n./custom/Extension/application/Ext/Include/\nCompiled Extension File\n./custom/application/Ext/Include/modules.ext.php\nManifest Installdef\n$installdefs['beans']\nImplementation\nThe following sections illustrate the various ways to implement a customization to a Sugar instance.\nFile System\nWhen working directly with the filesystem, you can create a file in ./custom/Extension/application/Ext/Include/ to register a new module in the system. This extension is normally used when deploying custom modules. The example below shows what this file will look like after a module is deployed:\n./custom/Extension/application/Ext/Include/.php\n Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and compile your customization into ./custom/application/Ext/Include/modules.ext.php.\nModule Loadable Package\nWhen building a module loadable package, you can use the $installdefs['beans'] index to install the extension file.\nInstalldef Properties\nName\nType\nDescription\nmodule\nString\nThe key of the module to be installed\nclass\nString\nThe class name of the module to be installed\npath\nString\nThe path to the module's class\ntab\nBoolean\nWhether or not the module will have a navigation tab (defaults to false)", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/Modules/index.html"} {"id": "b7a86d4ba843-1", "text": "tab\nBoolean\nWhether or not the module will have a navigation tab (defaults to false)\nThe example below demonstrates the proper install definition that should be used in the ./manifest.php file, in order to add a custom module to the system. When using this approach, you still need to use the $installdefs['copy'] index for Module directory, however, Sugar will automatically execute the database table creation process, relationship table creation process, as well as Rebuild Extensions to reflect the new Module in the system.\n./manifest.php\n 'Beans_Example',\n 'beans' => array(\n array(\n 'module' => 'cust_Module',\n 'class' => 'cust_Module',\n 'path' => 'modules/cust_Module/cust_Module.php',\n 'tab' => true\n )\n ),\n 'copy' => array(\n array(\n 'from' => '/Files/modules/cust_Module',\n 'to' => 'modules/cust_Module'\n )\n )\n);\nAlternatively, you may use the\u00c2\u00a0$installdefs['copy']\u00c2\u00a0index for copying the Modules definition file into the ./custom/Extension/application/Ext/Include/\u00c2\u00a0directory. When using this approach, you may need to manually run repair actions such as a Quick Repair and Rebuild. For more information\u00c2\u00a0on the\u00c2\u00a0$installdefs['copy']\u00c2\u00a0index and module loadable packages, please refer to the\u00c2\u00a0Introduction to the Manifest\u00c2\u00a0page.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/Modules/index.html"} {"id": "12e32d91212b-0", "text": "Language\nOverview\nThe Language extension adds or overrides language strings.\nThis extension is applicable to both the application and module framework. For more information, please refer to the Language Framework page.\nProperties\nThe following extension properties are available.\u00c2\u00a0For more information, please refer to the Extension Property documentation.\nProperty\nValue\nExtension Scope\nAll - Application & Module\nSugar Variables\nIf adding language files to application:$app_strings / $app_list_strings\u00c2\u00a0\nIf adding language files to :$mod_strings\nExtension Directory\nApplication: ./custom/Extension/application/Ext/Language/\nModule: ./custom/Extension/modules//Ext/Language/\nCompiled Extension File\nApplication: ./custom/application/Ext/Language/.lang.ext.php\nModule:\u00c2\u00a0./custom/modules//Ext/Language/.lang.ext.php\nManifest Installdef\n$installdefs['language']\n\u00c2\u00a0\nImplementation\nThe following sections illustrate\u00c2\u00a0the various ways to implement a customization to a Sugar instance.\nFile System\nCreating New Application Label\nWhen working directly with the filesystem, you can create a file in ./custom/Extension/application/Ext/Language/ to add Labels for languages to the system.\u00c2\u00a0The following example will add a new Label 'LBL_EXAMPLE_LABEL' to the system:\u00c2\u00a0\n./custom/Extension/application/Ext/Language/..php\n Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and compile your customization into./custom/application/Ext/Language/.lang.ext.php\nCreating New Module Label", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/Language/index.html"} {"id": "12e32d91212b-1", "text": "Creating New Module Label\nWhen working directly with the filesystem, you can create a file in ./custom/Extension/modules//Ext/Language/ to add Labels for languages to a particular module.\u00c2\u00a0The following example will add a new Label 'LBL_EXAMPLE_MODULE_LABEL' to a module:\n./custom/Extension/modules//Ext/Language/..php\n Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and compile your customization into ./custom/modules//Ext/Language/.lang.ext.php\nModule Loadable Package\nWhen building a module loadable package, you can use the $installdefs['language'] index to install the extension file.\u00c2\u00a0\nInstalldef Properties\nName\nType\nDescription\nfrom\nString\nThe basepath of the file to be installed.\u00c2\u00a0\nto_module\nString\nThe key of the module the file is to be installed to.\nlanguage\nString\nThe key of the language the file is to be installed to.\nThe example below will demonstrate the proper install definition that should be used in the ./manifest.php file, in order to add the Language Extension file to the system. You should note that when using this approach\u00c2\u00a0Sugar will automatically execute Rebuild Extensions\u00c2\u00a0to reflect the new Labels in the system.\n./manifest.php\n 'language_Example',\n 'language' => array(\n array(\n 'from' => '/Files/custom/Extension/application/Ext/Language/.lang.ext.php',\n 'to_module' => 'application',\n 'language' => ''\n )\n )\n);", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/Language/index.html"} {"id": "12e32d91212b-2", "text": "'language' => ''\n )\n )\n);\nAlternatively, you may use the $installdefs['copy'] index to copy the file. When using this approach, you may need to manually run repair actions such as a Quick Repair and Rebuild. For more information on the $installdefs['copy'] index and module-loadable packages, please refer to the Introduction to the Manifest page.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/Language/index.html"} {"id": "cb5f3331200c-0", "text": "Console\nOverview\nThe Console\u00c2\u00a0extension adds custom CLI commands to Sugar. More information on creating custom commands can be found in the CLI documentation.\nProperties\nThe following extension properties are available.\u00c2\u00a0For more information, please refer to the Extension Property documentation.\nProperty\nValue\nExtension Scope\nApplication\nExtension Directory\n./custom/Extension/application/Ext/Console/\nCompiled Extension File\n./custom/application/Ext/Console/console.ext.php\nManifest Installdef\n$installdefs['console']\nImplementation\nThe following sections illustrate the various ways to implement a customization to a Sugar instance.\nFile System\nTo create a Sugar console\u00c2\u00a0extension, please refer to our CLI documentation.\nModule Loadable Package\nWhen building a module loadable package, you can use the $installdefs['console'] index to install the extension file.\nInstalldef Properties\nName\nType\nDescription\nfrom\nString\nThe basepath of the file to be installed.\nThe example below demonstrates the proper install definition that should be used in the ./manifest.php file in order to add the console command.\u00c2\u00a0\n./manifest.php\n 'console_Example',\n 'console' => array(\n array(\n 'from' => '/Files/custom/Extension/application/Ext/Console/RegisterHelloWorldCommand.php'\n )\n ),\n 'copy' => array (\n 0 => array (\n 'from' => '/Files/custom/src/Console/Command/HelloWorldCommand.php',\n 'to' => 'custom/src/Console/Command/HelloWorldCommand.php',\n ),\n ),\n);", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/Console/index.html"} {"id": "cb5f3331200c-1", "text": "),\n ),\n);\nAlternatively, you may use the $installdefs['copy'] index to copy the file. When using this approach, you may need to manually run repair actions such as a Quick Repair and Rebuild. For more information on the $installdefs['copy'] index and module-loadable packages, please refer to the Introduction to the Manifest page.\nDownload the module loadable example package here.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/Console/index.html"} {"id": "bf780a13c326-0", "text": "Administration\nOverview\nThe Administration extension adds new panels to Sugar's Administration page.\nProperties\nThe following extension properties are available.\u00c2\u00a0For more information, please refer to the Extension Property documentation.\nProperty\nValue\nExtension Scope\nModule: Administration\nSugar Variable\n$admin_group_header\nExtension Directory\n./custom/Extension/modules/Administration/Ext/Administration/\nCompiled Extension File\n./custom/modules/Administration/Ext/Administration/administration.ext.php\nManifest Installdef\n$installdefs['administration']\nImplementation\nThe following sections illustrate\u00c2\u00a0the various ways to implement a customization to a Sugar instance.\nFile System\nWhen working directly with the filesystem, you can create a file in ./custom/Extension/modules/Administration/Ext/Administration/.php to add new Administration Links in the system. The following example will add a new panel to the Administration page\u00c2\u00a0called \"Example Admin Panel\", which will contain one link called \"Example Link\":\nThe following example will create a new admin panel:\n./custom/Extension/modules/Administration/Ext/Administration/.php\n'] = array(\n //Icon name. Available icons are located in ./themes/default/images\n 'Administration',\n //Link name label \n 'LBL_LINK_NAME',\n //Link description label\n 'LBL_LINK_DESCRIPTION',\n //Link URL - For Sidecar modules\n 'javascript:parent.SUGAR.App.router.navigate(\"/\", {trigger: true});',\n //Alternatively, if you are linking to BWC modules\n //'./index.php?module=&action=',\n );\n $admin_group_header[] = array(\n //Section header label\n 'LBL_SECTION_HEADER',\n //$other_text parameter for get_form_header()\n '',", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/Administration/index.html"} {"id": "bf780a13c326-1", "text": "//$other_text parameter for get_form_header()\n '',\n //$show_help parameter for get_form_header()\n false,\n //Section links\n $admin_option_defs, \n //Section description label\n 'LBL_SECTION_DESCRIPTION'\n );\nNext, we will populate the panel label values:\n./custom/Extension/modules/Administration/Ext/Language/en_us..php\n Repair > Quick Repair and Rebuild. The system will then rebuild the extensions, compiling your customization into ./custom/modules/Administration/Ext/Administration/administration.ext.php, and the new panel will appear in the Administration section.\nModule Loadable Package\nWhen building a module loadable package, use the $installdefs['administration'] index to install the extension file.\nInstalldef Properties\nName\nType\nDescription\nfrom\nString\nThe base path of the file to be installed\nThe example below demonstrates the proper install definition that should be used in the ./manifest.php file in order to add the Administration file to the system. If you are utilizing a Language file, as recommended above, you must use the $installdefs['language'] index to install the Language definition. Using the $installdefs['administration'] index will automatically execute Rebuild Extensions to reflect the new Administration Links in the system.\n 'administration_example',\n 'administration' => array(\n array(", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/Administration/index.html"} {"id": "bf780a13c326-2", "text": "'administration' => array(\n array(\n 'from' => '/custom/Extension/modules/Administration/Ext/Administration/.php'\n )\n ),\n 'language' => array(\n array(\n 'from' => '/custom/Extensions/modules/Administration/Ext/Language/en_us..php',\n 'to_module' => 'Administration',\n 'language' =>'en_us'\n )\n )\n); \nAlternatively, you may also choose to use the $installdefs['copy'] index for the Administration Link Extension file. When using this approach, you may need to manually run a repair action such as a Quick Repair and Rebuild.\nFor more information on the $installdefs['copy'] index and module-loadable packages, please refer to the Introduction to the Manifest page.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/Administration/index.html"} {"id": "bab57b7c761b-0", "text": "This page refers to content that is only available in modules running in backward compatibility mode.\nLayoutdefs\nOverview\nThe Layoutdefs extension adds or overrides subpanel definitions.\nNote: This extension is only applicable to modules running in backward compatibility mode.\nProperties\nThe following extension properties are available.\u00c2\u00a0For more information, please refer to the Extension Property documentation.\nProperty\nValue\nExtension Scope\nModule\nSugar Variable\n$layout_defs\nExtension Directory\n./custom/Extension/modules//Ext/Layoutdefs/\nCompiled Extension File\n./custom//Ext/Layoutdefs/layoutdefs.ext.php\nManifest Installdef\n$installdefs['layoutdefs']\nImplementation\nThe following sections illustrate the various ways to implement a customization to a Sugar instance.\nFile System\nWhen working directly with the filesystem, you can create a file in ./custom/Extension/modules//Ext/Layoutdefs/ to add Layout Definition files to the system. The following example will add a subpanel definition for a module relationship:\n./custom/Extension/modules//Ext/Layoutdefs/.php\n\"][\"subpanel_setup\"][''] = array (\n 'order' => 100,\n 'module' => '',\n 'subpanel_name' => 'default',\n 'sort_order' => 'asc',\n 'sort_by' => 'id',\n 'title_key' => 'LBL_SUBPANEL_TITLE',\n 'get_subpanel_data' => '',\n 'top_buttons' => array (\n array (\n 'widget_class' => 'SubPanelTopButtonQuickCreate',\n ),\n array (\n 'widget_class' => 'SubPanelTopSelectButton',\n 'mode' => 'MultiSelect',\n ),\n ),\n);", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/Layoutdefs/index.html"} {"id": "bab57b7c761b-1", "text": "'mode' => 'MultiSelect',\n ),\n ),\n);\nPlease note that, if you are attempting to override parts of an existing subpanel definition, you should specify the exact index rather than redefining the entire array. An example of overriding the subpanel top_buttons index is shown below:\n\"][\"subpanel_setup\"][\"\"][\"top_buttons\"] = array(\n array(\n 'widget_class' => 'SubPanelTopButtonQuickCreate',\n ),\n);\nNext, navigate to Admin > Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and compile your customizations to ./custom/modules//Ext/Layoutdefs/layoutdefs.ext.php .\nModule Loadable Package\nWhen building a module loadable package, you can use the $installdefs['layoutdefs'] index to install the extension file.\nInstalldef Properties\nName\nType\nDescription\nfrom\nString\nThe base path of the file to be installed\nto_module\nString\nThe key for the module where the file will be installed\nThe example below demonstrates the proper install definition that should be used in the ./manifest.php file in order to add the Layout Definition Extension file to the system. When using this approach, Sugar will automatically execute Rebuild Extensions to reflect the customizations added with the Layout definition.\n./manifest.php\n 'layoutdefs_Example',\n 'layoutdefs' => array(\n array(\n 'from' => '/Files/custom/Extension/modules//Ext/Layoutdefs/.php',\n 'to_module' => '',\n )\n )\n);", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/Layoutdefs/index.html"} {"id": "bab57b7c761b-2", "text": "'to_module' => '',\n )\n )\n);\nAlternatively, you may use the $installdefs['copy'] index to copy the file. When using this approach, you may need to manually run repair actions such as a Quick Repair and Rebuild. For more information on the $installdefs['copy'] index and module-loadable packages, please refer to the Introduction to the Manifest page.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/Layoutdefs/index.html"} {"id": "8a280f97feb2-0", "text": "Utils\nOverview\nThe Utils extension adds functions to the global utility function list.\nProperties\nThe following extension properties are available.\u00c2\u00a0For more information, please refer to the Extension Property documentation.\nProperty\nValue\nExtension Scope\nApplication\nExtension Directory\n./custom/Extension/application/Ext/Utils/\nCompiled Extension File\n./custom/application/Ext/Utils/custom_utils.ext.php\nManifest Installdef\n$installdefs['utils']\nImplementation\nThe following sections illustrate the various ways to implement a customization to a Sugar instance.\nFile System\nWhen working directly with the filesystem, you can create a file in ./custom/Extension/application/Ext/Utils/ to map a new action in the system. The following example will create a new function called 'exampleUtilFunction' that can be used throughout the system:\n./custom/Extension/application/Ext/Utils/.php\n Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and your customizations will be compiled into ./custom/application/Ext/Utils/custom_utils.ext.php .\nAlternatively, functions can also be added by creating ./custom/include/custom_utils.php. This method of creating utils is still compatible but is not recommended from a best practices standpoint.\nModule Loadable Package\nWhen building a module loadable package, you can use the $installdefs['utils'] index to install the extension file.\nInstalldef Properties\nName\nType\nDescription\nfrom\nString\nThe base path of the file to be installed\nThe example below demonstrates the proper install definition that should be used in the ./manifest.php file in order to add the utils to the system. You should note that when using this approach, Sugar will automatically execute Rebuild Extensions to reflect the new utils in the system.\n./manifest.php\n 'utils_Example',\n 'utils' => array(\n array(\n 'from' => '/Files/custom/Extension/application/Ext/Utils/.php',\n )\n )\n);\nAlternatively, you may use the $installdefs['copy'] index to copy the file. When using this approach, you may need to manually run repair actions such as a Quick Repair and Rebuild. For more information on the $installdefs['copy'] index and module-loadable packages, please refer to the Introduction to the Manifest page.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/Utils/index.html"} {"id": "048816b5d49d-0", "text": "This page refers to content that is only available in modules running in backward compatibility mode.\nTinyMCE\nOverview\nThe TinyMCE extension affects the TinyMCE WYSIWYG editor's configuration for backward compatible modules such as PDF Manager and Campaign Email Templates.\nTo review the default configuration for TinyMCE, please refer to the code in ./include/SugarTinyMCE.php. Sidecar's TinyMCE configuration can be edited using the Sidecar Framework and editing the htmleditable_tinymce field.\nProperties\nThe following extension properties are available.\u00c2\u00a0For more information, please refer to the Extension Property documentation.\nProperty\nValue\nExtension Scope\nApplication\nSugar Variable\n$defaultConfig, $buttonConfigs, $pluginsConfig\nExtension Directory\n./custom/Extension/application/Ext/TinyMCE/\nCompiled Extension File\n./custom/application/Ext/TinyMCE/tinymce.ext.php\nManifest Installdef\n$installdefs['tinymce']\nImplementation\nThe following sections illustrate the various ways to implement a customization to a Sugar instance.\nFile System\nWhen working directly with the filesystem, you can create a file in ./custom/Extension/application/Ext/TinyMCE/ to customize the TinyMCE configuration. The following example will increase the height of the TinyMCE window, remove buttons, and remove plugins from the WYSIWYG Editor:\n./custom/Extension/application/Ext/TinyMCE/.php\n \"bold,italic,underline,strikethrough,separator,bullist,numlist\",\n 'buttonConfig2' => \"justifyleft,justifycenter,justifyright,justifyfull\",\n 'buttonConfig3' => \"fontselect,fontsizeselect\",\n);", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/TinyMCE/index.html"} {"id": "048816b5d49d-1", "text": "'buttonConfig3' => \"fontselect,fontsizeselect\",\n);\n$pluginsConfig['default'] = 'advhr,preview,paste,directionality';\nNavigate to Admin > Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and compile your customization into ./custom/application/Ext/TinyMCE/tinymce.ext.php\nModule Loadable Package\nWhen building a module loadable package, you can use the $installdefs['tinymce'] index to install the extension file.\nInstalldef Properties\nName\nType\nDescription\nfrom\nString\nThe base path of the file to be installed\nThe example below demonstrates the proper install definition that should be used in the ./manifest.php file, in order to add the UserPage file to the system. You should note that when using this approach Sugar will automatically execute Rebuild Extensions to reflect the changes to TinyMCE in the system.\n./manifest.php\n 'tinyMCE_Example',\n 'tinymce' => array(\n array(\n 'from' => '/Files/custom/Extension/application/Ext/TinyMCE/.php',\n 'to_module' => 'application'\n )\n )\n);\nAlternatively, you may use the $installdefs['copy'] index to copy the file. When using this approach, you may need to manually run repair actions such as a Quick Repair and Rebuild. For more information on the $installdefs['copy'] index and module loadable packages, please refer to the Introduction to the Manifest page.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/TinyMCE/index.html"} {"id": "3735c816782b-0", "text": "EntryPointRegistry\nOverview\nThe EntryPointRegistry extension maps additional entry points\u00c2\u00a0to the system. Please note that\u00c2\u00a0entry points\u00c2\u00a0will soon be deprecated. Developers should move custom logic to endpoints.\u00c2\u00a0For more information, please refer to the Entry Points page.\nProperties\nThe following extension properties are available.\u00c2\u00a0For more information, please refer to the Extension Property documentation.\nProperty\nValue\nExtension Scope\nApplication\nSugar Variable\n$entry_point_registry\nExtension Directory\n./custom/Extension/application/Ext/EntryPointRegistry/\nCompiled Extension File\n./custom/application/Ext/EntryPointRegistry/entry_point_registry.ext.php\nManifest Installdef\n$installdefs['entrypoints']\nImplementation\nThe following sections illustrate the various ways to implement a customization to a Sugar instance.\nFile System\nWhen working directly with the filesystem, you can create a file in ./custom/Extension/application/Ext/EntryPointRegistry/ to map a new entry point in the system. The following example will create a new entry point called exampleEntryPoint that will display the text, \"Hello World\":\n./custom/Extension/application/Ext/EntryPointRegistry/.php\n 'custom/exampleEntryPoint.php',\n 'auth' => true\n);\nNext, create the file that will contain the entry point logic. This file can be located anywhere you choose, but we recommend putting it in the custom directory. More information on custom entry points can be found on the Creating Custom Entry Points page.\n./custom/exampleEntryPoint.php\n Repair > Quick Repair and Rebuild.The system will then rebuild the extensions and compile your customization into\u00c2\u00a0./custom/application/Ext/EntryPointRegistry/entry_point_registry.ext.php\u00c2\u00a0\nModule Loadable Package\nWhen building a module loadable package, you can use the $installdefs['entrypoints'] index to install the extension file.\u00c2\u00a0\nInstalldef Properties\nName\nType\nDescription\nfrom\nString\nThe base path of the file to be installed.\u00c2\u00a0\nThe example below demonstrates the proper install definition that should be used in the ./manifest.php file, in order to add the Entry Point Extension file to the system. You should note that when using this approach, you still need to use the $installdefs['copy'] index for the entry point's logic file, however Sugar will automatically execute Rebuild Extensions\u00c2\u00a0to reflect the new Entry Point in the system.\n./manifest.php\n 'entryPoint_Example',\n 'entrypoints' => array(\n array(\n 'from' => '/Files/custom/Extension/application/Ext/EntryPointRegistry/.php'\n )\n ),\n 'copy' => array(\n array(\n 'from' => '/Files/custom/exampleEntryPoint.php',\n 'to' => 'custom/exampleEntryPoint.php'\n )\n )\n);\nAlternatively, you may use the $installdefs['copy'] index for the Entry Point Extension file. When using this approach, you may need to manually run repair actions such as a Quick Repair and Rebuild.\u00c2\u00a0For more information on the $installdefs['copy'] index and module loadable packages, please refer to the Introduction to the Manifest page.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/EntryPointRegistry/index.html"} {"id": "3735c816782b-2", "text": "Last modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/EntryPointRegistry/index.html"} {"id": "89ada560c2b6-0", "text": "LogicHooks\nOverview\nThe LogicHooks extension adds actions to specific events such as, for example, before saving a bean. For more information on logic hooks in Sugar, please refer to the Logic Hooks\u00c2\u00a0documentation.\nProperties\nThe following extension properties are available.\u00c2\u00a0For more information, please refer to the Extension Property documentation.\nProperty\nValue\nExtension Scope\nAll - Application & Module\nSugar Variable\n$hook_array\nExtension Directory\nApplication - ./custom/Extension/application/Ext/LogicHooks/\nModule -\u00c2\u00a0./custom/Extension/modules//Ext/LogicHooks/\nCompiled Extension File\nApplication - ./custom/application/Ext/LogicHooks/logichooks.ext.php\nModule -\u00c2\u00a0./custom/modules//Ext/LogicHooks/logichooks.ext.php\nManifest Installdef\n$installdefs['hookdefs']\nImplementation\nThe following sections illustrate the various ways to implement a customization to a Sugar instance.\nFile System\nWhen working directly with the filesystem, you can create a file in ./custom/Extension/application/Ext/LogicHooks/ to add a new logic hook to the application. The following example will create a new before_save logic hook that executes for all modules:\n./custom/Extension/application/Ext/LogicHooks/.php\n", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/LogicHooks/index.html"} {"id": "89ada560c2b6-1", "text": "{\n //logic\n }\n }\n?>\nFinally, navigate to Admin > Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and the customizations will be compiled into ./custom/application/Ext/LogicHooks/logichooks.ext.php. Your logic hook will run before saving records in any module.\nModule Loadable Package\nWhen building a module loadable package, you can use the $installdefs['hookdefs'] index to install the extension file.\nInstalldef Properties\nName\nType\nDescription\nfrom\nString\nThe basepath of the file to be installed.\nto_module\nString\nThe key of the module the file is to be installed to.\nThe example below demonstrates the proper install definition that should be used in the ./manifest.php file in order to add the Action View Map file to a specific module. You should note that when using this approach, you still need to use the $installdefs['copy'] index for the hook class file, however Sugar will automatically execute Rebuild Extensions to reflect the new logic hook in the system.\n./manifest.php\n 'actionView_example',\n 'hookdefs' => array(\n array(\n 'from' => '/Files/custom/Extension/application/Ext/LogicHooks/.php',\n 'to_module' => 'application',\n )\n ),\n 'copy' => array(\n array(\n 'from' => '/Files/custom/application_hook.php',\n 'to' => 'custom/application_hook.php',\n ),\n )\n);", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/LogicHooks/index.html"} {"id": "89ada560c2b6-2", "text": "'to' => 'custom/application_hook.php',\n ),\n )\n);\nAlternatively, you may use the $installdefs['copy'] index to copy the file. When using this approach, you may need to manually run repair actions such as a Quick Repair and Rebuild. For more information on the $installdefs['copy'] index and module-loadable packages, please refer to the Introduction to the Manifest page.\nAlternative Installdef\nAlthough not recommended, you could utilize the $installdefs['logic_hooks'] index to deploy a logic hook to the system. Please note that there are a couple caveats to this installation method:\nThe $installdefs['logic_hooks'] index method only works for module-based logic hooks.\nThe $installdefs['logic_hooks'] index method installs to ./custom/modules//logic_hooks.php, which is not part of the Extension framework.\nProperties\nName\nType\nDescription\nmodule\nString\nThe key of the module for the logic hook to be installed to.\nhook\nString\nThe type of logic hook to be installed.\norder\nInteger\nThe number in which the logic hook should run.\ndescription\nString\nA description of the logic hook to be installed.\nfile\nString\nThe file path which contains the logic hook class.\nclass\nString\nThe class which houses the logic hook functionality.\nfunction\nString\nThe function the logic hook will execute.\nThe example below will demonstrate the $installdefs['logic_hooks'] index in the ./manifest.php file, in order to add an after save logic hook to a specific module. You should note that when using this approach, you still need to use the $installdefs['copy'] index for the hook class file.\n./manifest.php\n 'actionView_example',", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/LogicHooks/index.html"} {"id": "89ada560c2b6-3", "text": ");\n$installdefs = array(\n 'id' => 'actionView_example',\n 'logic_hooks' => array(\n array(\n 'module' => '',\n 'hook' => 'after_save',\n 'order' => 1,\n 'description' => 'Example After Save LogicHook',\n 'file' => 'custom/modules//module_hook.php',\n 'class' => 'HookConsumer'\n 'function' => 'after'\n )\n ),\n 'copy' => array(\n array(\n 'from' => '/Files/custom/modules//module_hook.php',\n 'to' => 'custom/modules//module_hook.php',\n ),\n )\n);\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/LogicHooks/index.html"} {"id": "710498b8817c-0", "text": "Sidecar\nOverview\nThe Sidecar extension installs metadata files to their appropriate directories.\nProperties\nThe following extension properties are available.\u00c2\u00a0For more information, please refer to the Extension Property documentation.\nProperty\nValue\nExtension Scope\nModule\nSugar Variable\n$viewdefs\nExtension Directory\n./custom/Extension/modules//Ext/clients////\nCompiled Extension File\n./custom//Ext/clients////.ext.php\nManifest Installdef\n$installdefs['sidecar']\nImplementation\nThe following sections illustrate the various ways to implement a customization to a Sugar instance.\nFile System\nWhen working directly with the filesystem, you can create a file in ./custom/Extension/modules//Ext/clients//// to append the metadata extensions. The example below demonstrates how to add a new subpanel to a specific module:\n./custom/Extension/modules//Ext/clients/base/layouts/subpanels/.php\n']['base']['layout']['subpanels']['components'][] = array(\n 'layout' => 'subpanel',\n 'label' => 'LBL_RELATIONSHIP_TITLE',\n 'context' => array(\n 'link' => '',\n )\n);\nNext, navigate to Admin > Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and compile your customization into ./custom/modules//Ext/clients/base/layouts/subpanels/subpanels.ext.php\nModule Loadable Package\nWhen building a module loadable package, you can use the $installdefs['sidecar'] index to install the metadata file.\nInstalldef Properties\nName\nType\nDescription\nfrom\nString\nThe base path of the file to be installed", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/Sidecar/index.html"} {"id": "710498b8817c-1", "text": "Name\nType\nDescription\nfrom\nString\nThe base path of the file to be installed\nNote:\u00c2\u00a0When adding the file to a module loadable package, its 'from' path must be formatted as clients////.php for Sugar to recognize the installation location.\nto_module\nString\nThe key for the module where the file will be installed\nIf not populated, 'application' is used\nThe example below demonstrates the proper install definition that should be used in the ./manifest.php file in order to add the metadata file to a specific module. When using this approach, Sugar will automatically execute Rebuild Extensions and Metadata Rebuild to reflect your changes in the system.\n./manifest.php\n 'sidecar_example',\n 'sidecar' => array(\n array(\n 'from' => '/Files/custom//clients/base/layouts/subpanels/.php',\n 'to_module' => '',\n ),\n ),\n);\nAlternatively, you may use the $installdefs['copy'] index to copy the file. When using this approach, you may need to manually run repair actions such as a Quick Repair and Rebuild. For more information on the $installdefs['copy'] index and module-loadable packages, please refer to the Introduction to the Manifest page.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/Sidecar/index.html"} {"id": "442b1663ea1d-0", "text": "JSGroupings\nOverview\nThe JSGroupings extension\u00c2\u00a0allows for additional JavaScript grouping files to be created or added to existing groupings within the system.\nJSGroupings are file packages containing one or more minified JavaScript libraries. The groupings enhance system performance by reducing the number of JavaScript files that need to be downloaded for a given page. Some examples of JSGroupings in Sugar are sugar_sidecar.min.js, which contains the Sidecar JavaScript files, and sugar_grp1.js, which contains the base JavaScript files.\nYou can find all of the groups listed in ./jssource/JSGroupings.php. Each group is loaded only when needed by a direct call (e.g., from a TPL file). For example, sugar_grp1.js is loaded for almost all Sugar functions, while sugar_grp_yui_widgets.js will usually be loaded for just record views.\nTo load a JSGroupings file for a custom module, simply add a new JSGrouping and then include the JavaScript file for your custom handlebars template. You can also append to an existing grouping, such as ./include/javascript/sugar_grp7.min.js, to include the code globally.\nProperties\nThe following extension properties are available.\u00c2\u00a0For more information, please refer to the Extension Property documentation.\nProperty\nValue\nExtension Scope\nApplication\nSugar Variable\n$js_groupings\nExtension Directory\n./custom/Extension/application/Ext/JSGroupings/\nCompiled Extension File\n./custom/application/Ext/JSGroupings/jsgroups.ext.php\nManifest Installdef\n$installdefs['jsgroups']\u00c2\u00a0\nImplementation\nThe following sections illustrate the various ways to implement a customization to a Sugar instance.\nFile System\nCreating New JSGroupings", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/JSGroupings/index.html"} {"id": "442b1663ea1d-1", "text": "File System\nCreating New JSGroupings\nWhen working directly with the filesystem, you can create a file in ./custom/Extension/application/Ext/JSGroupings/ to add or append Javascript to JSGroupings in the system. The following example will add a new JSGrouping file to the system:\n./custom/Extension/application/Ext/JSGroupings/.php\n 'include/javascript/newGrouping.js',\n 'custom/file2.js' => 'include/javascript/newGrouping.js',\n);\nNext, create the Javascript files that will be grouped as specified in the JSGrouping definition above:\n./custom/file1.js\nfunction one(){\n //logic\n}\n./custom/file2.js\nfunction two(){\n //logic\n}\nNext, navigate to Admin > Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and compile your customization into ./custom/application/Ext/JSGroupings/jsgroups.ext.php.\nFinally, navigate to Admin > Repair > Rebuild JS Grouping Files. This will create the grouping file in the cache directory as specified:\n./cache/include/javascript/newGrouping.js\nfunction one(){}/* End of File custom/file1.js */function two(){}/* End of File custom/file2.js */\nAppending to Existing JSGroupings\nIn some situations, you may find that you need to append your own JavaScript to a core Sugar JSGrouping. Similarly to creating a new JSGrouping, to append to a core JSGrouping you can create a new PHP file in ./custom/Extension/application/Ext/JSGroupings/. The example below demonstrates how to add the file ./custom/file1.js to ./cache/include/javascript/sugar_grp7.min.js.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/JSGroupings/index.html"} {"id": "442b1663ea1d-2", "text": "./custom/Extension/application/Ext/JSGroupings/.php\n $groupings)\n{\n foreach ($groupings as $file => $target)\n {\n \t//if the target grouping is found\n if ($target == 'include/javascript/sugar_grp7.min.js')\n {\n //append the custom JavaScript file\n $js_groupings[$key]['custom/file1.js'] = 'include/javascript/sugar_grp7.min.js';\n }\n break;\n }\n}\nNext, navigate to Admin > Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and compile your customization into ./custom/application/Ext/JSGroupings/jsgroups.ext.php.\nModule Loadable Package\nWhen building a module loadable package, you can use the $installdefs['jsgroups'] index to install the extension file.\nInstalldef Properties\nName\nType\nDescription\nfrom\nString\nThe basepath of the file to be installed\nto_module\nString\nThe key for the module where the file will be installed\nThe example below demonstrates the proper install definition that should be used in the ./manifest.php file to add the JSGrouping Extension file to the system. When using this approach, you still need to use the $installdefs['copy'] index for the custom JavaScript files you are adding to JSGroupings. Sugar will automatically execute Rebuild Extensions to reflect the new JSGrouping, however, you will still need to navigate to Admin > Repair > Rebuild JS Grouping Files, to create the grouping file in the cache directory.\n./manifest.php\n 'jsGroupings_Example',\n 'jsgroups' => array(\n array(\n 'from' => '/Files/custom/Extension/application/Ext/JSGroupings/.php',\n 'to_module' => 'application',\n )\n ),\n 'copy' => array(\n array(\n 'from' => '/Files/custom/file1.js',\n 'to' => 'custom/file1.js'\n ),\n array( \n 'from' => '/Files/custom/file2.js',\n 'to' => 'custom/file2.js' \n )\n )\n);\nAlternatively, you may use the\u00c2\u00a0$installdefs['copy']\u00c2\u00a0index for the JSGrouping Extension file. When using this approach, you may need to manually run repair actions such as a Quick Repair and Rebuild. For more information\u00c2\u00a0on the\u00c2\u00a0$installdefs['copy']\u00c2\u00a0index and module-loadable packages, please refer to the\u00c2\u00a0Introduction to the Manifest\u00c2\u00a0page.\nConsiderations\nThe grouping path you specify will be created in the cache directory.\nIf you wish to add a grouping that contains a file that is part of another group already, add a '.' after .js to make the element key unique.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/JSGroupings/index.html"} {"id": "baf64b63b48f-0", "text": "Include\nOverview\nThe Modules extension maps additional modules in the system, typically when Module Builder deploys a module.\nProperties\nThe following extension properties are available.\u00c2\u00a0For more information, please refer to the Extension Property documentation.\nProperty\nValue\nExtension Scope\nApplication\nSugar Variable\n$beanList, $beanFiles, $moduleList\nExtension Directory\n./custom/Extension/application/Ext/Include/\nCompiled Extension File\n./custom/application/Ext/Include/modules.ext.php\nManifest Installdef\n$installdefs['beans']\nImplementation\nThe following sections illustrate the various ways to implement a customization to a Sugar instance.\nFile System\nWhen working directly with the filesystem, you can create a file in ./custom/Extension/application/Ext/Include/ to register a new module in the system. This extension is normally used when deploying custom modules. The example below shows what this file will look like after a module is deployed:\n./custom/Extension/application/Ext/Include/.php\n Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and compile your customization into ./custom/application/Ext/Include/modules.ext.php.\nModule Loadable Package\nWhen building a module loadable package, you can use the $installdefs['beans'] index to install the extension file.\nInstalldef Properties\nName\nType\nDescription\nmodule\nString\nThe key of the module to be installed\nclass\nString\nThe class name of the module to be installed\npath\nString\nThe path to the module's class\ntab\nBoolean\nWhether or not the module will have a navigation tab (defaults to false)", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/Include/index.html"} {"id": "baf64b63b48f-1", "text": "tab\nBoolean\nWhether or not the module will have a navigation tab (defaults to false)\nThe example below demonstrates the proper install definition that should be used in the ./manifest.php file, in order to add a custom module to the system. When using this approach, you still need to use the $installdefs['copy'] index for Module directory, however, Sugar will automatically execute the database table creation process, relationship table creation process, as well as Rebuild Extensions to reflect the new Module in the system.\n./manifest.php\n 'Beans_Example',\n 'beans' => array(\n array(\n 'module' => 'cust_Module',\n 'class' => 'cust_Module',\n 'path' => 'modules/cust_Module/cust_Module.php',\n 'tab' => true\n )\n ),\n 'copy' => array(\n array(\n 'from' => '/Files/modules/cust_Module',\n 'to' => 'modules/cust_Module'\n )\n )\n);\nAlternatively, you may use the\u00c2\u00a0$installdefs['copy']\u00c2\u00a0index for copying the Modules definition file into the ./custom/Extension/application/Ext/Include/\u00c2\u00a0directory. When using this approach, you may need to manually run repair actions such as a Quick Repair and Rebuild. For more information\u00c2\u00a0on the\u00c2\u00a0$installdefs['copy']\u00c2\u00a0index and module loadable packages, please refer to the\u00c2\u00a0Introduction to the Manifest\u00c2\u00a0page.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/Include/index.html"} {"id": "226537683493-0", "text": "This page refers to content that is only available in modules running in backward compatibility mode.\nWirelessModuleRegistry\nOverview\nThe WirelessModuleRegistry extension adds modules to the available modules for mobile.\nProperties\nThe following extension properties are available.\u00c2\u00a0For more information, please refer to the Extension Property documentation.\nProperty\nValue\nExtension Scope\nApplication\nSugar Variable\n$wireless_module_registry\nExtension Directory\n./custom/Extension/application/Ext/WirelessModuleRegistry/\nCompiled Extension File\n./custom/application/Ext/WirelessModuleRegistry/wireless_module_registry.ext.php\nManifest Installdef\n$installdefs['wireless_modules']\nImplementation\nThe following sections illustrate the various ways to implement a customization to a Sugar instance.\nFile System\nWhen working directly with the filesystem, you can create a file in ./custom/Extension/application/Ext/WirelessModuleRegistry/ to add modules to the list of available modules for mobile. The following example will add a new module, 'cust_module', to the list of available modules for mobile:\n./custom/Extension/application/Ext/WirelessModuleRegistry/.php\n false, \n);\nNext, navigate to Admin > Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and compile your customization into ./custom/application/Ext/WirelessModuleRegistry/wireless_module_registry.ext.php.\nModule Loadable Package\nWhen building a module loadable package, you can use the $installdefs['wireless_modules'] index to install the extension file.\nInstalldef Properties\nName\nType\nDescription\nfrom\nString\nThe base path of the file to be installed.\nto_module\nString\nThe key of the module the file is to be installed to.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/WirelessModuleRegistry/index.html"} {"id": "226537683493-1", "text": "to_module\nString\nThe key of the module the file is to be installed to.\nThe example below demonstrates the proper install definition that should be used in the ./manifest.php file in order to add the Wireless Module Registry file to the system. You should note that when using this approach, Sugar will automatically execute Rebuild Extensions to reflect the new module in the mobile application.\n./manifest.php\n 'wirelessModules_Example',\n 'wireless_modules' => array(\n array(\n 'from' => '/Files/custom/Extension/application/Ext/WirelessModuleRegistry/.php',\n 'to_module' => 'application',\n )\n )\n);\nAlternatively, you may use the $installdefs['copy'] index to copy the file. When using this approach, you may need to manually run repair actions such as a Quick Repair and Rebuild. For more information on the $installdefs['copy'] index and module-loadable packages, please refer to the Introduction to the Manifest page.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/WirelessModuleRegistry/index.html"} {"id": "626f6f5eec3c-0", "text": "Extensions\nOverview\nThis extension\u00c2\u00a0allows for developers to create custom extensions within the framework. Custom extensions are used alongside the extensions found in ./ModuleInstaller/extensions.php.\nProperties\nThe following extension properties are available.\u00c2\u00a0For more information, please refer to the Extension Property documentation.\nProperty\nValue\nExtension Scope\nApplication\nSugar Variable\n$extensions\nExtension Directory\n./custom/Extension/application/Ext/Extensions/\nCompiled Extension File\n./custom/application/Ext/Extensions/extensions.ext.php\nManifest Installdef\n$installdefs['extensions']\nParameters\nsection : Section name in the manifest file\nextdir : The directory containing the extension files\nfile : The name of the file where extension files are compiled into\nmodule : Determines how the framework will interpret the extension (optional)\n : Will enable the extension for all modules\nExt\u00c2\u00a0: ./custom/Extension/modules//Ext//\nExt File : ./custom/modules//Ext/.ext.php\n : Will enable the extension for the specified module\nExt Directory : ./custom/Extension/modules//Ext//\nExt File : ./custom/modules//Ext/.ext.php\nApplication : enables the extension for application only\nExt Directory : ./custom/Extension/application/Ext//\nExt File : ./custom/application/Ext//.ext.php\nImplementation\nThe following sections illustrate the various ways to implement a customization to a Sugar instance.\nFile System\nWhen working directly with the filesystem, you can create a file in ./custom/Extension/application/Ext/Extensions/ to map a new extension in the system. The following example will create a new extension called \"example\", which is only enabled for \"application\":\n./custom/Extension/application/Ext/Extensions/.php\n.php\n 'example',\n 'extdir' => 'Example',\n 'file' => 'example.ext.php',\n 'module' => 'application' //optional paramater\n);\nNext, navigate to Admin > Repair > Quick Repair and Rebuild. The system will rebuild the extensions and compile your customization into ./custom/application/Ext/Extensions/extensions.ext.php. Then you will be able to add your own extension files in \u00c2\u00a0./custom/Extension/application/Ext/Example/.\nModule Loadable Package\nWhen building a module loadable package, you can use the $installdefs['extensions'] index to install the extension file.\nInstalldef Properties\nName\nType\nDescription\nfrom\nString\nThe base path of the file to be installed\nThe example below will demonstrate the proper install definition that should be used in the ./manifest.php file in order to add the Extension file to the system. You should note that when using this approach, Sugar will automatically execute Rebuild Extensions to reflect the new Extension in the system.\n./manifest.php\n 'customExtension_Example',\n 'extensions' => array(\n array(\n 'from' => '/Files/custom/Extension/application/Ext/Extensions/.php'\n )\n )\n);", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/Extension/index.html"} {"id": "626f6f5eec3c-2", "text": ")\n )\n);\nAlternatively, you may use the\u00c2\u00a0$installdefs['copy']\u00c2\u00a0index for the Extension file. When using this approach, you may need to manually run repair actions such as a Quick Repair and Rebuild. For more information\u00c2\u00a0on the\u00c2\u00a0$installdefs['copy']\u00c2\u00a0index and module-loadable packages, please refer to the\u00c2\u00a0Introduction to the Manifest\u00c2\u00a0page.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/Extension/index.html"} {"id": "6525ee727055-0", "text": "UserPage\nOverview\nThe UserPage extension adds sections to the User Management view.\nProperties\nThe following extension properties are available.\u00c2\u00a0For more information, please refer to the Extension Property documentation.\nProperty\nValue\nExtension Scope\nModule: Users\nExtension Directory\n./custom/Extension/modules/Users/Ext/UserPage/\nCompiled Extension File\n./custom/Users/Ext/UserPage/userpage.ext.php\nManifest Installdef\n$installdefs['user_page']\nImplementation\nThe following sections illustrate the various ways to implement a customization to a Sugar instance.\nFile System\nWhen working directly with the filesystem, you can create a file in ./custom/Extension/modules/Users/Ext/UserPage/ to add custom elements to the User page. The following example will add a custom table to the Users module's detail view:\n./custom/Extension/modules/Users/Ext/UserPage/.php\n\n \n \n \n Header\n \n \n \n \n Content\n \n \n \n \nHTML;\n echo $HTML;\nNavigate to Admin > Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and compile your customization into ./custom/modules/Users/Ext/UserPage/userpage.ext.php\nModule Loadable Package\nWhen building a module loadable package, you can use the $installdefs['user_page'] index to install the extension file.\nInstalldef Properties\nName\nType\nDescription", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/UserPage/index.html"} {"id": "6525ee727055-1", "text": "Installdef Properties\nName\nType\nDescription\nfrom\nString\nThe base path of the file to be installed\nThe example below demonstrates the proper install definition that should be used in the ./manifest.php file in order to add the UserPage file to the system. When using this approach, Sugar will automatically execute Rebuild Extensions to reflect the changes to the User view in the system.\n./manifest.php\n 'userPage_Example',\n 'user_page' => array(\n array(\n 'from' => '/Files/custom/Extension/modules/Users/Ext/UserPage/.php',\n )\n )\n);\nAlternatively, you may use the $installdefs['copy'] index to copy the file. When using this approach, you may need to manually run repair actions such as a Quick Repair and Rebuild. For more information on the $installdefs['copy'] index and module-loadable packages, please refer to the Introduction to the Manifest page.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/UserPage/index.html"} {"id": "9c4b668082b0-0", "text": "Vardefs\nOverview\nThe Vardefs extension adds or overrides system vardefs, which provide the Sugar application with information about SugarBeans.\nFor more information on vardefs in Sugar, please refer to the Vardefs documentation .\nProperties\nThe following extension properties are available.\u00c2\u00a0For more information, please refer to the Extension Property documentation.\nProperty\nValue\nExtension Scope\nModule\nSugar Variable\n$dictionary\nExtension Directory\n./custom/Extension/modules//Ext/Vardefs/\nCompiled Extension File\n./custom//Ext/Vardefs/vardefs.ext.php\nManifest Installdef\n$installdefs['vardefs']\nImplementation\nThe following sections illustrate the various ways to implement a customization to a Sugar instance.\nFile System\nWhen working directly with the filesystem, you can create a file in ./custom/Extension/modules//Ext/Vardefs/ to edit or add vardefs to a module in the system.\nThe most common use of the Vardef extension is to alter the attributes of an existing vardef. To do this,avoid redefining the entire vardef and instead update the specific index you want to change. The following example updates the Required property on the Name field in a module:\n./custom/Extension/modules//Ext/Vardefs/.php\n$dictionary['']['fields']['name']['required'] = false;\nNext, navigate to Admin > Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and your customizations will be compiled into ./custom/modules//Ext/Vardefs/vardefs.ext.php .\nNotice\u00c2\u00a0 Never specify vardefs for a module under another module's extension path. For example, do not specify $dictionary['Accounts']['fields']['name']['required'] = false under ./custom/Extension/modules/Contacts/Ext/Vardefs/. Doing so will result in unexpected behavior within the system.\nModule Loadable Package", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/Vardefs/index.html"} {"id": "9c4b668082b0-1", "text": "Module Loadable Package\nWhen building a module loadable package, you can use the $installdefs['vardefs'] index to install the extension file.\nInstalldef Properties\nName\nType\nDescription\nfrom\nString\nThe base path of the file to be installed\nto_module\nString\nThe key for the module where the file will be installed\nThe example below demonstrates the proper install definition that should be used in the ./manifest.php file in order to add the Vardefs file to a specific module. You should note that when using this approach Sugar will automatically execute Rebuild Extensions to reflect the vardef changes in the system.\n./manifest.php\n 'vardefs_Example',\n 'vardefs' => array(\n array(\n 'from' => '/Files/custom/Extension/modules//Ext/Vardefs/.php',\n 'to_module' => '',\n )\n )\n);\nAlternatively, you may use the $installdefs['copy'] index to copy the file. When using this approach, you may need to manually run repair actions such as a Quick Repair and Rebuild. For more information on the $installdefs['copy'] index and module-loadable packages, please refer to the Introduction to the Manifest page.\nCreating Custom Fields\nIf your goal is to manually create a custom field on an instance, you should be using the Module Installer to create the field. This can be used both for an installer package and programmatically. An example of creating a field from a module loadable package can be found under Package Examples in the article, Creating an Installable Package that Creates New Fields. An example of programmatically creating a field can be found in the Manually Creating Custom Fields section of the Module Vardefs documentation.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/Vardefs/index.html"} {"id": "9c4b668082b0-2", "text": "Last modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/Vardefs/index.html"} {"id": "1950f71917b3-0", "text": "ScheduledTasks\nOverview\nThe ScheduledTasks extension adds custom functions that can be used by scheduler jobs. For more information about schedulers in Sugar, please refer to the Schedulers documentation.\nProperties\nThe following extension properties are available.\u00c2\u00a0For more information, please refer to the Extension Property documentation.\nProperty\nValue\nExtension Scope\nModule: Schedulers\nSugar Variable\n$job_strings\nExtension Directory\n./custom/Extension/modules/Schedulers/Ext/ScheduledTasks/\nCompiled Extension File\n./custom/Schedulers/Ext/ScheduledTasks/scheduledtasks.ext.php\nManifest Installdef\n$installdefs['scheduledefs']\nImplementation\nThe following sections illustrate\u00c2\u00a0the various ways to implement a customization to a Sugar instance.\nFile System\nWhen working directly with the filesystem, you can create a file in ./custom/Extension/modules/Schedulers/Ext/ScheduledTasks/ to add a new Scheduler Task to the system. The following example will create a new Scheduler Task 'example_job':\n./custom/Extension/modules/Schedulers/Ext/ScheduledTasks/.php\n Schedulers:\n./custom/Extension/modules/Schedulers/Ext/Language/..php\n Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and the customizations will be compiled into ./custom/modules/Schedulers/Ext/ScheduledTasks/scheduledtasks.ext.php\nModule Loadable Package", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/ScheduledTasks/index.html"} {"id": "1950f71917b3-1", "text": "Module Loadable Package\nWhen building a module loadable package, you can use the $installdefs['scheduledefs'] index to install the extension file.\nInstalldef Properties\nName\nType\nDescription\nfrom\nString\nThe basepath of the file to be installed\nThe example below demonstrates the proper install definition that should be used in the ./manifest.php file in order to add the custom Scheduler definition file to the system. When using this approach, Sugar will automatically execute Rebuild Extensions to reflect the new Scheduler in the system.\n./manifest.php\n 'actionView_example',\n 'scheduledefs' => array(\n array(\n 'from' => '/Files/custom/Extension/modules/Scheduler/Ext/ScheduledTasks/.php',\n )\n ),\n 'language' => array(\n array(\n 'from' =>'/Files/custom/Extension/modules/Schedulers/Ext/Language/.php',\n 'to_module' => 'Schedulers',\n 'language' => 'en_us'\n )\n )\n);\nAlternatively, you may use the $installdefs['copy'] index to copy the file. When using this approach, you may need to manually run repair actions such as a Quick Repair and Rebuild. For more information on the $installdefs['copy'] index and module-loadable packages, please refer to the Introduction to the Manifest page.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/ScheduledTasks/index.html"} {"id": "10310a56fe2c-0", "text": "Dependencies\nOverview\nDependencies create dependent actions for fields and forms that can leverage more complicated logic.\nProperties\nThe following extension properties are available.\u00c2\u00a0For more information, please refer to the Extension Property documentation.\nProperty\nValue\nExtension Scope\nModule\nSugar Variable\n$dependencies\nExtension Directory\n./custom/Extension/modules//Ext/Dependencies/\nCompiled Extension File\n./custom/modules//Ext/Dependencies/deps.ext.php\nManifest Installdef\n$installdefs['dependencies']\nImplementation\nThe following sections illustrate the various ways to implement a customization to a Sugar instance.\nFile System\nWhen working directly with the filesystem, you can create a file in ./custom/Extension/modules//Ext/Dependencies/.php to map a new dependency in the system. The following example will create a new required field dependency on a module that is evaluated upon editing a record:\n./custom/Extension/modules//Ext/Dependencies/.php\n'][''] = array(\n 'hooks' => array(\"edit\"),\n //Trigger formula for the dependency. Defaults to 'true'.\n 'trigger' => 'true',\n 'triggerFields' => array(''),\n 'onload' => true,\n //Actions is a list of actions to fire when the trigger is true\n 'actions' => array(\n array(\n 'name' => 'SetRequired', //Action type\n //The parameters passed in depend on the action type\n 'params' => array(\n 'target' => '',\n 'label' => '', //normally _label\n 'value' => 'equal($, \"Closed\")', //Formula\n ),\n ),\n ),\n);", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/Dependencies/index.html"} {"id": "10310a56fe2c-1", "text": "),\n ),\n ),\n);\nNext, navigate to Admin > Repair > Quick Repair and Rebuild. The system will then rebuild the extensions, compiling your customization into./custom/modules//Ext/Dependencies/deps.ext.php, and the dependency will be in place.\nModule Loadable Package\nWhen building a module loadable package, you can use the $installdefs['dependencies'] index to install the extension file.\nInstalldef Properties\nName\nType\nDescription\nfrom\nString\nThe base path of the file\nto_module\nString\nThe key for the module where the file will be installed\nThe example below demonstrates the proper install definition that should be used in the ./manifest.php file in order to add the Dependency file to a specific module. You should note that when using this approach, Sugar will automatically execute Rebuild Extensions to reflect the new Dependency in the system.\n./manifest.php\n 'dependency_example',\n 'dependencies' => array(\n array(\n 'from' => '/Files/custom/Extension/modules//Ext/Dependencies/.php',\n 'to_module' => '',\n )\n )\n);\nAlternatively, you may use the $installdefs['copy'] index for the Dependency Extension file. When using this approach, you may need to manually run a repair action such as a Quick Repair and Rebuild.\nFor more information on the $installdefs['copy'] index and module-loadable packages, please refer to the Introduction to the Manifest\u00c2\u00a0page.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/Dependencies/index.html"} {"id": "00cb7fd0fcfc-0", "text": "This page refers to content that is only available in modules running in backward compatibility mode.\nActionViewMap\nOverview\nThe ActionViewMap extension maps additional actions for a module.\nNote: Actions that apply to modules running in backward compatibility mode\u00c2\u00a0are mapped in ./custom/modules//controller.php.\nProperties\nThe following extension properties are available.\u00c2\u00a0For more information, please refer to the Extension Property documentation.\nProperty\nValue\nExtension Scope\nModule\nSugar Variable\n$action_view_map\nExtension Directory\n./custom/Extension/modules//Ext/ActionViewMap/\nCompiled Extension File\n./custom//Ext/ActionViewMap/action_view_map.ext.php\nManifest Installdef\n$installdefs['action_view_map']\nImplementation\nThe following sections illustrate\u00c2\u00a0the various ways to implement a customization to a Sugar instance.\nFile System\nWhen working directly with the filesystem, you can create a file in ./custom/Extension/modules//Ext/ActionViewMap/ to map a new view in the system. The following example will map a new action called 'example' to the 'example' view:\n./custom/Extension/modules//Ext/ActionViewMap/.php\n/views/view.example.php\nViewExample extends ViewDetail\n{\n function ViewExample()\n {\n parent::ViewDetail();\n }\n function display()\n {\n echo 'Example View';\n }\n}\n?>", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/ActionViewMap/index.html"} {"id": "00cb7fd0fcfc-1", "text": "{\n echo 'Example View';\n }\n}\n?>\nNext, navigate to Admin > Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and compile your customization into ./custom/modules//Ext/ActionViewMap/action_view_map.ext.php.\nModule Loadable Package\nWhen building a module-loadable package, use the $installdefs['action_view_map'] index to install the extension file.\nInstalldef Properties\nName\nType\nDescription\nfrom\nString\nThe basepath of the file\nto_module\nString\nThe key for the module where the file will be installed\nThe example below demonstrates the proper install definition for\u00c2\u00a0the ./manifest.php file in order to add the Action View Map file to a specific module. You should note that when using this approach, you still need to use the $installdefs['copy'] index for the View file, however, Sugar will automatically execute Rebuild Extensions to reflect the new Action View in the system.\n./manifest.php\n 'actionView_example',\n 'action_view_map' => array(\n array(\n 'from' => '/Files/custom/Extension/modules//Ext/ActionViewMap/.php',\n 'to_module' => '',\n )\n ),\n 'copy' => array(\n array(\n 'from' => '/Files/custom/modules//views/view.example.php',\n 'to' => 'custom/modules//views/view.example.php',\n ),\n )\n);", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/ActionViewMap/index.html"} {"id": "00cb7fd0fcfc-2", "text": "),\n )\n);\nAlternatively, you may use the $installdefs['copy'] index for the Action View Map Extension file. When using this approach, you may need to manually run repair actions such as a Quick Repair and Rebuild.\nFor more information on\u00c2\u00a0module-loadable packages, please refer to the Introduction to the Manifest\u00c2\u00a0page\u00c2\u00a0.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/ActionViewMap/index.html"} {"id": "7789ee94fa4a-0", "text": "Application Schedulers\nOverview\nApplication Scheduler extensions add custom functions that can be used by scheduler jobs.\nNote: This Extension is a duplicate of the ScheduledTasks extension, which typically places Scheduled Tasks in the Schedulers directory.\nProperties\nThe following extension properties are available.\u00c2\u00a0For more information, please refer to the Extension Property documentation.\nProperty\nValue\nExtension Scope\nApplication\nSugar Variable\n$job_strings\nExtension Directory\n./custom/Extension/application/Ext/ScheduledTasks/\nCompiled Extension File\n./custom/application/Ext/ScheduledTasks/scheduledtasks.ext.php\nManifest Installdef\n$installdefs['appscheduledefs']\nImplementation\nThe following sections illustrates the various ways to implement a customization to a Sugar instance.\nFile System\nWhen working directly with the filesystem, you can create a file in ./custom/Extension/application/Ext/ScheduledTasks/ to add a new Scheduler Task to the system. The following example will create a new Scheduler Task 'example_job':\n./custom/Extension/application/Ext/ScheduledTasks/.php\n Schedulers section:\n./custom/Extension/modules/Schedulers/Ext/Language/..php\n Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and the customizations will be compiled into ./custom/application/Ext/ScheduledTasks/scheduledtasks.ext.php\nModule Loadable Package", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/Application_Schedulers/index.html"} {"id": "7789ee94fa4a-1", "text": "Module Loadable Package\nWhen building a module loadable package, you can use the $installdefs['appscheduledefs'] index to install the extension file.\nInstalldef Properties\nName\nType\nDescription\nfrom\nString\nThe base path of the file to be installed.\nThe example below demonstrates the proper install definition that should be used in the ./manifest.php file in order to add the custom Scheduler definition file to the system. You should note that, when using this approach, Sugar will automatically execute Rebuild Extensions to reflect the new scheduler in the system.\n./manifest.php\n 'appScheduledTasks_example',\n 'appscheduledefs' => array(\n array(\n 'from' => '/Files/custom/Extension/application/Ext/ScheduledTasks/.php',\n )\n ),\n 'language' => array(\n array(\n 'from' =>'/Files/custom/Extension/modules/Schedulers/Ext/Language/.php',\n 'to_module' => 'Schedulers',\n 'language' => 'en_us'\n )\n )\n);\nAlternatively, you may use the $installdefs['copy'] index for the Scheduled Task Extension file. When using this approach, you may need to manually run a repair action such as a Quick Repair and Rebuild.\nFor more information about the $installdefs['copy'] index and module-loadable packages, please refer to the Introduction to the Manifest page.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/Application_Schedulers/index.html"} {"id": "a5a86354da8d-0", "text": "This page refers to content that is only available in modules running in backward compatibility mode.\nActionReMap\nOverview\nThe ActionReMap extension maps new actions to existing actions. This extension is only applicable to modules running in backward compatibility mode.\nProperties\nThe following extension properties are available.\u00c2\u00a0For more information, please refer to the Extension Property documentation.\nProperty\nValue\nExtension Scope\nModule\nSugar Variable\n$action_remap\nExtension Directory\n./custom/Extension/modules//Ext/ActionReMap/\nCompiled Extension File\n./custom//Ext/ActionReMap/action_remap.ext.php\nManifest Installdef\n$installdefs['action_remap']\nImplementation\nThe following sections illustrate\u00c2\u00a0the various ways to implement a customization to a Sugar instance.\nFile System\nWhen working directly with the file system, you can create a file in \u00c2\u00a0./custom/Extension/modules//Ext/ActionReMap/ to map an action to another defined action. The following example will map the action 'example' to 'detailview':\n./custom/Extension/modules//Ext/ActionReMap/.php\n Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and compile your customization into\u00c2\u00a0./custom/modules//Ext/ActionReMap/action_remap.ext.php.\nModule Loadable Package\nWhen building a module loadable package, you can use the $installdefs['action_remap'] index to install the extension file.\u00c2\u00a0\nInstalldef Properties\nName\nType\nDescription\nfrom\nString\nThe basepath of the file to be installed\nto_module\nString\nThe key for the module where the file will be installed", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/ActionReMap/index.html"} {"id": "a5a86354da8d-1", "text": "to_module\nString\nThe key for the module where the file will be installed\nThe example below demonstrates the proper install definition that should be used in the ./manifest.php file in order to add the Action Remap file to a specific module. You should note that when using this approach, Sugar will automatically execute Rebuild Extensions\u00c2\u00a0to reflect your changes in the system.\n./manifest.php\n 'ActionRemap_Example',\n 'action_remap' => array(\n array(\n 'from' => '/Files/custom/Extension/modules//Ext/ActionReMap/.php',\n 'to_module' => '',\n )\n )\n);\nAlternatively, you may use the\u00c2\u00a0$installdefs['copy']\u00c2\u00a0index. When using this approach, you may need to manually run repair actions such as a Quick Repair and Rebuild. For more information\u00c2\u00a0on the\u00c2\u00a0$installdefs['copy']\u00c2\u00a0index and module-loadable packages, please refer to the\u00c2\u00a0Introduction to the Manifest\u00c2\u00a0page.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/ActionReMap/index.html"} {"id": "1211901a17af-0", "text": "Platforms\nOverview\nThe Platforms extension adds allowed REST API platforms when restricting custom platforms through the use of the disable_unknown_platforms\u00c2\u00a0configuration setting.\nProperties\nThe following extension properties are available.\u00c2\u00a0For more information, please refer to the Extension Property documentation.\nProperty\nValue\nExtension Scope\nApplication\nExtension Directory\n./custom/Extension/application/Ext/Platforms/\nCompiled Extension File\n./custom/application/Ext/Platforms/platforms.ext.php\nManifest Installdef\n$installdefs['platforms']\nImplementation\nThe following sections illustrate the various ways to implement a new platform type\u00c2\u00a0to a Sugar instance.\nFile System\nWhen working directly with the filesystem, enable the\u00c2\u00a0disable_unknown_platforms\u00c2\u00a0configuration by setting $sugar_config['disable_unknown_platforms'] = true\u00c2\u00a0in your\u00c2\u00a0./config_override.php.\u00c2\u00a0This will prevent the\u00c2\u00a0system\u00c2\u00a0from allowing unknown\u00c2\u00a0platform\u00c2\u00a0types from accessing\u00c2\u00a0the rest endpoints. Next,\u00c2\u00a0create a file in ./custom/Extension/application/Ext/Platforms/ to map a new platform\u00c2\u00a0in the system. The following example adds a new platform called 'integration' that can be used throughout the system:\n./custom/Extension/application/Ext/Platforms/.php\n Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and your customizations will be compiled into ./custom/application/Ext/Platforms/platforms.ext.php.\nAlternatively, platforms\u00c2\u00a0can also be added by creating ./custom/clients/platforms.php\u00c2\u00a0and\u00c2\u00a0appending new platform types to\u00c2\u00a0the\u00c2\u00a0$platforms variable. This method of creating platforms\u00c2\u00a0is still compatible but is not recommended from a best practices standpoint.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/Platforms/index.html"} {"id": "1211901a17af-1", "text": "Once installed, developers can\u00c2\u00a0take advantage of the new platform type when authenticating\u00c2\u00a0with the REST API\u00c2\u00a0oauth2/token endpoint. An example is shown below:\u00c2\u00a0\n{\n \"grant_type\": \"password\",\n \"username\": \"admin\",\n \"password\": \"password\",\n \"client_id\": \"sugar\",\n \"client_secret\": \"\",\n \"platform\": \"integration\"\n}\nModule Loadable Package\nWhen building a module loadable package, you can use the $installdefs['platforms'] index to install the extension file.\nInstalldef Properties\nName\nType\nDescription\nfrom\nString\nThe base path of the file to be installed\nThe example below demonstrates the proper install definition that should be used in the ./manifest.php file in order to add the utils to the system. You should note that when using this approach, Sugar will automatically execute Rebuild Extensions to reflect the new utils in the system.\n./manifest.php\n 'Platforms_Example',\n 'platforms' => array(\n array(\n 'from' => '/Files/custom/Extension/application/Ext/Platforms/.php',\n )\n )\n);\nAlternatively, you may use the $installdefs['copy'] index to copy the file. When using this approach, you may need to manually run repair actions such as a Quick Repair and Rebuild. For more information on the $installdefs['copy'] index and module-loadable packages, please refer to the Introduction to the Manifest page.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/Platforms/index.html"} {"id": "a7af75e6fb52-0", "text": "This page refers to content that is only available in modules running in backward compatibility mode.\nFileAccessControlMap\nOverview\nThe FileAccessControlMap extension restricts specific view actions from users of the system.\nNote: This is only applicable to modules running in backward compatibility mode.\nProperties\nThe following extension properties are available.\u00c2\u00a0For more information, please refer to the Extension Property documentation.\nProperty\nValue\nExtension Scope\nModule\nSugar Variable\n$file_access_control_map\nExtension Directory\n./custom/Extension/modules//Ext/FileAccessControlMap/\nCompiled Extension File\n./custom/modules//Ext/FileAccessControlMap/file_access_control_map.ext.php\nManifest Installdef\n$installdefs['file_access']\nImplementation\nThe following sections illustrate the various ways to implement a customization to a Sugar instance.\nFile System\nWhen working directly with the filesystem, you can create a file in ./custom/Extension/modules//Ext/FileAccessControlMap/ to restrict a view of a module. The following example will create a new restriction for the detail view:\n./custom/Extension/modules//Ext/FileAccessControlMap/.php\n']['actions'] = array(\n 'detailview',\n);\nNavigate to Admin > Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and compile your customization into ./custom/modules//Ext/FileAccessControlMap/file_access_control_map.ext.php\nModule Loadable Package\nWhen building a module loadable package, you can use the $installdefs['file_access'] index to install the extension file.\nInstalldef Properties\nName\nType\nDescription\nfrom\nString\nThe base path of the file to be installed\nto_module\nString\nThe key of the module the file is to be installed to", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/FileAccessControlMap/index.html"} {"id": "a7af75e6fb52-1", "text": "to_module\nString\nThe key of the module the file is to be installed to\nThe example below\u00c2\u00a0demonstrates the proper install definition that should be used in the ./manifest.php file, in order to add the File Access Control Map file to a specific module. You should note that when using this approach, Sugar will automatically execute Rebuild Extensions to reflect the new Action in the system.\n./manifest.php\n 'ActionRemap_Example',\n 'file_access' => array(\n array(\n 'from' => '/Files/custom/Extension/modules//Ext/FileAccessControlMap/.php',\n 'to_module' => '',\n )\n )\n);\nAlternatively, you may use the\u00c2\u00a0$installdefs['copy']\u00c2\u00a0index for the File Access Control Map Extension file. When using this approach, you may need to manually run repair actions such as a Quick Repair and Rebuild. For more information\u00c2\u00a0on the\u00c2\u00a0$installdefs['copy']\u00c2\u00a0index and module-loadable packages, please refer to the\u00c2\u00a0Introduction to the Manifest\u00c2\u00a0page.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Extensions/FileAccessControlMap/index.html"} {"id": "2b85f83e0869-0", "text": "Themes\nOverview\nHow to customize the\u00c2\u00a0Sugar theme.\u00c2\u00a0\nTheme Variables\nSugar's theme\u00c2\u00a0variables, defined in\u00c2\u00a0./styleguide/themes/clients/base/default/variables.php,\u00c2\u00a0determine the\u00c2\u00a0color of the primary action\u00c2\u00a0buttons, links,\u00c2\u00a0and\u00c2\u00a0header navigation. An example of the definition is shown below:\n./styleguide/themes/clients/base/default/variables.php\n$lessdefs = array(\n 'colors' => array(\n /**\n * Secondary Color:\n * color of the navbar\n * -------------------------\n * was @secondary\n */\n 'NavigationBar' => '#fff',\n /**\n * Primary Button Color:\n * color of the primary button\n * -------------------------\n * was @primaryBtn\n */\n 'PrimaryButton' => '#0679c8',\n ),\n);\nVariable Descriptions\nIt is important to understand what the purpuse and utility of each variable is before you apply in your code, below is an in-depth description:\n@NavigationBar\nUsed to customize the mega menu background colour\u00c2\u00a0\nDefaults to Sugar's @white\u00c2\u00a0(#ffffff)\u00c2\u00a0\nNote: This variable is only supported in light mode\n@PrimaryButton\nUsed to customize the background colour for primary buttons\u00c2\u00a0(elements using `btn\u00c2\u00a0btn-primary`)\u00c2\u00a0\nDefaults to Sugar's @blue (#0679c8)\u00c2\u00a0\n@LinkColor \u00c2\u00a0\nUsed to customize the text color of link (anchor) elements\u00c2\u00a0\nDefaults to Sugar's @blue (#0679c8)\u00c2\u00a0\nNote: This variable is only supported in light mode\nCustom Themes", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Themes/index.html"} {"id": "2b85f83e0869-1", "text": "Note: This variable is only supported in light mode\nCustom Themes\nModifications to\u00c2\u00a0the\u00c2\u00a0theme can be made by creating\u00c2\u00a0./custom/themes/clients/base/default/variables.php. Within this file, you can define the custom hex codes for the colors you would like to use. You should note that this is limited to the\u00c2\u00a0@NavigationBar, and @PrimaryButton less variables. An example is shown below.\n\u00c2\u00a0./custom/themes/clients/base/default/variables.php\nNote:\u00c2\u00a0Developers\u00c2\u00a0cannot override existing bootstrap\u00c2\u00a0less\u00c2\u00a0variables using this file.\nAdding CSS\nSugar allows you to customize CSS using the less language in ./custom/themes/custom.less.\u00c2\u00a0As Sugar makes use of the Bootstrap library, you have access to the features of Bootstrap and can make use of its variables to create your own CSS.\u00c2\u00a0An example is shown below.\u00c2\u00a0\n./custom/themes/custom.less\n//You can import any less file you want and define your own file structure\n//@import 'anyotherfile.less\n@myCustomBgColor: lighten(@NavigationBar,10%); //variable defined on a custom variable.\n.myCustomClass {\n color: @linkColor; //bootstrap variable\n background-color: @myCustomBgColor;\n}\nOverriding CSS Definitions\nYou can use the\u00c2\u00a0./custom/themes/custom.less file\u00c2\u00a0to\u00c2\u00a0override\u00c2\u00a0CSS classes. The following example overrides\u00c2\u00a0the record label font size.\n./custom/themes/custom.less\n/* \n* Changes record field label sizes to 13px;\n*/\n.record-cell .record-label{\n font-size:13px;\n}\nOverriding the MegaMenu", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Themes/index.html"} {"id": "2b85f83e0869-2", "text": "font-size:13px;\n}\nOverriding the MegaMenu\nAs the MegaMenu has limited color customization within ./custom/themes/clients/base/default/variables.php,\u00c2\u00a0you may want to customize the look and feel further. The following example will automatically set the menu's link color to a contrasting color based on the @NavigationBar\u00c2\u00a0variable\u00c2\u00a0and\u00c2\u00a0determine the hover and active colors for the tabs.\u00c2\u00a0\u00c2\u00a0\n./custom/themes/custom.less\n// Workaround for luminance calculation\n// Use luma() function once Sugar upgraded Lessphp to 1.7+ (see: http://lesscss.org/functions/#color-channel-luminance)\n@luma: 1 - ( (0.299 * red(@NavigationBar)) + (0.587 * green(@NavigationBar)) + (0.114 * blue(@NavigationBar)))/255;\n/** \n * LESS GUARDS\n */\n// General Nav Colors\n.mixin-color() {\n // Darker Colors\n & when (@luma > 0.5) {\n color: darken(contrast(@NavigationBar), 10%) !important;\n }\n // Bright Colors\n & when (@luma <= 0.5) {\n color: lighten(contrast(@NavigationBar), 10%) !important;\n // color: darken(@NavigationBar, 30%) !important;\n }\n}\n// Nav Fa Icon Colors\n.mixin-fa-color(){\n // Darker Colors\n & when (@luma > 0.5) {\n color: darken(contrast(@NavigationBar), 10%) !important;\n }\n // Bright Colors\n & when (@luma <= 0.5) {\n // color: lighten(@NavigationBar, 30%);\n color: lighten(contrast(@NavigationBar), 10%) !important;", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Themes/index.html"} {"id": "2b85f83e0869-3", "text": "color: lighten(contrast(@NavigationBar), 10%) !important;\n // color: darken(@NavigationBar, 30%) !important;\n }\n} \n// Hover Button Groups Background colors\n.mixin-background-color-hover(){\n // Dark Colors\n & when (@luma > 0.5) {\n background-color: lighten(@NavigationBar, 15%) !important;\n }\n // Bright Colors\n & when (@luma <= 0.5) {\n background-color: darken(@NavigationBar, 15%) !important;\n }\n}\n// Hover Button Groups colors\n.mixin-color-hover(){\n // Dark Colors\n & when (@luma > 0.5) {\n color: darken(contrast(@NavigationBar), 10%) !important;\n }\n // Bright Colors\n & when (@luma <= 0.5) {\n // color: lighten(@NavigationBar, 20%) !important;\n color: lighten(contrast(@NavigationBar), 10%) !important;\n }\n}\n// Active Button Group Background Colors\n.mixin-background-color-active(){\n // Dark Colors\n & when (@luma > 0.5) {\n background-color: lighten(@NavigationBar, 10%) !important;\n }\n // Bright Colors\n & when (@luma <= 0.5) {\n background-color: darken(@NavigationBar, 10%) !important;\n }\n}\n// Active Button Group Hover Colors \n.mixin-color-active-hover(){\n // Dark Colors\n & when (@luma > 0.5) {\n color: darken(contrast(@NavigationBar), 5%) !important;\n }\n // Bright Colors\n & when (@luma <= 0.5) {", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Themes/index.html"} {"id": "2b85f83e0869-4", "text": "// Bright Colors\n & when (@luma <= 0.5) {\n color: lighten(contrast(@NavigationBar), 5%) !important;\n }\n}\n// Open Button Group Background Colors\n.mixin-background-color-open(){\n // Dark Colors\n & when (@luma > 0.5) {\n background-color: lighten(@NavigationBar, 20%) !important;\n }\n // Bright Colors\n & when (@luma <= 0.5) {\n background-color: darken(@NavigationBar, 20%) !important;\n }\n}\n// Open Button Group Hover Colors \n.mixin-color-open-hover(){\n // Dark Colors\n & when (@luma > 0.5) {\n color: darken(contrast(@NavigationBar), 15%) !important;\n }\n // Bright Colors\n & when (@luma <= 0.5) {\n color: lighten(contrast(@NavigationBar), 15%) !important;\n }\n}\n// Background/Foreground Dropdown Menu Hover \n.mixin-background-foreground-dropdown-menu-hover(){\n // Dark Colors\n & when (@luma > 0.5) {\n background-color: lighten(@NavigationBar, 15%) !important;\n color: darken(contrast(@NavigationBar), 15%) !important;\n .fa {\n color: darken(contrast(@NavigationBar), 15%) !important;\n }\n }\n // Bright Colors\n & when (@luma <= 0.5) {\n background-color: @NavigationBar !important;\n color: lighten(contrast(@NavigationBar), 5%) !important;\n .fa {\n color: lighten(contrast(@NavigationBar), 5%) !important;\n }\n }\n}\n/** \n * LESS Definitions\n */", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Themes/index.html"} {"id": "2b85f83e0869-5", "text": "}\n }\n}\n/** \n * LESS Definitions\n */\n// Nav Button Group\n.module-list .megamenu > .dropdown .module-name{\n .mixin-color;\n}\n// Home Button Caret\n.navbar .megamenu > .dropdown.active .btn-group:not(.open).home .fa-caret-down,\n// More Button Caret\n.module-list .megamenu > .dropdown.more .fa,\n// Module Toggle caret\n.navbar .megamenu > .dropdown .btn-group > .dropdown-toggle .fa {\n .mixin-fa-color;\n}\n// Nav Button Group Hover \n.megamenu .dropdown .btn-group{\n &:hover, &:focus{\n .mixin-background-color-hover;\n .btn,\n > .dropdown-toggle .fa{\n .mixin-color-hover;\n }\n }\n}\n// Active Button Group\n.navbar .megamenu > .dropdown.active .btn-group{\n .mixin-background-color-active;\n > .dropdown-toggle .fa,\n > a.btn{\n .mixin-fa-color;\n }\n}\n// Active Button Group Hover\n.navbar .megamenu > .dropdown.active .btn-group:hover{\n .mixin-color-active-hover;\n > .dropdown-toggle .fa,\n > a.btn{\n .mixin-color-active-hover;\n }\n}\n// Open Nav Button Group\n.navbar .megamenu > .dropdown .btn-group.open{\n .mixin-background-color-open;\n > .dropdown-toggle .fa,\n > a.btn{\n .mixin-fa-color;\n }\n}\n// Open Nav Button Group Hover\n.navbar .megamenu > .dropdown .btn-group.open:hover{", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Themes/index.html"} {"id": "2b85f83e0869-6", "text": ".navbar .megamenu > .dropdown .btn-group.open:hover{\n .mixin-color-open-hover;\n > .dropdown-toggle .fa,\n > a.btn{\n .mixin-color-open-hover;\n }\n}\n// Nav Button Group Dropdown Menu\n.navbar .megamenu > .dropdown .dropdown-menu li a{\n &:hover, &:focus{\n .mixin-background-foreground-dropdown-menu-hover;\n }\n}\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Themes/index.html"} {"id": "0160c62e6b45-0", "text": "Quotes\nOverview\nAs of Sugar 7.9.0.0, the quotes module has been moved out of Backward Compatibility mode into Sidecar. Customizations to the Quotes interface will need to be rewritten for the new Sidecar framework as an automated migration of these customizations is not possible. This document will outline common customizations and implementation methods.\nQuote Identifiers\nAdministrators can create custom quote identifiers that are more complex than the default auto-incrementing scheme found in an out of box installation. Utilizing this functionality, we can create numbering schemes that match any business needs.\nCreating Custom Identifiers\nTo create a custom identifier, navigate to Admin > Studio > Quotes > Fields. Next, create a TextField type field named to your liking and check the \"Calculated Value\" checkbox and click \"Edit Formula\". Once you see the formula builder, you can choose an example below or create your own. Once created, You can add the new field to your Quote module's layouts as desired.\nUser Field with Pseudo-Random Values\nThis example creates a quote number in the format of -##### that translates to Smith-87837. This identifier starts with the last name of the user creating it, followed by 5 pseudo-random numbers based on the creation time.\nconcat(related($created_by_link, \"last_name\"), \"-\", subStr(toString(timestamp($date_entered)), 5, 5))\nNote: when using Sugar Logic, updates to related fields will update any corresponding Sugar Logic fields. The example being that an update to the Created By last\u00c2\u00a0name field will update all related records with\u00c2\u00a0a\u00c2\u00a0field using this formula.\nRelated Field Value and Auto-Incrementing Number", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Quotes/index.html"} {"id": "0160c62e6b45-1", "text": "Related Field Value and Auto-Incrementing Number\nThis example creates a quote number in the format of -#### that translates to Start Over Trust-0001. This number starts with the billing account name followed by a 4 digit auto-incrementing number.\nconcat(related($billing_accounts, \"name\"), \"-\", subStr(toString(add($quote_num, 10000)), 1, 4))\nNote: when using Sugar Logic, updates to related fields will update any corresponding Sugar Logic fields. The example being that an update to the Billing Account name will update all related records with\u00c2\u00a0a\u00c2\u00a0field using this formula.\nRecord Layout\nThe following sections outline various changes that can be done to modify the record layout of the Quotes module, by outlining the extra views that can be updated.\nGrand Totals Header\nThe Grand Total Header contains the calculated totals for the quote.\nModifying Fields in the Grand Totals Header\nTo modify the Grand Totals Header fields, you can copy ./modules/Quotes/clients/base/views/quote-data-grand-totals-header/quote-data-grand-totals-header.php to ./custom/modules/Quotes/clients/base/views/quote-data-grand-totals-header/quote-data-grand-totals-header.php or you may create a metadata extension in ./custom/Extension/modules/Quotes/clients/base/views/quote-data-grand-totals-header/. Next, modify the $viewdefs['Quotes']['base']['view']['quote-data-grand-totals-header']['panels'][0]['fields'] index to add or remove your preferred fields.\nExample", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Quotes/index.html"} {"id": "0160c62e6b45-2", "text": "Example\nThe example below will add the \"Quote Number\" field (quotes.quote_num) field to the layout and removes the \"Total Discount\" (quotes.deal_tot) from the layout.\u00c2\u00a0If adding a custom field from the Quotes\u00c2\u00a0module to the view, you will also need to add that field to the related_fields array as outlined in the Record View documentation below.\n./custom/modules/Quotes/clients/base/views/quote-data-grand-totals-header/quote-data-grand-totals-header.php\n array(\n array(\n 'name' => 'panel_quote_data_grand_totals_header',\n 'label' => 'LBL_QUOTE_DATA_GRAND_TOTALS_HEADER',\n 'fields' => array(\n array(\n 'name' => 'quote_num',\n 'label' => 'LBL_LIST_QUOTE_NUM',\n 'css_class' => 'quote-totals-row-item',\n ),\n array(\n 'name' => 'new_sub',\n 'css_class' => 'quote-totals-row-item',\n ),\n array(\n 'name' => 'tax',\n 'label' => 'LBL_TAX_TOTAL',\n 'css_class' => 'quote-totals-row-item',\n ),\n array(\n 'name' => 'shipping',\n 'css_class' => 'quote-totals-row-item',\n ),\n array(\n 'name' => 'total',\n 'label' => 'LBL_LIST_GRAND_TOTAL',\n 'css_class' => 'quote-totals-row-item',\n ),\n ),\n ),\n ),\n);", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Quotes/index.html"} {"id": "0160c62e6b45-3", "text": "),\n ),\n ),\n ),\n);\nModifying Buttons in the Grand Totals Header\nThe Quotes List Header contains row actions to create quoted line items, comments, and groupings. The actions are identified by the plus icon in the top left of the header. Editing the 'actions' will allow you to add or remove buttons. The following section will outline how these items can be modified.\nTo modify the Row Actions in the Grand Total Header, you can copy ./modules/Quotes/clients/base/views/quote-data-grand-totals-header/quote-data-grand-totals-header.php to ./custom/modules/Quotes/clients/base/views/quote-data-grand-totals-header/quote-data-grand-totals-header.php or you may create a metadata extension in ./custom/Extension/modules/Quotes/clients/base/views/quote-data-grand-totals-header/. Next, modify the $viewdefs['Quotes']['base']['view']['quote-data-grand-totals-header']['buttons'] index to add or remove your preferred row actions.\nExample\nThe example below will create a new view that extends the QuotesQuoteDataGrandTotalsHeader view and append a button to the Grand Total Header button list.\nFirst, create your custom view type that will extend the QuotesQuoteDataGrandTotalsHeader view.\n./custom/modules/Quotes/clients/base/views/quote-data-grand-totals-header/quote-data-grand-totals-header.js\n({\n extendsFrom: 'QuotesQuoteDataGrandTotalsHeaderView',\n initialize: function(options) {\n this.events = _.extend({}, this.events, options.def.events, {\n 'click [name=\"gth-custom-button\"]': 'buttonClicked'\n });\n this._super('initialize', [options]);\n },\n /**\n * Click event\n */\n buttonClicked: function() {\n app.alert.show('success_alert', {", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Quotes/index.html"} {"id": "0160c62e6b45-4", "text": "buttonClicked: function() {\n app.alert.show('success_alert', {\n level: 'success',\n title: 'Grand Total Header Button was clicked!'\n });\n },\n})\nThis code will append a click event to our button named gth-custom-button and trigger the buttonClicked method. Once completed, add your new button\u00c2\u00a0array to the grand total header in the $viewdefs['Quotes']['base']['view']['quote-data-grand-totals-header']['buttons'] index.\n./custom/modules/Quotes/clients/base/views/quote-data-grand-totals-header/quote-data-grand-totals-header.php\n array(\n array(\n 'type' => 'quote-data-actiondropdown',\n 'name' => 'panel_dropdown',\n 'no_default_action' => true,\n 'buttons' => array(\n array(\n 'type' => 'button',\n 'icon' => 'fa-plus',\n 'name' => 'create_qli_button',\n 'label' => 'LBL_CREATE_QLI_BUTTON_LABEL',\n 'acl_action' => 'create',\n 'tooltip' => 'LBL_CREATE_QLI_BUTTON_TOOLTIP',\n ),\n array(\n 'type' => 'button',\n 'icon' => 'fa-plus',\n 'name' => 'create_comment_button',\n 'label' => 'LBL_CREATE_COMMENT_BUTTON_LABEL',\n 'acl_action' => 'create',\n 'tooltip' => 'LBL_CREATE_COMMENT_BUTTON_TOOLTIP',\n ),\n array(\n 'type' => 'button',\n 'icon' => 'fa-plus',\n 'name' => 'create_group_button',", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Quotes/index.html"} {"id": "0160c62e6b45-5", "text": "'name' => 'create_group_button',\n 'label' => 'LBL_CREATE_GROUP_BUTTON_LABEL',\n 'acl_action' => 'create',\n 'tooltip' => 'LBL_CREATE_GROUP_BUTTON_TOOLTIP',\n ),\n array(\n 'type' => 'button',\n 'icon' => 'fa-plus',\n 'name' => 'gth-custom-button',\n 'label' => 'LBL_GTH_CUSTOM_BUTTON',\n 'acl_action' => 'create',\n 'tooltip' => 'LBL_GTH_CUSTOM_BUTTON_TOOLTIP',\n ),\n ),\n ),\n ),\n ...\n);\nFinally, create labels under Quotes for the label and tooltip indexes. To accomplish this, create a language extension:\n./custom/Extension/modules/Quotes/Ext/Language/en_us.custom-button.php\n Repair > Quick Repair and Rebuild. Your changes will now be reflected in the system.\nList Header\nThe Quotes List Header is a complex view that pulls data from two different locations. The JavaScript controller is located in ./modules/Quotes/clients/base/views/quote-data-list-header/quote-data-list-header.js and pulls the metadata from ./modules/Products/clients/base/views/quote-data-group-list/quote-data-group-list.php. You should note that ProductBundleNotes combines its description field with Product fields in this list.\nModifying Fields in the List Header", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Quotes/index.html"} {"id": "0160c62e6b45-6", "text": "Modifying Fields in the List Header\nTo modify the List Header fields, you can copy ./modules/Products/clients/base/views/quote-data-group-list/quote-data-group-list.php to ./custom/modules/Products/clients/base/views/quote-data-group-list/quote-data-group-list.php or you may create a metadata extension in ./custom/Extension/modules/Products/Ext/clients/base/views/quote-data-group-list/. Next, modify the $viewdefs['Products']['base']['view']['quote-data-group-list']['panels'][0]['fields'] index to add or remove your preferred fields.\nExample\nThe example below will remove the \"Part Number\" (products.mft_part_num) field and replace it with the \"Weight\" (products.weight) field.\n./custom/modules/Products/clients/base/views/quote-data-group-list/quote-data-group-list.php\n array(\n array(\n 'name' => 'products_quote_data_group_list',\n 'label' => 'LBL_PRODUCTS_QUOTE_DATA_LIST',\n 'fields' => array(\n array(\n 'name' => 'line_num',\n 'label' => null,\n 'widthClass' => 'cell-xsmall',\n 'css_class' => 'line_num tcenter',\n 'type' => 'line-num',\n 'readonly' => true,\n ),\n array(\n 'name' => 'quantity',\n 'label' => 'LBL_QUANTITY',\n 'widthClass' => 'cell-small',\n 'css_class' => 'quantity',\n 'type' => 'float',\n ),\n array(\n 'name' => 'product_template_name',\n 'label' => 'LBL_ITEM_NAME',", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Quotes/index.html"} {"id": "0160c62e6b45-7", "text": "'label' => 'LBL_ITEM_NAME',\n 'widthClass' => 'cell-large',\n 'type' => 'quote-data-relate',\n 'required' => true,\n ),\n array(\n 'name' => 'weight',\n 'label' => 'LBL_WEIGHT',\n 'type' => 'float',\n ),\n array(\n 'name' => 'discount_price',\n 'label' => 'LBL_DISCOUNT_PRICE',\n 'type' => 'currency',\n 'convertToBase' => true,\n 'showTransactionalAmount' => true,\n 'related_fields' => array(\n 'discount_price',\n 'currency_id',\n 'base_rate',\n ),\n ),\n array(\n 'name' => 'discount',\n 'type' => 'fieldset',\n 'css_class' => 'quote-discount-percent',\n 'label' => 'LBL_DISCOUNT_AMOUNT',\n 'fields' => array(\n array(\n 'name' => 'discount_amount',\n 'label' => 'LBL_DISCOUNT_AMOUNT',\n 'type' => 'discount',\n 'convertToBase' => true,\n 'showTransactionalAmount' => true,\n ),\n array(\n 'type' => 'discount-select',\n 'name' => 'discount_select',\n 'no_default_action' => true,\n 'buttons' => array(\n array(\n 'type' => 'rowaction',\n 'name' => 'select_discount_amount_button',\n 'label' => 'LBL_DISCOUNT_AMOUNT',\n 'event' => 'button:discount_select_change:click',\n ),\n array(\n 'type' => 'rowaction',", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Quotes/index.html"} {"id": "0160c62e6b45-8", "text": "),\n array(\n 'type' => 'rowaction',\n 'name' => 'select_discount_percent_button',\n 'label' => 'LBL_DISCOUNT_PERCENT',\n 'event' => 'button:discount_select_change:click',\n ),\n ),\n ),\n ),\n ),\n array(\n 'name' => 'total_amount',\n 'label' => 'LBL_LINE_ITEM_TOTAL',\n 'type' => 'currency',\n 'widthClass' => 'cell-medium',\n 'showTransactionalAmount' => true,\n 'related_fields' => array(\n 'total_amount',\n 'currency_id',\n 'base_rate',\n ),\n ),\n ),\n ),\n ),\n);\nNext, create the LBL_WEIGHT label under Quotes as this is not included in the stock installation. To accomplish this, we will need to create a language extension:\n./custom/Extension/modules/Quotes/Ext/Language/en_us.weight.php\n Repair > Quick Repair and Rebuild. Your changes will now be reflected in the system.\nModifying Row Actions in the List Header\nThe Quotes List Header contains row actions to create and delete QLI groupings. The actions are identified by, the \"check all\" checkbox and vertical ellipsis or \"hamburger\" icon buttons. Editing the 'actions' will allow you to add more buttons to (or remove from) the \"Group Selected\" and \"Delete Selected\" buttons. The following section will outline how these items can be modified.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Quotes/index.html"} {"id": "0160c62e6b45-9", "text": "To modify the Row Actions in the List Header, you can copy ./modules/Quotes/clients/base/views/quote-data-list-header/quote-data-list-header.php to ./custom/modules/Quotes/clients/base/views/quote-data-list-header/quote-data-list-header.php or you may create a metadata extension in ./custom/Extension/modules/Quotes/clients/base/views/quote-data-list-header/. Next, modify the $viewdefs['Quotes']['base']['view']['quote-data-list-header']['selection']['actions'] index to add or remove your preferred actions.\nExample\nThe example below will create a new view that extends the QuotesQuoteDataListHeader view and append a row action to the List Header action list.\nFirst, create your custom view type that will extend the QuotesQuoteDataListHeader view.\n./custom/modules/Quotes/clients/base/views/quote-data-list-header/quote-data-list-header.js\n({\n extendsFrom: 'QuotesQuoteDataListHeaderView',\n initialize: function(options) {\n this.events = _.extend({}, this.events, options.def.events, {\n 'click [name=\"lh-custom-button\"]': 'actionClicked'\n });\n this._super('initialize', [options]);\n },\n /**\n * Click event\n */\n actionClicked: function() {\n app.alert.show('success_alert', {\n level: 'success',\n title: 'List Header Row Action was clicked!'\n });\n },\n})\nThis code will append a click event to our field named lh-custom-button and trigger the actionClicked method. Once completed, add your new row action to the list header in the $viewdefs['Quotes']['base']['view']['quote-data-list-header']['selection']['actions'] index.\n./custom/modules/Quotes/clients/base/views/quote-data-list-header/quote-data-list-header.php\n array(\n 'type' => 'multi',\n 'actions' => array(\n array(\n 'name' => 'group_button',\n 'type' => 'rowaction',\n 'label' => 'LBL_CREATE_GROUP_SELECTED_BUTTON_LABEL',\n 'tooltip' => 'LBL_CREATE_GROUP_SELECTED_BUTTON_TOOLTIP',\n 'acl_action' => 'edit',\n ),\n array(\n 'name' => 'massdelete_button',\n 'type' => 'rowaction',\n 'label' => 'LBL_DELETE_SELECTED_LABEL',\n 'tooltip' => 'LBL_DELETE_SELECTED_TOOLTIP',\n 'acl_action' => 'delete',\n ),\n array(\n 'name' => 'lh-custom-button',\n 'type' => 'rowaction',\n 'label' => 'LBL_LH_CUSTOM_ACTION',\n 'tooltip' => 'LBL_LH_CUSTOM_ACTION_TOOLTIP',\n 'acl_action' => 'edit',\n ),\n ),\n ),\n);\nFinally, create labels under Quotes for the label and tooltip indexes. To accomplish this, create a language extension:\n./custom/Extension/modules/Quotes/Ext/Language/en_us.lh-custom-action.php\n Repair > Quick Repair and Rebuild. Your changes will now be reflected in the system.\nGroup Header\nThe Group Header contains the name and options for each grouping of quoted line items.\n\u00c2\u00a0\nModifying Fields in the Group Header", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Quotes/index.html"} {"id": "0160c62e6b45-11", "text": "\u00c2\u00a0\nModifying Fields in the Group Header\nTo modify the Group Header fields, you can copy ./modules/ProductBundles/clients/base/views/quote-data-group-header/quote-data-group-header.php to ./custom/modules/ProductBundles/clients/base/views/quote-data-group-header/quote-data-group-header.php or you may create a metadata extension in ./custom/Extension/modules/Products/clients/base/views/quote-data-group-header/. Next, modify the $viewdefs['ProductBundles']['base']['view']['quote-data-group-header'] index to add or remove your preferred fields.\nExample\nThe example below will append the group total (product_bundles.subtotal) field to the Group Header. It's important to note that when adding additional fields, that changes to the corresponding .hbs file may be necessary to correct any formatting issues.\n./custom/modules/ProductBundles/clients/base/views/quote-data-group-header/quote-data-group-header.php\n array(\n array(\n 'name' => 'panel_quote_data_group_header',\n 'label' => 'LBL_QUOTE_DATA_GROUP_HEADER',\n 'fields' => array(\n array(\n 'name' => 'name',\n 'type' => 'quote-group-title',\n 'css_class' => 'group-name',\n ),\n 'subtotal',\n ),\n ),\n ),\n);\nIf adding a custom field from the Quotes\u00c2\u00a0module to the view, you will also need to add that field to the related_fields array as outlined in the Record View documentation below. Once the files are in place, navigate to Admin > Repair > Quick Repair and Rebuild. Your changes will now be reflected in the system.\nModifying Row Actions in the Group Header", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Quotes/index.html"} {"id": "0160c62e6b45-12", "text": "Modifying Row Actions in the Group Header\nThe Quotes Group Header contains row actions to add QLIs and comments as well as editing and deleting QLI groupings. The actions are identified by, the plus and vertical ellipsis or \"hamburger\" icon buttons. The following section will outline how these items can be modified.\nTo modify the buttons in the Group Header, you can copy ./modules/ProductBundles/clients/base/views/quote-data-group-header/quote-data-group-header.php to ./custom/modules/ProductBundles/clients/base/views/quote-data-group-header/quote-data-group-header.php or you may create a metadata extension in ./custom/Extension/modules/ProductBundles/clients/base/views/quote-data-group-header/. Next, modify the $viewdefs['ProductBundles']['base']['view']['quote-data-group-header']['buttons']\u00c2\u00a0index to add or remove your preferred actions.\nExample\nThe example below will create a new view that extends the ProductBundlesQuoteDataGroupHeader view and append a row action to the Group Header vertical elipsis action list.\nFirst, create your custom view type that will extend the ProductBundlesQuoteDataGroupHeader view.\n./custom/modules/ProductBundles/clients/base/views/quote-data-group-header/quote-data-group-header.js\n({\n extendsFrom: 'ProductBundlesQuoteDataGroupHeaderView',\n initialize: function(options) {\n this.events = _.extend({}, this.events, options.def.events, {\n 'click [name=\"gh-custom-action\"]': 'actionClicked'\n });\n this._super('initialize', [options]);\n },\n /**\n * Click event\n */\n actionClicked: function() {\n app.alert.show('success_alert', {\n level: 'success',\n title: 'Group Header Button was clicked!'\n });\n },\n})", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Quotes/index.html"} {"id": "0160c62e6b45-13", "text": "title: 'Group Header Button was clicked!'\n });\n },\n})\nThis code will append a click event to our field named gh-custom-action and trigger the actionClicked method. Once completed, add your new row action to the appropriate button group in\u00c2\u00a0$viewdefs['Quotes']['base']['view']['quote-data-group-header']['buttons']. For this example we will target a row action to the edit drop down that is identified in the arrays as having\u00c2\u00a0a\u00c2\u00a0name of \"edit-dropdown\". Once found, add your new array to the buttons index of that array.\n./custom/modules/ProductBundles/clients/base/views/quote-data-group-header/quote-data-group-header.php\n array(\n array(\n 'type' => 'quote-data-actiondropdown',\n 'name' => 'create-dropdown',\n 'icon' => 'fa-plus',\n 'no_default_action' => true,\n 'buttons' => array(\n array(\n 'type' => 'rowaction',\n 'css_class' => 'btn-invisible',\n 'icon' => 'fa-plus',\n 'name' => 'create_qli_button',\n 'label' => 'LBL_CREATE_QLI_BUTTON_LABEL',\n 'tooltip' => 'LBL_CREATE_QLI_BUTTON_TOOLTIP',\n 'acl_action' => 'create',\n ),\n array(\n 'type' => 'rowaction',\n 'css_class' => 'btn-invisible',\n 'icon' => 'fa-plus',\n 'name' => 'create_comment_button',\n 'label' => 'LBL_CREATE_COMMENT_BUTTON_LABEL',\n 'tooltip' => 'LBL_CREATE_COMMENT_BUTTON_TOOLTIP',", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Quotes/index.html"} {"id": "0160c62e6b45-14", "text": "'tooltip' => 'LBL_CREATE_COMMENT_BUTTON_TOOLTIP',\n 'acl_action' => 'create',\n ),\n ),\n ),\n array(\n 'type' => 'quote-data-actiondropdown',\n 'name' => 'edit-dropdown',\n 'icon' => 'fa-ellipsis-v',\n 'no_default_action' => true,\n 'buttons' => array(\n array(\n 'type' => 'rowaction',\n 'name' => 'edit_bundle_button',\n 'label' => 'LBL_EDIT_BUTTON',\n 'tooltip' => 'LBL_EDIT_BUNDLE_BUTTON_TOOLTIP',\n 'acl_action' => 'edit',\n ),\n array(\n 'type' => 'rowaction',\n 'name' => 'delete_bundle_button',\n 'label' => 'LBL_DELETE_GROUP_BUTTON',\n 'tooltip' => 'LBL_DELETE_BUNDLE_BUTTON_TOOLTIP',\n 'acl_action' => 'delete',\n ),\n array(\n 'type' => 'rowaction',\n 'name' => 'gh-custom-action',\n 'label' => 'LBL_GH_CUSTOM_ACTION',\n 'tooltip' => 'LBL_GH_CUSTOM_ACTION_TOOLTIP',\n 'acl_action' => 'edit',\n ),\n ),\n ),\n ),\n ...\n);\nFinally, create labels under Quotes for the label and tooltip indexes. To accomplish this, create a language extension:\n./custom/Extension/modules/Quotes/Ext/Language/en_us.gh-custom-action.php\n Repair > Quick Repair and Rebuild. Your changes will now be reflected in the system.\nGroup List\nThe Group List contains the comments and selected quoted line items.\nModifying Fields in the Group List\nTo modify the Group List fields, you can copy ./modules/Products/clients/base/views/quote-data-group-list/quote-data-group-list.php to ./custom/modules/Products/clients/base/views/quote-data-group-list/quote-data-group-list.php or you may create a metadata extension in ./custom/Extension/modules/Products/Ext/clients/base/views/quote-data-group-list/. Next, modify the $viewdefs['Products']['base']['view']['quote-data-group-list']['panels'] index to add or remove your preferred fields.\nExample\nThe example below will remove the \"Manufacturer Part Number\" (products.mft_part_num) and append the \"Vendor Part Number\" (products.vendor_part_num) field to the Group List.\n./custom/modules/Products/clients/base/views/quote-data-group-list/quote-data-group-list.php\n array(\n array(\n 'name' => 'products_quote_data_group_list',\n 'label' => 'LBL_PRODUCTS_QUOTE_DATA_LIST',\n 'fields' => array(\n array(\n 'name' => 'line_num',\n 'label' => null,\n 'widthClass' => 'cell-xsmall',\n 'css_class' => 'line_num tcenter',\n 'type' => 'line-num',\n 'readonly' => true,\n ),\n array(\n 'name' => 'quantity',", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Quotes/index.html"} {"id": "0160c62e6b45-16", "text": "),\n array(\n 'name' => 'quantity',\n 'label' => 'LBL_QUANTITY',\n 'widthClass' => 'cell-small',\n 'css_class' => 'quantity',\n 'type' => 'float',\n ),\n array(\n 'name' => 'product_template_name',\n 'label' => 'LBL_ITEM_NAME',\n 'widthClass' => 'cell-large',\n 'type' => 'quote-data-relate',\n 'required' => true,\n ),\n array(\n 'name' => 'vendor_part_num',\n 'label' => 'LBL_VENDOR_PART_NUM',\n 'type' => 'base',\n ),\n array(\n 'name' => 'discount_price',\n 'label' => 'LBL_DISCOUNT_PRICE',\n 'type' => 'currency',\n 'convertToBase' => true,\n 'showTransactionalAmount' => true,\n 'related_fields' => array(\n 'discount_price',\n 'currency_id',\n 'base_rate',\n ),\n ),\n array(\n 'name' => 'discount',\n 'type' => 'fieldset',\n 'css_class' => 'quote-discount-percent',\n 'label' => 'LBL_DISCOUNT_AMOUNT',\n 'fields' => array(\n array(\n 'name' => 'discount_amount',\n 'label' => 'LBL_DISCOUNT_AMOUNT',\n 'type' => 'discount',\n 'convertToBase' => true,\n 'showTransactionalAmount' => true,\n ),\n array(\n 'type' => 'discount-select',\n 'name' => 'discount_select',\n 'no_default_action' => true,", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Quotes/index.html"} {"id": "0160c62e6b45-17", "text": "'name' => 'discount_select',\n 'no_default_action' => true,\n 'buttons' => array(\n array(\n 'type' => 'rowaction',\n 'name' => 'select_discount_amount_button',\n 'label' => 'LBL_DISCOUNT_AMOUNT',\n 'event' => 'button:discount_select_change:click',\n ),\n array(\n 'type' => 'rowaction',\n 'name' => 'select_discount_percent_button',\n 'label' => 'LBL_DISCOUNT_PERCENT',\n 'event' => 'button:discount_select_change:click',\n ),\n ),\n ),\n ),\n ),\n array(\n 'name' => 'total_amount',\n 'label' => 'LBL_LINE_ITEM_TOTAL',\n 'type' => 'currency',\n 'widthClass' => 'cell-medium',\n 'showTransactionalAmount' => true,\n 'related_fields' => array(\n 'total_amount',\n 'currency_id',\n 'base_rate',\n ),\n ),\n ),\n ),\n ),\n);\nNext, create the LBL_VENDOR_PART_NUM label under Quotes as this is not included in the stock installation. To accomplish this, we will need to create a language extension:\n./custom/Extension/modules/Quotes/Ext/Language/en_us.vendor.php\n Repair > Quick Repair and Rebuild. Your changes will now be reflected in the system.\nModifying Row Actions in the Group List", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Quotes/index.html"} {"id": "0160c62e6b45-18", "text": "Modifying Row Actions in the Group List\nThe Quotes Group List contains row actions to add/remove QLIs and comments. The actions are identified by, the vertical ellipsis icon buttons. The following section will outline how these items can be modified.\nTo modify the buttons in the Group List , you can copy ./modules/ProductBundles/clients/base/views/quote-data-group-list/quote-data-group-list.php to ./custom/modules/ProductBundles/clients/base/views/quote-data-group-list/quote-data-group-list.php or you may create a metadata extension in ./custom/Extension/modules/ProductBundles/clients/base/views/quote-data-group-list/. Next, modify the $viewdefs['ProductBundles']['base']['view']['quote-data-group-list']['selection'] index to add or remove your preferred actions.\nExample\nThe example below will create a new view that extends the ProductBundlesQuoteDataGroupList view and append a row action to the Group List's vertical elipsis action list.\nFirst, create your custom view type that will extend the ProductBundlesQuoteDataGroupList view. This will contain the JavaScript for your action.\n./custom/modules/ProductBundles/clients/base/views/quote-data-group-list/quote-data-group-list.js\n({\n extendsFrom: 'ProductBundlesQuoteDataGroupListView',\n initialize: function(options) {\n this.events = _.extend({}, this.events, options.def.events, {\n 'click [name=\"gl-custom-action\"]': 'actionClicked'\n });\n this._super('initialize', [options]);\n },\n /**\n * Click event\n */\n actionClicked: function() {\n app.alert.show('success_alert', {\n level: 'success',\n title: 'List Header Row Action was clicked!'\n });\n },\n})", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Quotes/index.html"} {"id": "0160c62e6b45-19", "text": "title: 'List Header Row Action was clicked!'\n });\n },\n})\nThis code will append a click event to our field named gl-custom-action and trigger the actionClicked method. Once completed, add your new row action to the group list in the $viewdefs['ProductBundles']['base']['view']['quote-data-group-list']['selection']['actions'] index.\n./custom/modules/ProductBundles/clients/base/views/quote-data-group-list/quote-data-group-list.php\n array(\n 'type' => 'multi',\n 'actions' => array(\n array(\n 'type' => 'rowaction',\n 'name' => 'edit_row_button',\n 'label' => 'LBL_EDIT_BUTTON',\n 'tooltip' => 'LBL_EDIT_BUTTON',\n 'acl_action' => 'edit',\n ),\n array(\n 'type' => 'rowaction',\n 'name' => 'delete_row_button',\n 'label' => 'LBL_DELETE_BUTTON',\n 'tooltip' => 'LBL_DELETE_BUTTON',\n 'acl_action' => 'delete',\n ),\n array(\n 'type' => 'rowaction',\n 'name' => 'gl-custom-action',\n 'label' => 'LBL_GL_CUSTOM_ACTION',\n 'tooltip' => 'LBL_GL_CUSTOM_ACTION_TOOLTIP',\n 'acl_action' => 'edit',\n ),\n ),\n ),\n);\nFinally, create labels under Quotes for the label and tooltip indexes. To accomplish this, create a language extension:\n./custom/Extension/modules/Quotes/Ext/Language/en_us.gh-custom-action.php\n Repair > Quick Repair and Rebuild. Your changes will now be reflected in the system.\nGroup Footer\nThe Group Footer contains the total for each grouping of quoted line items.\nModifying Fields in the Group Footer\nTo modify the GroupFooter fields, you can copy ./modules/ProductBundles/clients/base/views/quote-data-group-footer/quote-data-group-footer.php to ./custom/modules/ProductBundles/clients/base/views/quote-data-group-footer/quote-data-group-footer.php or you may create a metadata extension in ./custom/Extension/modules/ProductBundles/clients/base/views/quote-data-group-footer/. Next, modify the $viewdefs['ProductBundles']['base']['view']['quote-data-group-footer'] index to add or remove your preferred fields.\nExample\nThe example below will append the bundle stage (product_bundles.bundle_stage) field to the Group Footer. It's important to note that when adding additional fields, that changes to the corresponding .hbs file may be necessary to correct any formatting issues.\n./custom/modules/ProductBundles/clients/base/views/quote-data-group-header/quote-data-group-footer.php\n array(\n array(\n 'name' => 'panel_quote_data_group_footer',\n 'label' => 'LBL_QUOTE_DATA_GROUP_FOOTER',\n 'fields' => array(\n 'bundle_stage',\n array(\n 'name' => 'new_sub',\n 'label' => 'LBL_GROUP_TOTAL',\n 'type' => 'currency',\n ),\n ),\n ),\n ),", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Quotes/index.html"} {"id": "0160c62e6b45-21", "text": "),\n ),\n ),\n ),\n);\nIf adding custom fields from the Product Bundles module to the view, you will also need to add that field to the related_fields array as outlined in the Record View documentation below. Once the files are in place, navigate to Admin > Repair > Quick Repair and Rebuild. Your changes will now be reflected in the system.\nGrand Totals Footer\nThe Grand Total Footer contains the calculated totals for the quote. It mimics the information found in the Grand Total Header.\nModifying Fields in the Grand Totals Footer\nTo modify the Grand Totals Footer fields, you can copy ./modules/Quotes/clients/base/views/quote-data-grand-totals-footer/quote-data-grand-totals-footer.php to ./custom/modules/Quotes/clients/base/views/quote-data-grand-totals-footer/quote-data-grand-totals-footer.php or you may create a metadata extension in ./custom/Extension/modules/Quotes/clients/base/views/quote-data-grand-totals-footer/. Next, modify the $viewdefs['Quotes']['base']['view']['quote-data-grand-totals-footer']['panels'][0]['fields'] index to add or remove your preferred fields.\nExample\nThe example below will remove the \"Shipping\" field (quotes.shipping) field from the layout.\n./custom/modules/Quotes/clients/base/views/quote-data-grand-totals-footer/quote-data-grand-totals-footer.php\n array(\n array(\n 'name' => 'panel_quote_data_grand_totals_footer',\n 'label' => 'LBL_QUOTE_DATA_GRAND_TOTALS_FOOTER',\n 'fields' => array(\n 'quote_num',\n array(\n 'name' => 'new_sub',", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Quotes/index.html"} {"id": "0160c62e6b45-22", "text": "'quote_num',\n array(\n 'name' => 'new_sub',\n 'type' => 'currency',\n ),\n array(\n 'name' => 'tax',\n 'type' => 'currency',\n 'related_fields' => array(\n 'taxrate_value',\n ),\n ),\n array(\n 'name' => 'total',\n 'label' => 'LBL_LIST_GRAND_TOTAL',\n 'type' => 'currency',\n 'css_class' => 'grand-total',\n ),\n ),\n ),\n ),\n);\nIf adding custom fields from the Quotes\u00c2\u00a0module to the view, you will also need to add that field to the related_fields array as outlined in the Record View documentation below. Once the files are in place, navigate to Admin > Repair > Quick Repair and Rebuild. Your changes will now be reflected in the system.\nRecord View\nThe record view for Quotes is updated and used like the standard Record View for all modules. The one major difference to note is that the JavaScript models used by the previous views above, are derived from the Model defined in the record view metadata.\nAdding Custom Related Fields to Model\nIn the Record View metadata, the first\u00c2\u00a0panel panel_header containing the picture and name fields for the Quote record, contains a related_fields property in the name definition that defines the related Product Bundles and Products data that is pulled into the JavaScript model. When custom fields are added to the above mentioned views you will need to add them to the related_fields property in their respective related module so that they are properly loaded during the page load.\nThe following example adds the custom_product_bundle_field_c field from the Product Bundles module, and the custom_product_field_c from the Products module into the retrieved Model.\n./custom/modules/Quotes/clients/base/views/record/record.php", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Quotes/index.html"} {"id": "0160c62e6b45-23", "text": "./custom/modules/Quotes/clients/base/views/record/record.php\n array(\n array(\n 'name' => 'panel_header',\n 'label' => 'LBL_PANEL_HEADER',\n 'header' => true,\n 'fields' => array(\n array(\n 'name' => 'picture',\n 'type' => 'avatar',\n 'size' => 'large',\n 'dismiss_label' => true,\n 'readonly' => true,\n ),\n array(\n 'name' => 'name',\n 'events' => array(\n 'keyup' => 'update:quote',\n ),\n 'related_fields' => array(\n array(\n 'name' => 'bundles',\n 'fields' => array(\n 'id',\n 'bundle_stage',\n 'currency_id',\n 'base_rate',\n 'currencies',\n 'name',\n 'deal_tot',\n 'deal_tot_usdollar',\n 'deal_tot_discount_percentage',\n 'new_sub',\n 'new_sub_usdollar',\n 'position',\n 'related_records',\n 'shipping',\n 'shipping_usdollar',\n 'subtotal',\n 'subtotal_usdollar',\n 'tax',\n 'tax_usdollar',\n 'taxrate_id',\n 'team_count',\n 'team_count_link',\n 'team_name',\n 'taxable_subtotal',\n 'total',\n 'total_usdollar',\n 'default_group',\n 'custom_product_bundle_field_c',\n array(\n 'name' => 'product_bundle_items',", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Quotes/index.html"} {"id": "0160c62e6b45-24", "text": "array(\n 'name' => 'product_bundle_items',\n 'fields' => array(\n 'name',\n 'quote_id',\n 'description',\n 'quantity',\n 'product_template_name',\n 'product_template_id',\n 'deal_calc',\n 'mft_part_num',\n 'discount_price',\n 'discount_amount',\n 'tax',\n 'tax_class',\n 'subtotal',\n 'position',\n 'currency_id',\n 'base_rate',\n 'discount_select',\n 'custom_product_field_c',\n ),\n 'max_num' => -1,\n ),\n ),\n 'max_num' => -1,\n 'order_by' => 'position:asc',\n ),\n ),\n ),\n ),\n ),\n ...\n ),\n);\nQuote PDFs\nUngrouped Quoted Line Items and Notes\nAs of Sugar 7.9, the quotes module allows users to add quoted line items and notes without first adding a group. Adding at least one group to your quote was mandatory in earlier versions. This document will cover how to update your custom PDF templates to support ungrouped QLIs and notes. Ungrouped items are technically added to a default group. The goal is to exclude this group when no items exist in it.\nPDF Manager Templates\nIn your PDF Manager templates, you may have code similar to what is shown below to iterate over the groups in a quote:\n{foreach from=$product_bundles item=\"bundle\"}\n ....\n{/foreach}", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Quotes/index.html"} {"id": "0160c62e6b45-25", "text": "{foreach from=$product_bundles item=\"bundle\"}\n ....\n{/foreach}\nTo correct this for 7.9, we will need to add an if statement to check to see if the group is empty. If it is empty, it will be ignored in your PDF. The benefit is that it will also exclude any other empty groups in your quote and clean the generated PDF.\n{foreach from=$product_bundles item=\"bundle\"}\n {if $bundle.products|@count}\n ....\n {/if}\n{/foreach}\nSmarty Templates\nIn Smarty templates, you may have code similar to what is shown below to iterate over the groups in a quote:\n{literal}{foreach from=$product_bundles item=\"bundle\"}{/literal}\n ...\n{literal}{/foreach}{/literal}\nTo correct this for 7.9, we will need to add an if statement to check to see if the group is empty. If it is empty, it will be ignored in your PDF. The benefit is that it will also exclude any other empty groups in your quote and clean the generated PDF.\n{literal}{foreach from=$product_bundles item=\"bundle\"}{/literal}\n {literal}{if $bundle.products|@count}{/literal}\n ...\n {literal}{/if}{/literal}\n{literal}{/foreach}{/literal}\nCreating Custom PDF Templates\nWith Sugar, there are generally two routes that can be taken to create custom PDF templates. The first and most recommended route is to use the PDF Manager found in the Admin > PDF Manager. The second route is to extend the Sugarpdf class and write your own template using PHP and the TCPDF library. This method should only be used if you are unable to accomplish your business needs through the PDF Manager.\nCreating the TCPDF Template", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Quotes/index.html"} {"id": "0160c62e6b45-26", "text": "Creating the TCPDF Template\nThe first step is to create your custom TCPDF template in ./custom/modules/Quotes/sugarpdf/. For our example, we will extend QuotesSugarpdfStandard, found at ./modules/Quotes/sugarpdf/sugarpdf.standard.php, to a new file in ./custom/modules/Quotes/sugarpdf/ to create a custom invoice. The QuotesSugarpdfStandard class sets up our general quote requirements and extends the Sugarpdf class. Technical documentation on templating can be found in the Sugar PDF documentation. Our class will be named QuotesSugarpdfCustomInvoice as the naming must be in the format of Sugarpdf.\n./custom/modules/Quotes/sugarpdf/sugarpdf.custominvoice.php\nbean->quote_num, $this->bean->system_id);\n $quote[1]['VALUE']['value'] = $timedate->nowDate();", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Quotes/index.html"} {"id": "0160c62e6b45-27", "text": "$quote[1]['VALUE']['value'] = $timedate->nowDate();\n $quote[2]['VALUE']['value'] = $this->bean->purchase_order_num;\n $quote[3]['VALUE']['value'] = $this->bean->payment_terms;\n // these options override the params of the $options array.\n $quote[0]['VALUE']['options'] = array();\n $quote[1]['VALUE']['options'] = array();\n $quote[2]['VALUE']['options'] = array();\n $quote[3]['VALUE']['options'] = array();\n $html = $this->writeHTMLTable($quote, true, $this->headerOptions);\n $this->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, $mod_strings['LBL_PDF_INVOICE_TITLE'], $html);\n }\n /**\n * This method build the name of the PDF file to output.\n */\n function buildFileName()\n {\n global $mod_strings;\n $fileName = preg_replace(\"#[^A-Z0-9\\-_\\.]#i\", \"_\", $this->bean->shipping_account_name);\n if (!empty($this->bean->quote_num)) {\n $fileName .= \"_{$this->bean->quote_num}\";\n }\n $fileName = $mod_strings['LBL_INVOICE'] . \"_{$fileName}.pdf\";\n if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match(\"/MSIE/\", $_SERVER['HTTP_USER_AGENT'])) {\n //$fileName = $locale->translateCharset($fileName, $locale->getExportCharset());\n $fileName = urlencode($fileName);\n }\n $this->fileName = $fileName;\n }\n}", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Quotes/index.html"} {"id": "0160c62e6b45-28", "text": "}\n $this->fileName = $fileName;\n }\n}\nNext, register the layout. This is a two step process. The first step is to create ./custom/modules/Quotes/Layouts.php which will map our view action to the physical PHP file.\n./custom/modules/Quotes/Layouts.php\n Dropdown Editor. Once there, create a new entry in the list with an Item Name of \"CustomInvoice\" and a Display Label of your choice. It's also recommended to remove the Quote and Invoice Templates if they are not being used to avoid confusion. This will create a ./custom/Extension/application/Ext/Language/en_us.sugar_layouts_dom.php file that should look similar to:\n./custom/Extension/application/Ext/Language/en_us.sugar_layouts_dom.php\n 'Custom Invoice',\n);\nOnce the layout is registered, we need to extend\u00c2\u00a0the pdfaction field for the Quotes module to render our custom pdf templates in the record view. An example of this is shown below:\n./custom/modules/Quotes/clients/base/fields/pdfaction/pdfaction.js\n/**\n * @class View.Fields.Base.Quotes.PdfactionField\n * @alias SUGAR.App.view.fields.BaseQuotesPdfactionField\n * @extends View.Fields.Base.PdfactionField\n */\n({\n extendsFrom: 'PdfactionField',\n /**\n * @inheritdoc\n * Create PDF Template collection in order to get available template list.\n */\n initialize: function(options) {\n this._super('initialize', [options]);\n },\n /**", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Quotes/index.html"} {"id": "0160c62e6b45-29", "text": "this._super('initialize', [options]);\n },\n /**\n * Define proper filter for PDF template list.\n * Fetch the collection to get available template list.\n * @private\n */\n _fetchTemplate: function() {\n this.fetchCalled = true;\n var collection = this.templateCollection;\n collection.filterDef = {'$and': [{\n 'base_module': this.module\n }, {\n 'published': 'yes'\n }]};\n collection.fetch({\n success: function(){\n var models = [];\n _.each(app.lang.getAppListStrings('layouts_dom'), function(template, id){\n var model = new Backbone.Model({\n id: id,\n name: template\n });\n models.push(model);\n });\n collection.add(models);\n }\n });\n },\n /**\n * Build download link url.\n *\n * @param {String} templateId PDF Template id.\n * @return {string} Link url.\n * @private\n */\n _buildDownloadLink: function(templateId) {\n var sugarpdf = this._isUUID(templateId)? 'pdfmanager' : templateId;\n var urlParams = $.param({\n 'action': 'sugarpdf',\n 'module': this.module,\n 'sugarpdf': sugarpdf,\n 'record': this.model.id,\n 'pdf_template_id': templateId\n });\n return '?' + urlParams;\n },\n /**\n * Build email pdf link url.\n *\n * @param {String} templateId PDF Template id.\n * @return {string} Email pdf url.\n * @private\n */", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Quotes/index.html"} {"id": "0160c62e6b45-30", "text": "* @return {string} Email pdf url.\n * @private\n */\n _buildEmailLink: function(templateId) {\n var sugarpdf = this._isUUID(templateId)? 'pdfmanager' : templateId;\n return '#' + app.bwc.buildRoute(this.module, null, 'sugarpdf', {\n 'sugarpdf': sugarpdf,\n 'record': this.model.id,\n 'pdf_template_id': templateId,\n 'to_email': '1'\n });\n },\n /**\n * tests to see if a templateId is a uuid or template name.\n *\n * @param {String} templateId PDF Template id\n * @return {boolean} true if uuid, false if not\n * @private\n */\n _isUUID: function(templateId) {\n var regex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n return regex.test(templateId);\n }\n})\nOnce the files are in place, navigate to Admin > Repair > Quick Repair and Rebuild. Your changes will now be reflected in the system and navigating to a url in the format of index.php?module=Quotes&record=&action=sugarpdf&sugarpdf=CustomInvoice will generate the pdf document.\nHiding PDF Buttons", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Quotes/index.html"} {"id": "0160c62e6b45-31", "text": "Hiding PDF Buttons\nIn some circumstances, users may not have a need to generate PDFs from Quotes. If this should occur, a developer can copy ./modules/Quotes/clients/base/views/record/record.php\u00c2\u00a0to ./custom/modules/Quotes/clients/base/views/record/record.php\u00c2\u00a0if it doesn't already exist. Next, find the array with a name of main_dropwdown in\u00c2\u00a0the $viewdefs['Quotes']['base']['view']['record']['buttons']\u00c2\u00a0index. Once found, you will then need to locate the buttons index within that\u00c2\u00a0array. You will then need to remove the following arrays from that index:\narray(\n 'type' => 'pdfaction',\n 'name' => 'download-pdf',\n 'label' => 'LBL_PDF_VIEW',\n 'action' => 'download',\n 'acl_action' => 'view',\n),\narray(\n 'type' => 'pdfaction',\n 'name' => 'email-pdf',\n 'label' => 'LBL_PDF_EMAIL',\n 'action' => 'email',\n 'acl_action' => 'view',\n),\nYour file should look similar to what is shown below:\ncustom/modules/Quotes/clients/base/views/record/record.php\n array(\n array(\n 'type' => 'button',\n 'name' => 'cancel_button',\n 'label' => 'LBL_CANCEL_BUTTON_LABEL',\n 'css_class' => 'btn-invisible btn-link',\n 'showOn' => 'edit',\n 'events' => array(\n 'click' => 'button:cancel_button:click',\n ),\n ),\n array(", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Quotes/index.html"} {"id": "0160c62e6b45-32", "text": "),\n ),\n array(\n 'type' => 'rowaction',\n 'event' => 'button:save_button:click',\n 'name' => 'save_button',\n 'label' => 'LBL_SAVE_BUTTON_LABEL',\n 'css_class' => 'btn btn-primary',\n 'showOn' => 'edit',\n 'acl_action' => 'edit',\n ),\n array(\n 'type' => 'actiondropdown',\n 'name' => 'main_dropdown',\n 'primary' => true,\n 'showOn' => 'view',\n 'buttons' => array(\n array(\n 'type' => 'rowaction',\n 'event' => 'button:edit_button:click',\n 'name' => 'edit_button',\n 'label' => 'LBL_EDIT_BUTTON_LABEL',\n 'acl_action' => 'edit',\n ),\n array(\n 'type' => 'shareaction',\n 'name' => 'share',\n 'label' => 'LBL_RECORD_SHARE_BUTTON',\n 'acl_action' => 'view',\n ),\n array(\n 'type' => 'divider',\n ),\n array(\n 'type' => 'convert-to-opportunity',\n 'event' => 'button:convert_to_opportunity:click',\n 'name' => 'convert_to_opportunity_button',\n 'label' => 'LBL_QUOTE_TO_OPPORTUNITY_LABEL',\n 'acl_module' => 'Opportunities',\n 'acl_action' => 'create',\n ),\n array(\n 'type' => 'divider',\n ),\n array(\n 'type' => 'rowaction',\n 'event' => 'button:historical_summary_button:click',", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Quotes/index.html"} {"id": "0160c62e6b45-33", "text": "'event' => 'button:historical_summary_button:click',\n 'name' => 'historical_summary_button',\n 'label' => 'LBL_HISTORICAL_SUMMARY',\n 'acl_action' => 'view',\n ),\n array(\n 'type' => 'rowaction',\n 'event' => 'button:audit_button:click',\n 'name' => 'audit_button',\n 'label' => 'LNK_VIEW_CHANGE_LOG',\n 'acl_action' => 'view',\n ),\n array(\n 'type' => 'rowaction',\n 'event' => 'button:find_duplicates_button:click',\n 'name' => 'find_duplicates_button',\n 'label' => 'LBL_DUP_MERGE',\n 'acl_action' => 'edit',\n ),\n array(\n 'type' => 'divider',\n ),\n array(\n 'type' => 'rowaction',\n 'event' => 'button:delete_button:click',\n 'name' => 'delete_button',\n 'label' => 'LBL_DELETE_BUTTON_LABEL',\n 'acl_action' => 'delete',\n ),\n ),\n ),\n array(\n 'name' => 'sidebar_toggle',\n 'type' => 'sidebartoggle',\n ),\n ),\n ...\n);\nOnce the files are in place, navigate to Admin > Repair > Quick Repair and Rebuild. Your changes will now be reflected in the system.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Quotes/index.html"} {"id": "bca86f5e13d9-0", "text": "Module Builder\nOverview\nThe Module Builder tool allows programmers to create custom modules without writing code and to create relationships between new and existing CRM modules. To illustrate how to use Module Builder, this article will show how to create and deploy a custom module.\nFor\u00c2\u00a0this example, a custom module to track media inquiries will be created to track public relations requests within a CRM system. This use case is an often requested enhancement for CRM systems that apply across industries.\nCreating New Modules\nModule Builder functionality is managed within the 'Developer Tools' section of Sugar's administration console.\nUpon selecting 'Module Builder', the user has the option of creating a \"New Package\". Packages are a collection of custom modules, objects, and fields that can be published within the application instance or shared across instances of Sugar. Once the user selects \"New Package\", the usernames and describes the type of Custom Module to be created. A package key, usually based on the organization or name of the package creator is required to prevent conflicts between two packages with the same name from different authors. In this case, the package will be named \"MediaTracking\" to explain its purpose, and a key based on the author name will be used.\nOnce the new package is created and saved, the user is presented with a screen to create a Custom Module. Upon selecting the \"New Module\" icon, a screen appears showing six different object templates.\nUnderstanding Object Templates", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Builder/index.html"} {"id": "bca86f5e13d9-1", "text": "Understanding Object Templates\nFive of the six object templates contain pre-built CRM functionality for key CRM use cases. These objects are:\"basic\", \"company\", \"file\", \"issue\", \"person\", and \"sale\". The \"basic\" template provides fields such as Name, Assigned to, Team, Date Created, and Description. As their title denotes, the rest of these templates contain fields and application logic to describe entities similar to \"Accounts\", \"Documents, \"Cases\", \"Contacts\", and \"Opportunities\", respectively. Thus, to create a Custom Module to track a type of account, you would select the \"Company\" template. Similarly, to track human interactions, you would select \"People\".\nFor the media tracking use case, the user will use the object template \"Issue\" because inbound media requests have similarities to incoming support cases. In both examples, there is an inquiry, a recipient of the issue, assignment of the issue and resolution. The final object template is named \"Basic\" which is the default base object type. This allows the administrator to create their own custom fields to define the object.\nUpon naming and selecting the Custom Module template named \"Issue\", the user can further customize the module by changing the fields and layout of the application and creating relationships between this new module and existing standard or custom modules. This Edit functionality allows a user to construct a module that meets the specific data requirements of the Custom Module.\nEditing Module Fields\nFields can be edited and created using the field editor. Fields inherited from the custom module's templates can be relabeled while new fields are fully editable. New fields are added using the Add Field button. This displays a tab where you can select the type of field to add as well as any properties that field-type requires.\nEditing Module Layouts", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Builder/index.html"} {"id": "bca86f5e13d9-2", "text": "Editing Module Layouts\nThe layout editor can be used to change the appearance of the screens within the new module, including the EditView, DetailView and ListView screens. When editing the Edit View or the Detail View, new panels and rows can be dragged from the toolbox on the left side to the layout area on the right. Fields can then be dragged between the layout area and the toolbox. Fields are removed from the layout by dragging them from the layout area to the recycling icon. Fields can be expanded or collapsed to take up one or two columns on the layout using the plus and minus icons. The\u00c2\u00a0List, Search, Dashlet, and Subpanel views can be edited by dragging fields between hidden/visible/available columns.\nBuilding Relationships\nOnce the fields and layout of the Custom Module have been defined, the user then defines relationships between this new module and existing CRM data by clicking \"View Relationships\". The \"Add Relationship\" button allows the user to associate the new module to an existing or new custom module in the same package. In the case of the Media Tracker, the user can associate the Custom Module with the existing, standard 'Contacts' module that is available in every Sugar installation using a many-to-many relationship. By creating this relationship, end-users will see the Contacts associated with each Media Inquiry. We will also add a relationship to the activities module so that a Media Inquiry can be related to calls, meetings, tasks, and emails.\nPublishing and Uploading Packages", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Builder/index.html"} {"id": "bca86f5e13d9-3", "text": "Publishing and Uploading Packages\nAfter the user has created the appropriate fields, layouts, and relationships for the custom modules, this new CRM functionality can be deployed. Click the \"Deploy\" button to deploy the package to the current instance. This is the recommended way to test your package while developing. If you wish to make further changes to your package or custom modules, you should make those changes in Module Builder, and click the Deploy button again. Clicking the Publish button generates a zip file with the Custom Module definitions. This is the mechanism for moving the package to a test environment and then ultimately to the production environment. The Export button will produce a module loadable zip file, similar to the Publish functionality, except that when the zip file is installed, it will load the custom package into Module Builder for further editing. This is a good method for storing the custom package in case you would like to make changes to it in the future on another Sugar instance. Once your module has been deployed in a production environment, we highly recommend that you do not redeploy the module in Module Builder but modify the module using Studio as outlined in our Best Practices When Building Custom Modules.\nAfter the new package has been published, the administrator must commit the package to the Sugar system through the Module Loader. The administrator uploads the files and commits the new functionality to the live application instance.\nNote: Sugar Sell Essentials customers do not have the ability to upload custom file packages to Sugar using Module Loader.\nAdding Custom Logic Using Code\nWhile the key benefit of the Module Builder is that the Administrator user is able to create entirely new modules without the need to write code, there are still some tasks that require writing PHP code. For instance, adding custom logic or making a call to an external system through a Web Service. This can be done in one of two methods.\nLogic Hooks", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Builder/index.html"} {"id": "bca86f5e13d9-4", "text": "Logic Hooks\nOne way is by writing PHP code that leverages the event handlers, or \"logic hooks\", available in Sugar. In order to accomplish this, the developer must create the custom code and then add it to the manifest file for the \"Media Inquiry\" package. More information on creating logic hooks can be found in the Logic Hooks section. Information on adding a hook to your installer package can be found in the\u00c2\u00a0Creating an Installable Package for a Logic Hook example.\nCustom Bean files\nAnother method is to add code directly to the custom bean. This is a more complicated approach because it requires understanding the SugarBean class. However, it is a far more flexible and powerful approach.\nFirst, you must \"build\" your module. This can be done by either deploying your module or clicking the Publish button. Module Builder will then generate a folder for your package in ./custom/modulebuilder/builds/. Inside that folder is where Sugar will have placed the bean files for your new module(s). In this case, we want ./custom/modulebuilder/builds/MediaTracking/SugarModules/modules/jsche_mediarequest/\nInside you will find two files of interest. The first one is {module_name}sugar.php. This file is generated by Module Builder and may be erased by further changes in module builder or upgrades to the Sugar application. You should not make any changes to this file. The second is {module_name}.php. This is the file where you make any changes you would like to the logic of your module. To add our timestamp, we would add the following code to jsche_mediarequest.php\nfunction save($check_notify = FALSE)\n{\n global $current_user;\n $this->description .= \"Saved on \" . date(\"Y-m-d g:i a\"). \" by \". $current_user->user_name;\n parent::save($check_notify);\n}", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Builder/index.html"} {"id": "bca86f5e13d9-5", "text": "parent::save($check_notify);\n}\nThe call to the parent::save function is critical as this will call on the out of box SugarBean to handle the regular Save functionality. To finish, re-deploy or re-publish your package from Module Builder.\nYou can now upload this module, extended with custom code logic, into your Sugar application using the Module Loader as described earlier.\nUsing the New Module\nAfter you upload the new module, the new custom module appears in the Sugar instance. In this example, the new module, named \"Media\" uses the object template \"Issue\" to track incoming media inquiries. This new module is associated with the standard \"Contacts\" modules to show which journalist has expressed interest. In this example, the journalist has requested a product briefing. On one page, users can see the nature of the inquiry, the journalist who requested the briefing, who the inquiry was assigned to, the status, and the description.\nTopicsBest PracticesSugar provides two tools for building and maintaining custom module configurations: Module Builder and Studio. As an administrator of Sugar, it is important to understand the strengths of both tools so that you have a sound development process as you look to build on Sugar's framework.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Builder/index.html"} {"id": "df06082ec149-0", "text": "Best Practices\nOverview\nSugar provides two tools for building and maintaining custom module configurations: Module Builder and Studio. As an administrator of Sugar, it is important to understand the strengths of both tools so that you have a sound development process as you look to build on Sugar's framework.\nGoal\nThis guide will provide you with all the necessary steps from initial definition of your module to the configuration and customization of the module functionality. Follow these tips to ensure your development process will be sound:\nBuild Your Module in Module Builder\nBuild the initial framework for your module in Module Builder. Add all the fields you feel will be necessary for the module and construct the layouts with those fields. If possible, it is even better to create your custom modules in a development environment that mirrors your production environment.\nNever Redeploy a Package\nOnce a module has been promoted to a production environment, we recommend only making additional changes in Studio.\u00c2\u00a0Redeploying a package will remove all customizations related to your module in the following directories:\n./modules/\n./custom/modules/\n./custom/Extension/modules/\nThis includes workflows, code customizations, changes through Studio, and much more. It is imperative that this directive is followed to ensure any desired configurations remain intact. When working in Studio, you can make the following types of changes:\nadding a new field\nupdating the properties of a field that has been deployed with the module\nchanging field layouts\ncreating, modifying and removing relationships\nEvery Module in Module Builder Gets Its Very Own Package\nWhile it is possible to create multiple modules in a package, this can also cause design headaches down the road. If you end up wanting to uninstall a module and it is part of a larger package, all modules in that package would need to be uninstalled. Keeping modules isolated to their own packages allows greater flexibility in the future if a module is no longer needed.\nCreate Relationships in Studio After the Module Is Deployed", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Builder/Best_Practices_When_Building_Custom_Modules/index.html"} {"id": "df06082ec149-1", "text": "Create Relationships in Studio After the Module Is Deployed\nThis part is critical for success as relationships created in Module Builder cannot be removed after the module is deployed unless the package is updated and redeployed from Module Builder. Redeploying from Module Builder is what we are trying to avoid as mentioned above. If you deploy the module and then create the relationships in Studio, you can update or remove the relationships via Studio at any future point in time.\nDelete the Package from Module Builder Once It Is Deployed\nOnce the package is deployed, delete it from Module Builder so that it will not accidentally be redeployed. The only exception to this rule is in a development environment as you may want to continue working and testing until you are ready to move the module to your production environment. If you ever want to uninstall the module at a later date, you can do so under Admin > Module Loader.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Builder/Best_Practices_When_Building_Custom_Modules/index.html"} {"id": "c9c98e9f5287-0", "text": "Filters\nOverview\nFilters are a way to predefine searches\u00c2\u00a0on views that render a list of records\u00c2\u00a0such as list views, pop-up searches, and lookups.\u00c2\u00a0This page\u00c2\u00a0explains how\u00c2\u00a0to implement the various types of filters for record list views.\u00c2\u00a0\nFilters contain the following properties:\nProperty\nType\nDescription\nid\nString\nA unique identifier for the filter\nname\nString\u00c2\u00a0\nThe label key for the display label\u00c2\u00a0of the filter\nfilter_definition\nArray\nThe filter definition to apply to the results\neditable\nBoolean\u00c2\u00a0\nDetermines whether the user can edit the filter. Note:\u00c2\u00a0If you are creating a predefined filter for a user, this should be set to\u00c2\u00a0false\nis_template\nBoolean\nUsed with initial pop-up filters to determine if the\u00c2\u00a0filter is available as a template\nNote: If a filter contains custom fields, those fields must be search-enabled in Studio > {Module Name} > Layouts > Search.\nOperators\nOperators, defined in ./clients/base/filters/operators/operators.php, are expressions used by a\u00c2\u00a0filter to represent query\u00c2\u00a0operators. They are constructed in the\u00c2\u00a0filter_definition to help generate the appropriate query syntax that is sent to the database for a specific field type. Operators can be defined on a global or module level. The accepted paths are listed below:\n./clients/base/filters/operators/operators.php\n./custom/clients/base/filters/operators/operators.php\n./modules//clients/base/filters/operators.php\n./custom/modules//clients/base/filters/operators.php\nThe list of stock operators is shown below:\nOperator\nLabel / Key\nDescription\n$contains\nis any of / LBL_OPERATOR_CONTAINSUsed by multienum\nMatches anything that contains the value.\n$empty\nis empty / LBL_OPERATOR_EMPTYUsed by enum and tag\nMatches on empty values.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Filters/index.html"} {"id": "c9c98e9f5287-1", "text": "is empty / LBL_OPERATOR_EMPTYUsed by enum and tag\nMatches on empty values.\n$not_contains\nis not any of / LBL_OPERATOR_NOT_CONTAINSUsed by multienum\nMatches anything that does not contain the specified value.\n$not_empty\nis not empty / LBL_OPERATOR_NOT_EMPTYUsed by enum and tag\nMatches on non-empty values.\n$in\nis any of / LBL_OPERATOR_CONTAINSUsed by enum, int, relate, teamset, and tag\nFinds anything where field matches one of the values as specified as an array.\n$not_in\nis not any of / LBL_OPERATOR_NOT_CONTAINSUsed by enum, relate, teamset, and tag\nFinds anything where the field does not match any of the values in the specified array of values.\n$equals\nexactly matches / LBL_OPERATOR_MATCHESUsed by varchar, name, email, text, and textarea\nis equal to / LBL_OPERATOR_EQUALSUsed by currency, int, double, float, decimal, and date\nis / LBL_OPERATOR_ISUsed by bool, phone, radioenum, and parent\nPerforms an exact match on that field.\n$starts\nstarts with / LBL_OPERATOR_STARTS_WITHUsed by varchar, name, email, text, textarea, and phone\nis equal to / LBL_OPERATOR_EQUALSUsed by datetime and datetimecombo\nMatches on anything that starts with the value.\n$not_equals\nis not equal to / LBL_OPERATOR_NOT_EQUALSUsed by currency, int, double, float, and decimal\nis not / LBL_OPERATOR_IS_NOTUsed by radioenum\nMatches on non-matching values.\n$gt\nis greater than / LBL_OPERATOR_GREATER_THANUsed by currency, int, double, float, and decimal\nafter / LBL_OPERATOR_AFTERUsed by date\nMatches when the field is greater than the value.\n$lt", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Filters/index.html"} {"id": "c9c98e9f5287-2", "text": "Matches when the field is greater than the value.\n$lt\nis less than / LBL_OPERATOR_LESS_THANUsed by currency, int, double, float, and decimal\nbefore / LBL_OPERATOR_BEFOREUsed by date\nMatches when the field is less than the value.\n$gte\nis greater than or equal to / LBL_OPERATOR_GREATER_THAN_OR_EQUALSUsed by currency, int, double, float, and decimal\nafter / LBL_OPERATOR_AFTERUsed by datetime and datetimecombo\nMatches when the field is greater than or equal to the value\n$lte\nis less than or equal to / LBL_OPERATOR_LESS_THAN_OR_EQUALSUsed by currency, int, double, float, and decimal\nbefore / LBL_OPERATOR_BEFOREUsed by datetime and datetimecombo\nMatches when the field is less than or equal to the value.\n$between\nis between / LBL_OPERATOR_BETWEENUsed by currency, int, double, float, and decimal\nMatches when a numerical value is between two other numerical values.\nlast_7_days\nlast 7 days / LBL_OPERATOR_LAST_7_DAYSUsed by date, datetime, and datetimecombo\nMatches date in the last 7 days relative to the current date.\nnext_7_days\nnext 7 days / LBL_OPERATOR_NEXT_7_DAYSUsed by date, datetime, and datetimecombo\nMatches dates in the next 7 days relative to the current date.\nlast_30_days\nlast 30 days / LBL_OPERATOR_LAST_30_DAYSUsed by date, datetime, and datetimecombo\nMatches dates in the last 30 days relative to the current date.\nnext_30_days\nnext 30 days / LBL_OPERATOR_NEXT_30_DAYSUsed by date, datetime, and datetimecombo\nMatches dates in the next 30 days relative to the current date.\nlast_month\nlast month / LBL_OPERATOR_LAST_MONTHUsed by date, datetime, and datetimecombo", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Filters/index.html"} {"id": "c9c98e9f5287-3", "text": "last month / LBL_OPERATOR_LAST_MONTHUsed by date, datetime, and datetimecombo\nMatches dates in the previous month relative to the current month.\nthis_month\nthis month / LBL_OPERATOR_THIS_MONTHUsed by date, datetime, and datetimecombo\nMatches dates in the current month.\nnext_month\nnext month / LBL_OPERATOR_NEXT_MONTHUsed by date, datetime, and datetimecombo\nMatches dates in the next month relative to the current month.\nlast_year\nlast year / LBL_OPERATOR_LAST_YEARUsed by date, datetime, and datetimecombo\nMatches dates in the last year relative to the current year.\nthis_year\nthis year / LBL_OPERATOR_THIS_YEARUsed by date, datetime, and datetimecombo\nMatches dates in the current year.\nnext_year\nnext year / LBL_OPERATOR_NEXT_YEARUsed by date, datetime, and datetimecombo\nMatches dates in the next year relative to the current year.\n$dateBetween\nis between / LBL_OPERATOR_BETWEENUsed by date, datetime, and datetimecombo\nMatches dates between two given dates.\nyesterday\nyesterday / LBL_OPERATOR_YESTERDAYUsed by date, datetime, and datetimecombo\nMatches dates on yesterday relative to the current date.\ntoday\ntoday / LBL_OPERATOR_TODAYUsed by date, datetime, and datetimecombo\nMatches dates in the current date.\ntomorrow\ntomorrow / LBL_OPERATOR_TOMORROWUsed by date, datetime, and datetimecombo\nMatches dates on tomorrow relative to the current date.\nExample\nThe example below defines a filter where the type field must contain the value Customer and the name\u00c2\u00a0field must start with the letter\u00c2\u00a0A.\n$filters = array(\n array(\n 'type' => array(\n '$in' => array(\n 'Customer',\n ),\n ),\n ),\n array(", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Filters/index.html"} {"id": "c9c98e9f5287-4", "text": "'Customer',\n ),\n ),\n ),\n array(\n 'name' => array(\n '$starts' => 'A',\n ),\n ),\n);\nSub-Expressions\nSub-expressions group filter expressions into groupings. By default, all expressions are bound by an $and\u00c2\u00a0expression grouping.\u00c2\u00a0\nSub-Expression\nDescription\n$and\nJoins the filters in an \"and\" expression\n$or\nJoins the filters in an \"or\" expression\nNote: Sub-Expressions are only applicable to predefined filters and cannot be used for initial filters.\u00c2\u00a0\nThe example below defines a filter where the name field must begin with the letters\u00c2\u00a0A or C.\n$filters = array(\n '$or' => array (\n array(\n 'name' => array(\n '$starts' => 'A',\n ),\n ),\n array(\n 'name' => array(\n '$starts' => 'C',\n ),\n ),\n )\n);\nModule Expressions\nModule expressions\u00c2\u00a0operate on modules instead of specific fields. The current module can be specified by either using the module name _this or by leaving the module name as a blank string.\nModule Expression\nDescription\n$favorite\nFilters the records by the current users favorited items.\n$owner\nFilters the records by the assigned user.\nThe example below defines a filter where records must be favorited items.\n$filters = array(\n array(\n '$favorite' => '_this'\n ),\n);\nFilter Examples\nAdding Predefined Filters to the List View Filter List\nTo add a predefined filter to the module's list view, create a new filter definition extension, which will append the filter to the module's viewdefs.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Filters/index.html"} {"id": "c9c98e9f5287-5", "text": "The following example will demonstrate how to add a predefined filter on the Accounts module to return all records with an account type of \"Customer\" and industry of \"Other\".\nTo create a predefined filter, create a display label extension in \u00c2\u00a0./custom/Extension/modules//Ext/Language/. For this example, we will create:\n./custom/Extension/modules/Accounts/Ext/Language/en_us.filterAccountByTypeAndIndustry.php\n/Ext/clients/base/filters/basic/.\nFor this example,\u00c2\u00a0we will create:\n./custom/Extension/modules/Accounts/Ext/clients/base/filters/basic/filterAccountByTypeAndIndustry.php\n 'filterAccountByTypeAndIndustry',\n 'name' => 'LBL_FILTER_ACCOUNT_BY_TYPE_AND_INDUSTRY',\n 'filter_definition' => array(\n array(\n 'account_type' => array(\n '$in' => array(\n 'Customer',\n ),\n ),\n ),\n array(\n 'industry' => array(\n '$in' => array(\n 'Other',\n ),\n ),\n ),\n ),\n 'editable' => false,\n 'is_template' => false,\n);\nYou should notice that the editable and is_template options have been set to \"false\". If editable is not set to \"false\", the filter will not be displayed in the list view filter's list.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Filters/index.html"} {"id": "c9c98e9f5287-6", "text": "Finally, navigate to Admin > Repair and click \"Quick Repair and Rebuild\" to rebuild the extensions and make the predefined filter available for users.\nAdding Initial Filters to Lookup Searches\nTo add initial filters to record lookups and type-ahead searches, define a filter template. This will allow you\u00c2\u00a0to filter results for users when looking up a parent related record.\u00c2\u00a0The following example will demonstrate how to add an initial filter for the Account lookup on the Contacts module. This initial filter will limit records\u00c2\u00a0to having an\u00c2\u00a0account type of \"Customer\" and a dynamically assigned user value determined by the contact's assigned user.\nTo add an initial filter to the Contacts record view, create a display label for the filter in ./custom/Extension/modules//Ext/Language/.\u00c2\u00a0For this example , we will create:\n./custom/Extension/modules/Accounts/Ext/Language/en_us.filterAccountTemplate.php\n/Ext/clients/base/filters/basic/. For this example, create:\n./custom/Extension/modules/Accounts/Ext/clients/base/filters/basic/filterAccountTemplate.php\n 'filterAccountTemplate',\n 'name' => 'LBL_FILTER_ACCOUNT_TEMPLATE',\n 'filter_definition' => array(\n array(\n 'account_type' => array(\n '$in' => array(),\n ),\n ),\n array(\n 'assigned_user_id' => ''\n )\n ),\n 'editable' => true,\n 'is_template' => true,\n);", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Filters/index.html"} {"id": "c9c98e9f5287-7", "text": "'editable' => true,\n 'is_template' => true,\n);\nAs you can see, the filter_definition contains arrays for account_type and assigned_user_id. These filter definitions will receive their values from the contact record view's metadata. You should also note that this filter has\u00c2\u00a0is_template and editable set to \"true\". This is required for initial filters.\nOnce the filter template is in place, modify the contact record view's metadata. To accomplish this, edit ./custom/modules/Contacts/clients/base/views/record/record.php to adjust the account_name field. If this file does not exist in your local Sugar installation, navigate to Admin > Studio > Contacts > Layouts > Record View and click \"Save & Deploy\" to generate it. In this file, identify\u00c2\u00a0the panel_body array as shown below:\n1 => \narray (\n 'name' => 'panel_body',\n 'label' => 'LBL_RECORD_BODY',\n 'columns' => 2,\n 'labelsOnTop' => true,\n 'placeholders' => true,\n 'newTab' => false,\n 'panelDefault' => 'expanded',\n 'fields' => \n array (\n 0 => 'title',\n 1 => 'phone_mobile',\n 2 => 'department',\n 3 => 'do_not_call',\n 4 => 'account_name',\n 5 => 'email',\n ),\n),\nNext, modify the account_name field to contain the\u00c2\u00a0initial filter parameters.\u00c2\u00a0\n1 =>\narray (\n 'name' => 'panel_body',\n 'label' => 'LBL_RECORD_BODY',\n 'columns' => 2,\n 'labelsOnTop' => true,\n 'placeholders' => true,\n 'newTab' => false,", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Filters/index.html"} {"id": "c9c98e9f5287-8", "text": "'placeholders' => true,\n 'newTab' => false,\n 'panelDefault' => 'expanded',\n 'fields' =>\n array (\n 0 => 'title',\n 1 => 'phone_mobile',\n 2 => 'department',\n 3 => 'do_not_call',\n 4 => array (\n //field name\n 'name' => 'account_name',\n //the name of the filter template\n 'initial_filter' => 'filterAccountTemplate',\n //the display label for users\n 'initial_filter_label' => 'LBL_FILTER_ACCOUNT_TEMPLATE',\n //the hardcoded filters to pass to the templates filter definition\n 'filter_populate' => array(\n 'account_type' => array('Customer')\n ),\n //the dynamic filters to pass to the templates filter definition\n //please note the index of the array will be for the field the data is being pulled from\n 'filter_relate' => array(\n //'field_to_pull_data_from' => 'field_to_populate_data_to'\n 'assigned_user_id' => 'assigned_user_id',\n )\n ),\n 5 => 'email',\n ),\n),\nFinally, navigate to Admin > Repair and click\u00c2\u00a0\"Quick Repair and Rebuild\". This will rebuild the extensions and make the initial\u00c2\u00a0filter available for users when selecting a parent account for a contact.\nAdding Initial Filters to Drawers from a Controller\nWhen creating your own views, you may need to filter a drawer called from within your custom controller. Using an initial filter, as described in the Adding Initial Filters to Lookup Searches\u00c2\u00a0section, we can filter a drawer with predefined values by creating a filter object and\u00c2\u00a0populating the config.filter_populate\u00c2\u00a0property as shown below:\n//create filter", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Filters/index.html"} {"id": "c9c98e9f5287-9", "text": "//create filter\nvar filterOptions = new app.utils.FilterOptions()\n .config({\n 'initial_filter': 'filterAccountTemplate',\n 'initial_filter_label': 'LBL_FILTER_ACCOUNT_TEMPLATE',\n 'filter_populate': {\n 'account_type': ['Customer'],\n 'assigned_user_id': 'seed_sally_id'\n }\n })\n .format();\n//open drawer\napp.drawer.open({\n layout: 'selection-list',\n context: {\n module: 'Accounts',\n filterOptions: filterOptions,\n parent: this.context\n }\n});\nTo create a filtered drawer with dynamic values, create a filter object and populate the config.filter_relate property using the populateRelate method as shown below:\n//record to filter related fields by\nvar contact = app.data.createBean('Contacts', {\n 'first_name': 'John',\n 'last_name': 'Smith',\t\t\n 'assigned_user_id': 'seed_sally_id'\n});\n//create filter\nvar filterOptions = new app.utils.FilterOptions()\n .config({\n 'initial_filter': 'filterAccountTemplate',\n 'initial_filter_label': 'LBL_FILTER_ACCOUNT_TEMPLATE',\n 'filter_populate': {\n 'account_type': ['Customer'],\n },\n 'filter_relate': {\n 'assigned_user_id': 'assigned_user_id'\n }\n })\n .populateRelate(contact)\n .format();\n//open drawer\napp.drawer.open({\n layout: 'selection-list',\n context: {\n module: 'Accounts',\n filterOptions: filterOptions,\n parent: this.context\n }\n});\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Filters/index.html"} {"id": "db79c742d3c6-0", "text": "Logging\nOverview\nThere are two logging systems implemented in the Sugar application: SugarLogger and PSR-3.\u00c2\u00a0PSR-3\u00c2\u00a0is Sugar's preferred logger solution and should be used going forward.\nPSR-3\nPSR-3 compliant logging solution has been implemented based on PHP Monolog.\u00c2\u00a0\nLog Levels\nLog Level\nDescription\nDebug\nLogs events that help in debugging the application\nInfo\nLogs informational messages and database queries\nWarning\nLogs potentially harmful events\nNotice\nLogs messages for deprecated methods that are still in use.\nError\nLogs error events in the application\nAlert\nLogs severe error events that may cause the application to abort. This is the default and recommended level.\nCritical\nLogs events that may compromise the security of the application\nOff\nTurns off all logging\nWhen you specify a logging level, the system will record messages for the specified level as well as all higher levels. For example, if you specify \"Error\", the system records all Error, Fatal, and Security messages. More information on logging levels can be found in the\u00c2\u00a0logger level\u00c2\u00a0configuration documentation.\nConsiderations\nWhen you are not troubleshooting Sugar, the log level should be set\u00c2\u00a0to\u00c2\u00a0Fatal\u00c2\u00a0in\u00c2\u00a0Admin > System Settings > Logger Settings to\u00c2\u00a0ensure that your environment is not wasting unnecessary\u00c2\u00a0resources to write to the Sugar log.\nLogging Messages\nThe PSR-3 implementation in Sugar can also be used to log messages to the Sugar Log file. You can utilize the implementation to log to the Sugar log file using the default channel or you can specify your own custom channel if you want further control over when your custom logs should be displayed.\u00c2\u00a0\nuse \\Sugarcrm\\Sugarcrm\\Logger\\Factory;\n//Get the default Logger\n$Logger = Factory::getLogger('default');\n$Logger->debug('Debug level message');", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logging/index.html"} {"id": "db79c742d3c6-1", "text": "$Logger->debug('Debug level message'); \n$Logger->info('Info level message'); \n$Logger->notice('Notice level message');\n$Logger->warning('Warning level message'); \n$Logger->error('Error level message'); \n$Logger->critical('Critical level message');\n$Logger->alert('Alert level message');\n$Logger->emergency('Emergency level message');\n//Get a custom Log Channel\n$Logger = Factory::getLogger('my_logger');\nNote: For more information on using custom channels, adding custom log handlers and processors see the PSR-3 Logger\u00c2\u00a0documentation.\n\u00c2\u00a0\nSugarLogger\nThe SugarLogger class, located in ./include/SugarLogger/SugarLogger.php, allows for developers and system administrators to log system events to a log file. Sugar then determines which events to write to the log based on the system's Log Level. This can be set in Admin > System Settings.\nLog Levels\nLog Level\nDescription\nDebug\nLogs events that help in debugging the application\nInfo\nLogs informational messages and database queries\nWarn\nLogs potentially harmful events\nDeprecated\nLogs messages for deprecated methods that are still in use.\nError\nLogs error events in the application\nFatal\nLogs severe error events that may cause the application to abort. This is the default and recommended level.\nSecurity\nLogs events that may compromise the security of the application\nOff\nLogging is turned off\nWhen you specify a logging level, the system will record messages for the specified level as well as all higher levels. For example, if you specify \"Error\", the system records all Error, Fatal, and Security messages. More information on logging levels can be found in the logger level documentation.\nConsiderations", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logging/index.html"} {"id": "db79c742d3c6-2", "text": "Considerations\nWhen you are not troubleshooting Sugar, the log level should be set to Fatal\u00c2\u00a0in Admin > System Settings > Logger Settings to\u00c2\u00a0ensure that your environment is not wasting unnecessary\u00c2\u00a0resources to write to the Sugar log.\nLogging Messages\nUsing $GLOBALS['log']\nHow to log messages using $GLOBALS['log'] in the system.\n$GLOBALS['log']->debug('Debug level message'); \n$GLOBALS['log']->info('Info level message'); \n$GLOBALS['log']->warn('Warn level message');\n$GLOBALS['log']->deprecated('Deprecated level message');\n$GLOBALS['log']->error('Error level message');\n$GLOBALS['log']->fatal('Fatal level message');\n$GLOBALS['log']->security('Security level message');\nFor more information on the implementation, please refer to\u00c2\u00a0the\u00c2\u00a0SugarLogger documentation.\u00c2\u00a0\nUsing LoggerManager\nHow to log messages using the LoggerManager.\u00c2\u00a0\n$Logger = \\LoggerManager::getLogger();\n$Logger->debug('Debug level message');\n$Logger->info('Info level message');\n$Logger->warn('Warn level message');\n$Logger->deprecated('Deprecated level message');\n$Logger->error('Error level message');\n$Logger->fatal('Fatal level message');\n$Logger->security('Security level message');\nFor more information on the implementation, please refer to\u00c2\u00a0the\u00c2\u00a0SugarLogger\u00c2\u00a0documentation.\u00c2\u00a0\nLog Rotation", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logging/index.html"} {"id": "db79c742d3c6-3", "text": "Log Rotation\nThe\u00c2\u00a0SugarLogger\u00c2\u00a0will\u00c2\u00a0automatically rotate the logs when the\u00c2\u00a0logger.file.maxSize\u00c2\u00a0configuration setting has been met or exceeded. When this happens, the Sugar log will be renamed with an integer. For example, if the Sugar log was\u00c2\u00a0named \"sugarcrm.log, it will then be renamed \"sugarcrm_1.log\". The next log rotation after that would create \"sugarcrm_2.log\". This will occur until the\u00c2\u00a0logger.file.maxLogs\u00c2\u00a0configuration setting has been met. Once met, the\u00c2\u00a0log rollover will start over.\nDebugging Messages with _ppl()\nWhen developing, it may be beneficial for a developer to use _ppl()\u00c2\u00a0method to log a message to the Sugar log. The _ppl() method handles converting Objects, so you can quickly dump an entire object to the log while testing during development.\u00c2\u00a0\n_ppl('Debugging message');\nThis will write a message to the Sugar log that defines the message and file location. An example is shown below:\n------------------------------ _ppLogger() output start -----------------------------\nDebugging message\n------------------------------ _ppLogger() output end -----------------------------\n------------------------------ _ppLogger() file: myFile.php line#: 5-----------------------------\n\u00c2\u00a0Note: It is important that you remove _ppl() from your code for production use as it will affect system performance.\nTopicsCreating Custom LoggersCustom loggers, defined in ./custom/include/SugarLogger/, can be used to write log entries to a centralized application management tool or to write messages to a developer tool such as FirePHP.PSR-3 LoggerMonolog\\Handler\\HandlerInterfaceSugarLoggerThe SugarLogger is used for log reporting by the application. The following article outlines the LoggerTemplate interface as well as the LoggerManager object and explains how to programmatically use the SugarLogger.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logging/index.html"} {"id": "db79c742d3c6-4", "text": "Last modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logging/index.html"} {"id": "328c004d216b-0", "text": "SugarLogger\nOverview\nThe SugarLogger\u00c2\u00a0is used for log reporting by the application. The following article outlines the\u00c2\u00a0LoggerTemplate\u00c2\u00a0interface\u00c2\u00a0as well as the\u00c2\u00a0LoggerManager object and explains how to programmatically use the SugarLogger.\nLoggerTemplate\nThe LoggerManager manages those objects that implement the LoggerTemplate interface found in ./include/SugarLogger/LoggerTemplate.php.\u00c2\u00a0\nMethods\nlog($method, $message)\nThe LoggerTemplate has a single method that should be implemented, which is the log() method.\nArguments\nName\nType\nDescription\n$method\nString\nThe method or level which the Logger should handle the provided message\n$message\nString\nThe logged message\nImplementations\nSugar comes with two stock LoggerTemplate implementations that can be utilized for different scenarios depending on your needs. You can extend from these implementations or create your own class that implements the template as outlined in Creating Custom Loggers\u00c2\u00a0section.\nSugarLogger\nThe SugarLogger\u00c2\u00a0class, found in ./include/SugarLogger/SugarLogger.php, is the default system logging class utilized throughout the majority of Sugar.\u00c2\u00a0\nSugarPsrLogger\nThe SugarPsrLogger was added in Sugar 7.9 to accommodate the PSR-3\u00c2\u00a0compliant logging implementation. This logger works just like the SugarLogger object, however it uses the Monolog implementation of Logger.\nTo configure the SugarPsrLogger as the default system logger, you can add the following to your configuration:\n$sugar_config['logger']['default'] = 'SugarPsrLogger';\nLog Level Mappings", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logging/SugarLogger/index.html"} {"id": "328c004d216b-1", "text": "Log Level Mappings\nPSR-3 defines the set of log levels that should be implemented for all PHP Applications, however, these\u00c2\u00a0are different from the log levels defined by the\u00c2\u00a0SugarLogger. Below is the list of\u00c2\u00a0SugarLogger\u00c2\u00a0log levels and their\u00c2\u00a0SugarPsrLogger\u00c2\u00a0compatible mapping. All calls to the SugarLogger log levels are mapped according to the table below. For example, when using the\u00c2\u00a0SugarPsrLogger\u00c2\u00a0class, all calls to the\u00c2\u00a0\u00c2\u00a0fatal()\u00c2\u00a0method will map to the\u00c2\u00a0Alert\u00c2\u00a0log level.\nSugarLogger Level\nSugarPsrLogger Level\u00c2\u00a0(PSR-3)\nDebug\nDebug\nInfo\nInfo\nWarn\nWarning\nDeprecated\nNotice\nError\nError\nFatal\nAlert\nSecurity\nCritical\nLoggerManager\nThe LoggerManager Object acts as a singleton factory that sets up the configured logging object for use throughout the system. This is the object stored in $GLOBALS['log'] in the majority of use cases in the system.\nMethods\ngetLogger()\nThis method is used to get the currently configured Logger class.\nsetLevel($level)\nYou may find that you want to define the log level while testing your code without modifying the configuration. This can be done by using the setLevel() method.\nArguments\nName\nType\nDescription\n$level\nString\nThe method or level which the Logger should handle the provided message\nExample\n\\LoggerManager::getLogger()->setLevel('debug');\nNote: The use of setLevel should be removed from your code for production and it is important to note that it is restricted by package scanner as defined by the\u00c2\u00a0Module Loader Restrictions.\nassert($message, $condition)", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logging/SugarLogger/index.html"} {"id": "328c004d216b-2", "text": "assert($message, $condition)\nIn your custom code you may want to submit a debug level log, should a condition not meet your expectations. You could do this with an if statement, otherwise you could just use the assert() method as it allows you to pass the debug message, and the condition to check, and if that condition is FALSE a debug level message is logged.\nArguments\nName\nType\nDescription\n$message\nString\nThe log message\n$condition\nBoolean\nThe condition to check\nExample\n$x = 1;\n\\LoggerManager::getLogger()->assert('X was not equal to 0!', $x==0)\nwouldLog($level)\nIf in your customization you find that extra debugging is needed for particular area of code, and that extra work might have performance impacts on standard log levels, you can use the wouldLog() method to check the current log level before doing the extra work.\nArguments\nName\nType\nDescription\n$level\nString\nThe level\u00c2\u00a0to check against\u00c2\u00a0\nExample\nif (\\LoggerManager::getLogger()->wouldLog('debug')) {\n //Do extra debugging\n}\nsetLogger($level, $logger)\nThis method allows you to setup a second logger for a specific log level, rather than just using the same logger for all levels. Passing default\u00c2\u00a0as the level, will set the default Logger used by all levels in the system.\nArguments\nName\nType\nDescription\n$level\nString\nThe level\u00c2\u00a0to check against\u00c2\u00a0\n$logger\nString\nThe class name of an installed Logger\nExample\n//Set the debug level to a custom Logger\n\\LoggerManager::getLogger()->setLogger('debug', 'CustomLogger');\n//Set all other levels to SugarPsrLogger\n\\LoggerManager::getLogger()->setLogger('default', 'SugarPsrLogger');\ngetAvailableLoggers()", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logging/SugarLogger/index.html"} {"id": "328c004d216b-3", "text": "getAvailableLoggers()\nReturns a list of the names of Loggers found/installed in the system.\nArguments\nNone\nExample\n$loggers = \\LoggerManager::getLogger()->getAvailableLoggers();\ngetLoggerLevels()\nReturns a list of the names of Loggers found/installed in the system.\nArguments\nNone\nExample\n$levels = \\LoggerManager::getLogger()->getLoggerLevels();\nAdding a Custom SugarLogger\nCustom loggers are defined in ./custom/include/SugarLogger/, and can be used to write log entries to a centralized application management tool, to a developer tool such as FirePHP or even to a secondary log file inside the Sugar application.\nThe following is an example of how to create a FirePHP logger.\n./custom/include/SugarLogger/FirePHPLogger.php.\n';\nYou can also configure a different Logging Handler or Handlers for a specific channel:\n//Single Handler\n$sugar_config['logger']['channels']['test_channel']['handlers'] = '';\n//Multiple Channels\n$sugar_config['logger']['channels']['test_channel']['handlers'] = array('','');\nTo pass configuration properties to a Handler your configuration will need to look as follows:\n//For system handler\n$sugar_config['logger']['handlers']['']['host'] = '127.0.0.1';\n$sugar_config['logger']['handlers']['']['port'] = 12201;\n//For channel handlers\n$sugar_config['logger']['channels']['test_channel']['handlers']['']['host'] = '127.0.0.1';\n$sugar_config['logger']['channels']['test_channel']['handlers']['']['port'] = 12201;\n$sugar_config['logger']['channels']['test_channel']['handlers']['']['level'] = 'debug';\nNote: For more information, please refer to the logger.channels.channel.handlers documentation.\nFormatters\nFormatters are a component of the Handler Object. By default Sugar only comes with a single Formatter, which is the BackwardCompatibleFormatter used by the File Handler, which simply assures that Log messages are consistent with the legacy Logging functionality. Formatters are used and built out in accordance with the Monolog framework, and under the majority of circumstances, building out a custom formatter is not necessary. For more information on Formatters, you can review the Monolog repository.\nProcessors", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logging/PSR-3_Logger/index.html"} {"id": "8343d30ea6a5-3", "text": "Processors\nProcessors provide a way to add more information to Log messages, without having to hard code this information inside the Handler, so that it can be used only when necessary. For example, Sugar's PSR-3 Logging implementation provides two default Processors that can be enabled for a given channel or handler via configuration. These Processors provide functionality such as adding a stack trace or the web request information\u00c2\u00a0to the log message to provide further debugging context.\nFactory Interface\nThe Factory Interface for processors\u00c2\u00a0is used to implement a Logging Processor, so that the Logger Factory can build out the configured handler for a channel, without a lot of work from external developers. The\u00c2\u00a0Processor\u00c2\u00a0Factory Interface is located in ./src/Logger/Processor/Factory.php\u00c2\u00a0or in code at\u00c2\u00a0\\Sugarcrm\\Sugarcrm\\Logger\\Handler\\Factory\u00c2\u00a0namespace.\nMethods\nThere is only one method to implement for\u00c2\u00a0a\u00c2\u00a0Processor Factory, which is the\u00c2\u00a0create()\u00c2\u00a0method. This method will contain the necessary Logic to set up the Processor object.\u00c2\u00a0\ncreate($config)\nArguments\nName\nType\nDescription\n$config\nArray\nThe config parameters set for the\u00c2\u00a0processor\u00c2\u00a0in the Sugar config file\nReturns\nCallable - See Customization section for an example of implementation, otherwise review the included Processor Factory implementations in code in ./src/Logger/Processor/Factory/.\nImplementations\nBy default, Sugar comes with two\u00c2\u00a0Processor\u00c2\u00a0implementations, \\Sugarcrm\\Sugarcrm\\Logger\\Processor\\BacktraceProcessor and\u00c2\u00a0\\Sugarcrm\\Sugarcrm\\Logger\\Processor\\RequestProcessor.\u00c2\u00a0\nBacktraceProcessor", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logging/PSR-3_Logger/index.html"} {"id": "8343d30ea6a5-4", "text": "BacktraceProcessor\nAs the name implies, the BacktraceProcessor appends a backtrace or stack trace to the log message output, to easily trace where and how the log message came from. The Factory implementation for this Processor lives in\u00c2\u00a0./src/Logger/Processor/Factory/Backtrace.php, and is referenced in the sugar config as backtrace.\nThe following shows an example of the output that occurs when utilizing this processor:\nFri Mar 23 09:24:19 2018 [90627][1][FATAL] ; Call Trace: \\n0: /var/www/Ent/71110/custom/SugarQueryLogger.php:43 - Sugarcrm\\Sugarcrm\\Logger\\BackwardCompatibleAdapter::fatal()\\n2: /var/www/Ent/71110/include/utils/LogicHook.php:270\\n3: /var/www/Ent/71110/include/utils/LogicHook.php:160 - LogicHook::process_hooks()\\n4: /var/www/Ent/71110/data/SugarBean.php:6684 - LogicHook::call_custom_logic()\\n5: /var/www/Ent/71110/data/SugarBean.php:3317 - SugarBean::call_custom_logic()\\n6: /var/www/Ent/71110/clients/base/api/FilterApi.php:632 - SugarBean::fetchFromQuery()\\n7: /var/www/Ent/71110/clients/base/api/FilterApi.php:397 - FilterApi::runQuery()\\n8: /var/www/Ent/71110/include/api/RestService.php:257 - FilterApi::filterList()\\n9: /var/www/Ent/71110/api/rest.php:23 - RestService::execute()\nNote: when viewing complex logs, you can use the following to print log entries in a more human readable format:\ncat sugarcrm.log | sed s/\\\\n/\\n/g", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logging/PSR-3_Logger/index.html"} {"id": "8343d30ea6a5-5", "text": "cat sugarcrm.log | sed s/\\\\n/\\n/g\nRequestProcessor\nThe RequestProcessor appends\u00c2\u00a0Session properties to the Log message that would help identify the request that caused the log message. The Factory implementation for this Processor lives in ./src/Logger/Processor/Factory/Request.php, and is referenced in the sugar config as request.\nThe following list of session properties are appended to the log:\nUser ID\nClient ID (OAuth2 Client)\nPlatform\nThe following shows an example of the output that occurs when utilizing this processor:\nMon Mar 26 09:48:58 2018 [5930][1][FATAL] ; User ID=1; Client ID=sugar; Platform=base\nConfiguration\nTo configure the default Logging Handler for Sugar to utilize the built-in processors:\n//Configure a single Processor\n$sugar_config['logger']['channels']['default']['processors'] = 'backtrace';\n//Configure multiple Processors\n$sugar_config['logger']['channels']['default']['processors'] = array('backtrace','request');\nYou can also configure different channels to utilize the processors:\n//Single Processors\n$sugar_config['logger']['channels']['']['processors'] = 'backtrace';\n//Multiple Channels\n$sugar_config['logger']['channels']['']['processors'] = array('backtrace','request');\nTo pass configuration properties to a\u00c2\u00a0Processor\u00c2\u00a0your configuration will need to look as follows:\n$sugar_config['logger']['channels']['']['processors']['']['config_key'] = 'test_value';\nNote: For more information, please refer to the logger.channels.channel.processors documentation.\nUsage", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logging/PSR-3_Logger/index.html"} {"id": "8343d30ea6a5-6", "text": "Note: For more information, please refer to the logger.channels.channel.processors documentation.\nUsage\nAs previously mentioned the Logger Factory allows for multiple channels to be configured independently of each other. The following examples will showcase how to use the Logger Factory to get a channel's Logger and use it in code, as well as how to configure the system to use multiple channels with different configurations.\nBasic Usage\nuse \\Sugarcrm\\Sugarcrm\\Logger\\Factory;\n//Retrieve the default Logger\n$DefaultLogger = Factory::getLogger('default');\n$DefaultLogger->alert('This is a log message');\nConfiguring Channels\nThe following is an example of the ./config_override.php file that would configure two different channels at different log levels, using the logger.channel.channel.level configuration setting. These two channels would allow for portions of the code to Log messages at Debug (and higher) levels, and other portions to only log Info (and higher) levels.\n$config['logger']['channels']['default'] = array(\n 'level' => 'alert'\n);\n$config['logger']['channels']['channel1'] = array(\n 'level' => 'debug'\n);\nThe following code example shows how to\u00c2\u00a0retrieve the above-configured channels and use the Logger for each channel.\u00c2\u00a0\nuse \\Sugarcrm\\Sugarcrm\\Logger\\Factory;\n//Retrieve the default Logger\n$DefaultLogger = Factory::getLogger('default');\n$DefaultLogger->info(\"This message will not display\");\n//Channel1 Logger\n$Channel1Logger = Factory::getLogger('channel1');\n$Channel1Logger->info(\"This message will display\");", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logging/PSR-3_Logger/index.html"} {"id": "8343d30ea6a5-7", "text": "$Channel1Logger->info(\"This message will display\");\nIn the example above, assuming a stock system with the previously mentioned config values set in config_override.php, the default channel logger would be set to Alert level logging, and therefore would not add the info level log to the Log file, however, the channel11 Logger would add the log message to the Sugar log file, since it is configured at the info log level.\nDefault Channels\nBy default, Sugar has a few areas of the system that utilize a different channel than the default. The usage of these channels means that you can configure the log level and processors differently for those areas, without inundating the log file with lower level logs from other areas of the system.\nChannel\nDescription\nauthentication\nThis logger channel is utilized by the AuthenticationController, and can show useful information about failed login attempts.\u00c2\u00a0\ninput_validation\nThis logger channel is utilized by the Input Validation framework and can display information regarding failed validations.\nmetadata\nThis logger channel is utilized by the MetadataManager and mainly provides information on when rebuilds occur.\nrest\nThis channel is utilized by the\u00c2\u00a0RestService object.\ndb\nThis channel is utilized by the databse for query logging.\nCustomization\nYou can use custom channels where ever you would like in your customizations, and configure them as outlined above, but if you need to send logs somewhere other than the Sugar log file, you will need to build out your own Handler. The following will walk through adding a custom Logging Handler that utilizes Monologs built-in Chrome Logger.\nAdding a Custom Handler\nCreate the following file in ./custom/src/Logger/Handler/Factory/ folder.\n./custom/src/Logger/Handler/Factory/Chrome.php\n']['handlers'] = 'Chrome';\n\u00c2\u00a0Note: For more information, please refer to the\u00c2\u00a0logger.channels.channel.handlers\u00c2\u00a0documentation.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logging/PSR-3_Logger/index.html"} {"id": "22c04ab727db-0", "text": "Creating Custom Loggers\nCustom Loggers\nCustom loggers,\u00c2\u00a0defined in ./custom/include/SugarLogger/, can be used to write log entries to a centralized application management tool or to write messages to a developer tool such as FirePHP.\nTo do this, you can create a new instance class that implements the LoggerTemplate interface. The following is an example of how to create a FirePHP logger.\n./custom/include/SugarLogger/FirePHPLogger.php.\n\nThis is used to show\u00c2\u00a0how an email address record relates to a record\u00c2\u00a0in any\u00c2\u00a0module is set on bean_module. If bean_module is set to Contacts, \u00c2\u00a0would be the contacts table.\nThe following diagram illustrates table relationships between email addresses and other modules, email addresses and email records, and email records and other modules.\nHelper Queries\nRetrieve the Primary Email Address of a Contact\nThe following query will fetch the email address given a specific contacts id:\nSELECT\n email_address\nFROM email_addresses\nJOIN email_addr_bean_rel eabr\n ON eabr.email_address_id = email_addresses.id\nWHERE eabr.bean_module = \"Contacts\"\nAND eabr.bean_id = \"\"\nAND email_addresses.invalid_email = 0\nAND eabr.deleted = 0\nAND eabr.primary_address = 1;\nRetrieve All Records Related to an Email Address\nThe following query will fetch the id and module name of all records related to the specified email address:\nSELECT\n bean_module,\n bean_id\nFROM email_addr_bean_rel eabr\nJOIN email_addresses\n ON eabr.email_address_id = email_addresses.id\nWHERE email_addresses.email_address = \"\"\nAND eabr.deleted = 0;\nRetrieve All Emails Sent From An Email Address\nThe following query will fetch\u00c2\u00a0all emails sent from a\u00c2\u00a0specified email address:\nSELECT\n emails.name,\n emails.date_sent\nFROM emails\nJOIN emails_email_addr_rel eear\n ON eear.email_id = emails.id\nJOIN email_addresses\n ON eear.email_address_id = email_addresses.id\nWHERE email_addresses.email_address = \"\"", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Email/index.html"} {"id": "e2900925ce9a-2", "text": "WHERE email_addresses.email_address = \"\"\nAND eear.address_type = \"from\"\nAND eear.deleted = 0\nCleanup Duplicate Email Addresses\nThe following queries will remove any duplicate\u00c2\u00a0email addresses.\n\u00c2\u00a0First, create a\u00c2\u00a0temporary table\u00c2\u00a0with distinct records from the\u00c2\u00a0email_addr_bean_rel table:\ncreate table email_addr_bean_rel_tmp_ful\nSELECT\n *\nFROM email_addr_bean_rel\nWHERE deleted = '0'\nGROUP BY email_address_id,\n bean_module,\n bean_id\nORDER BY primary_address DESC;\nNext, clear out the email_addr_bean_rel table:\ntruncate email_addr_bean_rel;\nMove the records from the temporary table back to\u00c2\u00a0email_addr_bean_rel:\nINSERT INTO email_addr_bean_rel\n SELECT\n *\n FROM email_addr_bean_rel_tmp;\nValidate that all of the duplicates have been removed:\nSELECT\n COUNT(*) AS repetitions,\n date_modified,\n bean_id,\n bean_module\nFROM email_addr_bean_rel\nWHERE deleted = '0'\nGROUP BY bean_id,\n bean_module,\n email_address_id\nHAVING repetitions > 1;\nFinally, remove the temporary table:\ndrop table email_addr_bean_rel_tmp;\nEmail Address Validation\nSugar validates emails addresses according to the\u00c2\u00a0RFC 5321\u00c2\u00a0and\u00c2\u00a0RFC 5322\u00c2\u00a0standards. The following sections will detail how a developer can validate email addresses both server and client side.\nServer Side\nTo validate an email address in a server-side context, the EmailAddress::isValidEmail() static method should be used. For example:\n$emailAddress = \"test@example.com\";\n$isValid = EmailAddress::isValidEmail($emailAddress);", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Email/index.html"} {"id": "e2900925ce9a-3", "text": "$isValid = EmailAddress::isValidEmail($emailAddress);\nThe\u00c2\u00a0EmailAddress::isValidEmail method leverages the PHPMailer library bundled with Sugar, specifically the PHPMailer::validateAddress method, which validates the address\u00c2\u00a0according to the\u00c2\u00a0RFC 5321\u00c2\u00a0and RFC 5322 standards.\nClient Side\nTo validate an email address client-side context, the\u00c2\u00a0app.utils.isValidEmailAddress()\u00c2\u00a0function can be used.\nvar emailAddress = \"test@example.com\";\nvar isValid = app.utils.isValidEmailAddress(emailAddress);\nNote: This function is more permissive and does not conform exactly to the RFC standards used on the server. As such, the\u00c2\u00a0email address\u00c2\u00a0will be validated again on the\u00c2\u00a0server\u00c2\u00a0when the\u00c2\u00a0record is saved, which could still fail validation.\nTopicsMailer FactoryThe Mailer Factory, located in ./modules/Mailer/MailerFactory.php, helps developers generate outbound mailers for the system account as well as individual user accounts. The Mailer Factory is a replacement for SugarPHPMailer which is now deprecated.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Email/index.html"} {"id": "38a8561fe5ef-0", "text": "Mailer Factory\nOverview\nThe Mailer Factory, located in ./modules/Mailer/MailerFactory.php, helps developers generate outbound mailers\u00c2\u00a0for the system account as well as individual user accounts. The Mailer Factory is a replacement for SugarPHPMailer which is now deprecated.\nMailers\nThere are\u00c2\u00a0two types of outbound mailers:\u00c2\u00a0System and\u00c2\u00a0User. The follow sections will outline how to use each.\nSystem Mailer\nThe\u00c2\u00a0system outbound mailer can be set\u00c2\u00a0using the\u00c2\u00a0getSystemDefaultMailer\u00c2\u00a0method. This will set the mailer to use the system outbound email account.\u00c2\u00a0\nExample\n$mailer = MailerFactory::getSystemDefaultMailer();\nUser Mailer\nThe user outbound mailer can be set\u00c2\u00a0using the getMailerForUser\u00c2\u00a0method. This will set the mailer to use the outbound email account for a specific user.\u00c2\u00a0\nExample\n$user = BeanFactory::getBean(\"Users\", 1);\n$mailer = MailerFactory::getMailerForUser($user);\nPopulating the Mailer\nSetting the Subject\nTo set the email subject, use the\u00c2\u00a0setSubject method. It accepts a plain text string.\nExample\n$mailer->setSubject(\"Test Mail Subject\");\nSetting the Body\nDepending on your email type, you can use the setTextBody\u00c2\u00a0and/or setHtmlBody methods respectively to populate the content of the email body.\nExample\n// Text Body\n$mailer->setTextBody(\"This is a text body message\");\n// HTML Body\n$mailer->setHtmlBody(\"This is an HTML body message.
You can use html tags.\");\nNote:\u00c2\u00a0The email HTML body is not necessary if you have populated the text body.\nAdding Recipients", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Email/Mailer_Factory/index.html"} {"id": "38a8561fe5ef-1", "text": "Adding Recipients\nTo add recipients to your email, you can use the\u00c2\u00a0addRecipientsTo, addRecipientsCc, or addRecipientsBcc methods . These methods require an EmailIdentity object as a parameter.\nExample\n$mailer->addRecipientsTo(new EmailIdentity('user1@yourcompany.crm', 'User 1'));\n$mailer->addRecipientsCc(new EmailIdentity('user2@yourcompany.crm', 'User 2'));\n$mailer->addRecipientsBcc(new EmailIdentity('user3@yourcompany.crm', 'User 3'));\nClearing Recipients\nYou can clear the current recipients specified in the mailer by using the clearRecipients method.\nExample\n$to = true; \n$cc = true; \n$bcc = true;\n$mailer->clearRecipients($to, $cc, $bcc);\nAdding Attachments\nTo add attachments,\u00c2\u00a0use the\u00c2\u00a0addAttachment method.\nExample\n$path = \"/path/to/your/document\";\n$mailer->addAttachment(new Attachment($path));\nSending Emails\nOnce your email is populated, you can send it using the\u00c2\u00a0send method. The\u00c2\u00a0send method will return\u00c2\u00a0the content of the mail. If the Mailer Factory experiences an error, it will throw an exception. It is highly recommended to use a try and catch when sending emails.\nExample\n$mailSubject = \"Test Mail Subject\";\n$mailHTML = \"

SugarCRM


Test body message\";\n$mailTo = array(\n 0 => array(\n 'name' => 'Test User',\n 'email' => 'test@yourcompany.crm',\n ),\n 1 => array(\n 'name' => 'Other Recipient',\n 'email' => 'email@addres'\n )\n);", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Email/Mailer_Factory/index.html"} {"id": "38a8561fe5ef-2", "text": "'email' => 'email@addres'\n )\n);\n$mailAttachment = \"/path/to/pdf/files/document.pdf\";\ntry {\n $mailer = MailerFactory::getSystemDefaultMailer();\n $mailTransmissionProtocol = $mailer->getMailTransmissionProtocol();\n $mailer->setSubject($mailSubject);\n $body = trim($mailHTML);\n $textOnly = EmailFormatter::isTextOnly($body);\n if ($textOnly) {\n $mailer->setTextBody($body);\n } else {\n $textBody = strip_tags(br2nl($body)); // need to create the plain-text part\n $mailer->setTextBody($textBody);\n $mailer->setHtmlBody($body);\n }\n $mailer->clearRecipients();\n foreach ($mailTo as $mailTo) {\n $mailer->addRecipientsTo(new \\EmailIdentity($mailTo['email'], $mailTo['name']));\n }\n $mailer->addAttachment(new \\Attachment($mailAttachment));\n $result = $mailer->send();\n if ($result) {\n // $result will be the body of the sent email\n } else {\n // an exception will have been thrown\n }\n} catch (MailerException $me) {\n $message = $me->getMessage();\n switch ($me->getCode()) {\n case \\MailerException::FailedToConnectToRemoteServer:\n $GLOBALS[\"log\"]->fatal(\"BeanUpdatesMailer :: error sending email, system smtp server is not set\");\n break;\n default:\n $GLOBALS[\"log\"]->fatal(\"BeanUpdatesMailer :: error sending e-mail (method: {$mailTransmissionProtocol}), (error: {$message})\");\n break;\n }\n}", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Email/Mailer_Factory/index.html"} {"id": "38a8561fe5ef-3", "text": "break;\n }\n}\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Email/Mailer_Factory/index.html"} {"id": "9332f9cb19f0-0", "text": "Duplicate Check\nOverview\nThe duplicate-check framework provides the capability to alter how the system searches for duplicate records in the database when creating records. For information on duplicate checking during imports, please refer to the index documentation.\nDefault Strategy\nThe default duplicate-check strategy, located in ./data/duplicatecheck/FilterDuplicateCheck.php, is referred to as FilterDuplicateCheck. This strategy utilizes the Filter API\u00c2\u00a0and a defined filter in the vardefs of the module to search for duplicates and rank them based on matching data.\nCustom Filter\nTo alter a defined filter for a stock\u00c2\u00a0a module, you only need to update the Vardefs using the Extensions framework. If you are working with a custom module, you can modify the vardefs in\u00c2\u00a0./modules//vardefs.php directly. The FilterDuplicateCheck Strategy accepts two properties in its metadata:\nName\nType\nDescription\nfilter_template\narray\nAn array containing the Filter Definition for which fields to search for duplicates on. Please consult the Filter API for further information on the filter syntax\nranking_fields\narray\nA list of arrays with the following properties. The order in which you list the fields for ranking will determine the ranking score. The first ranks higher, than those after it.\nin_field_name: Name of field in vardefs\ndupe_field_name: Name of field returned by filter\nExample\nThe following example will demonstrate how to manipulate the stock Accounts duplicate check to not filter\u00c2\u00a0on the shipping address city. The default Account\u00c2\u00a0duplicate_check defintion, located in ./modules/Accounts/vardefs.php, is shown below.\n...\n'duplicate_check' => array(\n 'enabled' => true,\n 'FilterDuplicateCheck' => array(\n 'filter_template' => array(\n array(\n '$or' => array(\n array('name' => array('$equals' => '$name')),", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Duplicate_Check/index.html"} {"id": "9332f9cb19f0-1", "text": "array('name' => array('$equals' => '$name')),\n array('duns_num' => array('$equals' => '$duns_num')),\n array(\n '$and' => array(\n array('name' => array('$starts' => '$name')),\n array(\n '$or' => array(\n array('billing_address_city' => array('$starts' => '$billing_address_city')),\n array('shipping_address_city' => array('$starts' => '$shipping_address_city')),\n )\n ),\n )\n ),\n )\n ),\n ),\n 'ranking_fields' => array(\n array('in_field_name' => 'name', 'dupe_field_name' => 'name'),\n array('in_field_name' => 'billing_address_city', 'dupe_field_name' => 'billing_address_city'),\n array('in_field_name' => 'shipping_address_city', 'dupe_field_name' => 'shipping_address_city'),\n )\n )\n),\n...\n\u00c2\u00a0To add or remove fields from the check, you will need to manipulate\u00c2\u00a0$dictionary['']['duplicate_check']['FilterDuplicateCheck']['filter_template']\u00c2\u00a0and \u00c2\u00a0\u00c2\u00a0$dictionary['']['duplicate_check']['FilterDuplicateCheck']['ranking_fields']\u00c2\u00a0. For our example, we will simply remove the references to\u00c2\u00a0shipping_address_city. \u00c2\u00a0It is important to familiarize yourself with filter operators before making any changes.\n./custom/Extension/modules/Accounts/Ext/Vardefs/newFilterDuplicateCheck.php\n array(\n array(\n '$or' => array(\n array('name' => array('$equals' => '$name')),", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Duplicate_Check/index.html"} {"id": "9332f9cb19f0-2", "text": "array('name' => array('$equals' => '$name')),\n array('duns_num' => array('$equals' => '$duns_num')),\n array(\n '$and' => array(\n array('name' => array('$starts' => '$name')),\n array(\n '$or' => array(\n array('billing_address_city' => array('$starts' => '$billing_address_city')),\n )\n ),\n )\n ),\n )\n ),\n ),\n 'ranking_fields' => array(\n array('in_field_name' => 'name', 'dupe_field_name' => 'name'),\n array('in_field_name' => 'billing_address_city', 'dupe_field_name' => 'billing_address_city'),\n )\n);\nFinally, navigate to Admin > Repair > Quick Repair and Rebuild. The system will then enable the custom duplicate-check class.\nIf you want to disable the duplicate check entirely, you can set\u00c2\u00a0$dictionary['']['duplicate_check']['enabled'] to false in your vardefs and run a Quick Repair and Rebuild.\n$dictionary['Account']['duplicate_check']['enabled'] = false;\nCustom Strategies\nCustom duplicate-check class files are stored under ./custom/data/duplicatecheck/. The files in this directory can be enabled on a module's duplicate_check property located in\u00c2\u00a0./custom/Extension/modules//Ext/Vardefs/. Only one duplicate-check class can be enabled on a module at a given time.\nDuplicate Check Class\nTo create a custom duplicate-check strategy, you need to create a custom duplicate-check class that extends the base DuplicateCheckStrategy, ./data/duplicatecheck/DuplicateCheckStrategy.php. To work, this custom class requires the implementation of two methods:\nMethod Name\nDescription\nsetMetadata", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Duplicate_Check/index.html"} {"id": "9332f9cb19f0-3", "text": "Method Name\nDescription\nsetMetadata\nSets up properties for duplicate-check logic based on the passed-in metadata\nfindDuplicates\nFinds possible duplicate records for a given set of field data\nExample\nThe following example will create a new duplicate-check class called \"OneFieldDuplicateCheck\" that will query the database based on the configured field for records that contain data similar to that one field:\n./custom/data/duplicatecheck/OneFieldDuplicateCheck.php\nfield = $metadata['field'];\n }\n }\n public function findDuplicates()\n {\n if (empty($this->field)){\n return null;\n }\n $Query = new SugarQuery();\n $Query->from($this->bean);\n $Query->where()->ends($this->field,$this->bean->{$this->field});\n $Query->limit(10);\n //Filter out the same Bean during Edits\n if (!empty($this->bean->id)) { \n $Query->where()->notEquals('id',$this->bean->id);\n }\n $results = $Query->execute();\n return array(\n 'records' => $results\n );\n }\n}\nVardef Settings\nThe duplicate-check vardef settings are configured on each module and can be altered using the Extension framework.\nName\nType\nDescription\nenabled\nboolean\nWhether or not duplicate-check framework is enabled on the module\n\narray", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Duplicate_Check/index.html"} {"id": "9332f9cb19f0-4", "text": "boolean\nWhether or not duplicate-check framework is enabled on the module\n\narray\nThe class name that will provide duplicate checking, set to an array of metadata that gets passed to the duplicate-check class\n\u00c2\u00a0If you want to enable the OneFieldDuplicateCheck strategy (shown above) for the Accounts module, you must create the following file:\n./custom/Extension/modules/Accounts/Ext/Vardefs/newDuplicateCheck.php\n true,\n\t'OneFieldDuplicateCheck' => array(\n 'field' => 'name'\n )\n);\nFinally, navigate to Admin > Repair > Quick Repair and Rebuild. The system will then enable the custom duplicate-check class.\nProgrammatic Usage\nYou can also use the duplicate-check framework in code such as in a logic hook or a scheduler. The following example shows how to use the module's defined duplicate-check strategy when utilizing a bean object by simply calling the findDuplicates method on the bean object:\n$account = BeanFactory::newBean('Accounts');\n$account->name = 'Test';\n$duplicates = $account->findDuplicates();\nif (count($duplicates['records'])>0){\n $GLOBALS['log']->fatal(\"Duplicate records found for Account\");\n}\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Duplicate_Check/index.html"} {"id": "7672fbafcfbb-0", "text": "Administration\nOverview\nThe Administration class is used to manage settings stored in the database config table.\nThe Administration Class\nThe Administration class is located in ./modules/Administration/Administration.php. Settings modified using this class are written to the config table.\nCreating / Updating Settings\nTo create or update a specific setting, you can specify the new value using the\u00c2\u00a0saveSetting() function as shown here:\nrequire_once 'modules/Administration/Administration.php';\n$administrationObj = new Administration();\n//save the setting\n$administrationObj->saveSetting(\"MyCategory\", \"MySetting\", 'MySettingsValue');\nRetrieving Settings\nYou can access the config settings by using the\u00c2\u00a0retrieveSettings() function. You can filter the settings by category by passing in a filter parameter. If no value is passed to retrieveSettings(), all settings will be returned. An example is shown here:\nrequire_once 'modules/Administration/Administration.php';\n$administrationObj = new Administration();\n//Retrieve all settings in the category of 'MyCategory'.\n//This parameter can be left empty to retrieve all settings.\n$administrationObj->retrieveSettings('MyCategory');\n//Use a specific setting\n$MySetting = $administrationObj->settings['MyCategory_MySetting'];\nConsiderations\nThe Administration class will store the settings in the config table, and the config table is cached using SugarCache as the admin_settings_cache.\u00c2\u00a0This class should be used for storing dynamic settings for a module, connector or the system as a whole, such as the last run date (for a scheduler) or an expiring token (for a connector). You should not use the Administration class to store User-based settings, settings that are frequently changing or being written to via the API, or excessively large values, as this can degrade the performance of the instance since all settings are loaded into the admin_settings_cache, which is used throughout the system.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Administration/index.html"} {"id": "7672fbafcfbb-1", "text": "Alternatively, you can use the Configurator class, located in ./modules/Configurator/Configurator.php, to store the settings in the ./config_override.php file if the settings are not dynamic or not changing programmatically. It\u00c2\u00a0is important to note that settings stored using the configurator will cause a metadata hash refresh that may lead to users being logged out of the system.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Administration/index.html"} {"id": "f390d9de93dc-0", "text": "Configurator\nOverview\nThe Configurator class, located in ./modules/Configurator/Configurator.php,\u00c2\u00a0handles the config settings found in ./config.php and ./config_override.php.\nRetrieving Settings\nYou can access the Sugar config settings by using the global variable $GLOBALS['sugar_config'] as shown below:\nglobal $sugar_config;\n//Use a specific setting\n$MySetting = $sugar_config['MySetting'];\nIf you should need to reload the config settings, this is an example of how to retrieve a specific setting using the configurator:\nrequire_once 'modules/Configurator/Configurator.php';\n$configuratorObj = new Configurator();\n//Load config\n$configuratorObj->loadConfig();\n//Use a specific setting\n$MySetting = $configuratorObj->config['MySetting'];\nCreating / Updating Settings\nTo create or update a specific setting, you can specify the new value using the configurator as shown below:\nrequire_once 'modules/Configurator/Configurator.php';\n$configuratorObj = new Configurator();\n//Load config\n$configuratorObj->loadConfig();\n//Update a specific setting\n$configuratorObj->config['MySetting'] = \"MySettingsValue\";\n//Save the new setting\n$configuratorObj->saveConfig();\nConsiderations\nWhen looking to store custom settings, the Configurator class will store the settings in the ./config_override.php file. This class should only be used for long-term\u00c2\u00a0configuration options as\u00c2\u00a0Configurator->saveConfig() will trigger a metadata refresh that may log users out of the system.\nAlternatively, you can use the Administration class, located in ./modules/Administration/Administration.php, to store settings in the config table in the database.\u00c2\u00a0This Administration\u00c2\u00a0class should be used for storing dynamic settings such as a last run date or an expiring token.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/index.html"} {"id": "f390d9de93dc-1", "text": "TopicsCore SettingsSugar configuration settings.Silent Installer SettingsThe Sugar silent installer facilitates and automates the installation of the Sugar application after the files have been copied onto the server. This is done by populating correct parameters in a configuration file and then making a web request to kick off the installation.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/index.html"} {"id": "5859f0341340-0", "text": "Silent Installer Settings\nOverview\nThe Sugar silent installer facilitates and automates the installation of the Sugar application after the files have been copied onto the server. This is done by populating correct parameters in a configuration file and then making a web request to kick off the installation.\nconfig_si.php\nThe ./config_si.php file is located at the root level of the Sugar application. It contains an array of name-value pairs consisting of the relevant parameters for installation of the app. The array name is $sugar_config_si. An example file looks like:\n 'http://${domainname}:${webport}/sugar',\n 'setup_system_name' => '${systemname}', \n 'setup_db_host_name' => 'localhost',\n 'setup_site_admin_user_name' => 'admin',\n 'setup_site_admin_password' => '${sugarpassword}',\n 'demoData' => true, \n 'setup_db_type' => 'mysql',\n 'setup_db_host_name' => '{db_host_name}',\n 'setup_db_port_num' => 'db_port_number',\n 'setup_db_database_name' => 'sugar',\n 'setup_db_admin_user_name' => 'root',\n 'setup_db_admin_password' => '${rootpassword}',\n 'setup_db_options' => array(\n \t'ssl' => true,\n ),\n 'setup_db_drop_tables' => false,\n 'setup_db_create_database' => true,\n 'setup_license_key' => '${slkey}',\n 'setup_license_key_users' => '${slkeyusers}',\n 'setup_license_key_expire_date' => '${slkeyexpiredate}',\n 'setup_license_key_oc_licences' => '${slkey_oc_licenses}',", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Silent_Installer_Settings/index.html"} {"id": "5859f0341340-1", "text": "'setup_license_key_oc_licences' => '${slkey_oc_licenses}',\n 'default_currency_iso4217' => 'USD',\n 'default_currency_name' => 'US Dollars',\n 'default_currency_significant_digits' => '2',\n 'default_currency_symbol' => '$',\n 'default_date_format' => 'Y-m-d',\n 'default_time_format' => 'H:i',\n 'default_decimal_seperator' => '.',\n 'default_export_charset' => 'ISO-8859-1',\n 'default_language' => 'en_us',\n 'default_locale_name_format' => 's f l',\n 'default_number_grouping_seperator' => ',',\n 'export_delimiter' => ',',\n);\nEssential Settings\nThe following are settings that must be set:\nGeneral System Settings\nsetup_system_name\nDescription\nA unique system name for the application that will be displayed on the web browser\nType\nString\nsetup_site_url\nDescription\nThe site location and URL of the Sugar application\nType\nString\nsetup_site_admin_user_name\nDescription\nSpecifies the admin username for the Sugar application\nType\nString\nsetup_site_admin_password\nDescription\nSpecifies the admin password for the Sugar application\nType\nString\ndemoData\nDescription\nIndicates whether the app will be installed with demo data\nType\nBoolean\nDatabase Settings\nsetup_db_type\nDescription\nDefines the type of database being used with Sugar. It is important to note that db2 and oracle are only applicable to Sugar Ent and Ult.\nType\nString: valid options include mysql, mssql, db2, oracle\nsetup_db_host_instance\nDescription\nDefines the host instance for MSSQL connections.\nType\nString : Database Host Instance Name\nsetup_db_host_name\nDescription\nDefines the hostname of the database server.\nType\nString\nsetup_db_port_num", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Silent_Installer_Settings/index.html"} {"id": "5859f0341340-2", "text": "Description\nDefines the hostname of the database server.\nType\nString\nsetup_db_port_num\nDescription\nDefines the port number on the server to connect to for authentication and transactions.\nType\nString\nsetup_db_database_name\nDescription\nDefines the database name to connect to on the database server.\nType\nString\nsetup_db_admin_user_name\nDescription\nSpecifies the database administrator's username\nType\nString\nsetup_db_admin_password\nDescription\nSpecifies the database administrator's password\nType\nString\nRecommended Database Settings\nThe following are not necessarily required, but it is recommended that at least one is set:\nsetup_db_create_database\nDescription\nSpecifies whether Sugar will create a new database with the name given or use an existing database.\nType\nBoolean\nsetup_db_drop_tables\nDescription\nSpecifies whether Sugar will drop existing tables on a database if the database already exists\nType\nBoolean\nExtended Database Settings\nThere is also an option for an additional array of db config settings. These array entries are equivalent to the Core Settings options prefixed with dbconfigoption. For example dbconfigoption.collation and dbconfigoption.ssl\nsetup_db_options\nDescription\nSee: Architecture/Configurator/Core_Settings/index.html#dbconfigoptionautofree\nType\nArray\nFull-Text Search (ElasticSearch) Settings\nsetup_fts_type\nDescription\nThe Full-Text Search service type\nType\nString, currently only supported value Elastic\nsetup_fts_host\nDescription\nThe hostname of the Full-Text Search service\nType\nString\nsetup_fts_port\nDescription\nThe port number of the Full-Text Search service\nType\nString\nAdvanced Full-Text Search Configuration Settings", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Silent_Installer_Settings/index.html"} {"id": "5859f0341340-3", "text": "Type\nString\nAdvanced Full-Text Search Configuration Settings\nWhile not required, the Silent Installer offers a few FTS settings not available in the browser-based installation process. These settings are considered more advanced and should not be implemented casually. Further details on advanced ElasticSearch configuration can be found in the ElasticSearch installation guide in the section Advanced Configuration.\nsetup_fts_curl\nDescription\nAdditional settings for the cURL request to the Elasticsearch server, keyed by the PHP cURL constants used for curl_setopt. For example\u00c2\u00a0\u00c2\u00a0\n'setup_fts_curl' => array(\n\tCURLOPT_SSL_VERIFYPEER = false,\n),\nType\nArray\nLicense Settings\nWhile not required during installation, the license settings are required for Sugar to be usable by all users. Setting the license settings during the Silent Install will save the need to enter this required data after the install.\nsetup_license_key\nDescription\nSpecifies the license key\nType\nString\nsetup_license_key_users\nDescription\nSpecifies the number of license key users\nType\nInteger\nsetup_license_key_expire_date\nDescription\nThe expiration date of the license key\nType\nString: yyyy-mm-dd format\nsetup_site_sugarbeet_automatic_checks\nDescription\nSpecifies if License Validation checks should be set to Automatic\nType\nBoolean\nAdditionally, Offline Client license settings can be set in Silent Installer\nsetup_license_key_oc_licences\nDescription\nthe number of offline client users\nType\nInteger\nsetup_num_lic_oc\nDescription\nthe number of offline client users\nType\nInteger\nMaking the Web Request\nAfter the ./config_si.php file is in place, the following web request can be made to kick off the installation:\nhttp://${hostname}/sugar/install.php?goto=SilentInstall&cli=true", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Silent_Installer_Settings/index.html"} {"id": "5859f0341340-4", "text": "http://${hostname}/sugar/install.php?goto=SilentInstall&cli=true\nwhere ${hostname} is the name of the host. Upon completion of the process, the installation should respond with Success, and you may navigate to the web address to find an installed version of Sugar.\nConfiguring a Sugar-Specific Database User during Install\nBy default, Sugar will use the database user set for the install process as the database user for general use after installation. There are three different Silent Install options for having Sugar use a different database user once installed. Which option the installer users is determined by the dbUSRData config setting.\nThe dbUSRData silent install config setting has four valid options:\nsame\nThis is the default setting used, even when dbUSRData is not explicitly set. The DB user provided for installing Sugar is used for running Sugar after installation.\nauto\nSugar will create a new database user using a self-generated username and password.\nIn your $sugar_config_si array, the options for this to work as expected are:\n'dbUSRData' => 'auto',\n'setup_db_create_sugarsales_user' => true,\nprovide\nSugar will use the provided database username and password after installation, and the installer assumes that the database user has already been created on the database and that the provided password is valid. Essentially this is informing Sugar to use a different existing DB user after the installation has completed.\nIn your $sugar_config_si array, the options for this to work as expected are:\n'dbUSRData' => 'provide',\n'setup_db_create_sugarsales_user' => false,\n'setup_db_sugarsales_user' => '{existing_db_user_name}',\n'setup_db_sugarsales_password' => '{existing_db_user_password}',\n'setup_db_sugarsales_password_retype' => '{existing_db_user_password}',\ncreate", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Silent_Installer_Settings/index.html"} {"id": "5859f0341340-5", "text": "create\nSugar will create a new database user using the provided database username and password after installation. This is similar to 'provide', except that Sugar assumes that it will be creating the database user during installation.\nIn your $sugar_config_si array, the options for this to work as expected are:\n'dbUSRData' => 'create',\n'setup_db_create_sugarsales_user' => true,\n'setup_db_sugarsales_user' => '{new_db_user_name}',\n'setup_db_sugarsales_password' => '{new_db_user_password}',\n'setup_db_sugarsales_password_retype' => '{new_db_user_password}',\nNote: For create, the installer will create a user with access only to the database created for this Sugar instance. It will also have limited access for which host it can connect from, versus the admin user, which usually has access from any host.\nSugar will set the user to have access to localhost and the provided hostname derived from setup_site_url. If there are issues connecting to the database during or after installation, check that the user was created correctly in the database and that the user can connect from the host that the instance is on.\nOther Silent Install Config Options\nMany of these options match an equivalent Sugar Config option, with further descriptions available at Core Settings.\ncache_dir\nDescription\nThis is the directory Sugar will store all cached files. Can be relative to Sugar root directory.\nType\nString, default \"cache/\"\nLocale Settings\nThe following options are locale settings. With one exception, these can be set or updated through Administration > Locale.\u00c2\u00a0\nexport_delimiter\nDescription\nThe field delimiter (separator) used when exporting records as CSV\nType\nString, default \",\"\ndefault_export_charset\nDescription\nThe default character set for CSV files to be encoded in when exporting\nType", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Silent_Installer_Settings/index.html"} {"id": "5859f0341340-6", "text": "Description\nThe default character set for CSV files to be encoded in when exporting\nType\nString, default \"ISO-8859-1\"\ndefault_currency_iso4217\nDescription\nThe ISO-4217 code of the default currency\nType\nString, default \"USD\"\ndefault_currency_name\nDescription\nThe name to use for the default currency\nType\nString, default \"US Dollars\"\ndefault_currency_significant_digits\nDescription\nChanges the number of significant digits in currency by default.\nNote that this setting can not be changed through the Admin panel after installation. It can be set for each user through the user's profile or can be updated globally by updating the config array.\nType\nInteger, default 2\ndefault_currency_symbol\nDescription\nThe symbol to use for the default currency\nType\nString, default \"$\"\ndefault_language\nDescription\nSets each user's default language. Possible values include any language offered by Sugar, such as: 'ar_SA', 'bg_BG', 'ca_ES', 'cs_CZ', 'da_DK', 'de_DE', 'el_EL', 'en_UK', 'en_us', 'es_ES', 'es_LA', 'zh_CN'\nType\nString, default \"en_US\"\ndefault_date_format\nDescription\nModifies the default date format for all users.\nType\nString, default \"m/d/Y\"\ndefault_time_format\nDescription\nModifies the default time format for all users.\nType\nString, default \"H:i\"\ndefault_decimal_seperator\nDescription\nSets the character used as a decimal separator for numbers.\nType\nString, default \".\"\ndefault_number_grouping_seperator\nDescription\nSets the character used as the 1000s separator for numbers.\nType\nString, default \",\"\ndefault_locale_name_format\nDescription\nSets the format for displaying full name (eg \"Salutation FirstName LastName\" vs \"LastName, FirstName\"", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Silent_Installer_Settings/index.html"} {"id": "5859f0341340-7", "text": "Type\nString, default \"s f l\"\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Silent_Installer_Settings/index.html"} {"id": "b191d6b5f35c-0", "text": "Core Settings\nOverview\nSugar configuration settings.\nSettings Architecture\nWhen you first install Sugar, all of the default settings are located in ./config.php. As you begin configuring the system, the modified settings are stored in ./config_override.php. Settings in ./config.php are overridden by the values in ./config_override.php.\nSettings\nactivitystreamcleaner\nDescriptionArray that defines the parameters for the Activity Stream purger. TypeArrayVersions9.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['activitystreamcleaner'] = array();activitystreamcleaner.keep_all_relationships_activities\nDescriptionThis value is used by the ActivityStreamPurger scheduler job to determine whether the link type activities are to be removed. By default, these records are removed along with other activity types such as create, update, etc. This can be overridden by setting this value equal to true.TypeBooleanRange of valuestrue or falseVersions9.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['activitystreamcleaner']['keep_all_relationships_activities'] = true;activitystreamcleaner.limit_scheduler_run\nDescriptionSets the number of activity stream records to delete per batch when run by the scheduled job that purges activity stream records.TypeInteger : Number of recordsRange of valuesIntegers, values below 0 become 0Versions9.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value25000Override Example$sugar_config['activitystreamcleaner']['limit_scheduler_run'] = 1000;activitystreamcleaner.months_to_keep", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-1", "text": "DescriptionThis value is used by the ActivityStreamPurger scheduler job. When this job runs, it uses this value to determine which Activity Stream records to prune from the activities table. Activities with a date older than the current date minus this number of months will be removed from the table.TypeInteger : Number of monthsRange of valuesAny integer greater than or equal to 0Versions9.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value6Override Example$sugar_config['activitystreamcleaner']['months_to_keep'] = 12;activity_streams\nDescriptionArray that defines parameters for processing Data Privacy erasure requests for activity streams. TypeArrayVersions8.0.1+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['activity_streams'] = array();activity_streams.erasure_job_delay\nDescriptionDefines the number of minutes between Activity Stream Erasure jobs. When multiple jobs are queued, this is the number of minutes that will separate their scheduled execution to allow Data Privacy erasures to occur in batches and minimize concurrent execution. These jobs can take some time to run and can tax the overall server performance if the number of Activity Stream records is very large. This setting is related to activity_streams.erasure_job_limit. These settings should be considered together to optimize throughput of Activity Erasure jobs.TypeInteger : MinutesVersions8.0.1+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value0Override Example$sugar_config['activity_streams']['erasure_job_delay'] = 5;activity_streams.erasure_job_limit", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-2", "text": "DescriptionDefines the maximum number of Data Privacy Records that can be processed by a single running instance of the Activity Stream Erasure job. This setting is related to activity_streams.erasure_job_delay. These settings should be considered together to optimize throughput of Activity Erasure jobs. For example, the longer that an activity erasure job processes, the more delay will be needed to prevent too many jobs executing in parallel.TypeIntegerVersions8.0.1+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value5Override Example$sugar_config['activity_streams']['erasure_job_limit'] = 8;additional_js_config\nDescriptionConfiguration values for when the ./cache/config.js file is generated. It is important to note that after changing this setting or any of its subsettings in your configuration, you must navigate to Admin > Repairs > Quick Repair & Rebuild.TypeArrayVersions7.5.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['additional_js_config'] = array();additional_js_config.alertAutoCloseDelay\nDescriptionDefines the default auto close delay for system alerts. It is important to note that after changing this setting in your configuration, you must navigate to Admin > Repairs > Quick Repair & Rebuild.TypeInteger : MillisecondsVersions7.8.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value9000Override Example$sugar_config['additional_js_config']['alertAutoCloseDelay'] = 3000;additional_js_config.authStore", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-3", "text": "DescriptionDefines the implementation of authentication data storage. The default storage, 'cache', is persistent and uses the localStorage API. Alternatively, 'cookie' storage may be used. This will store the authentication data in your browser window until the browser itself is closed. It is important to note that this behavior will differ between browsers. It is important to note that after changing this setting in your configuration, you must navigate to Admin > Repairs > Quick Repair & Rebuild.\nNote: This setting is not respected for instances that use SugarIdentity.TypeStringRange of values'cache' and 'cookie'Versions7.5.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuecacheOverride Example$sugar_config['additional_js_config']['authStore'] = 'cookie';additional_js_config.disableOmnibarTypeahead\nDescriptionDisables the typeahead feature in the listview Omnibar and force users to hit Enter when filtering. From a technical perspective, this will reduce the number of hits to the server.TypeBooleanRange of valuestrue and falseVersions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['additional_js_config']['disableOmnibarTypeahead'] = true;additional_js_config.logger.write_to_server\nDescriptionEnables the front end messages to be logged. The logger level must be tuned accordingly under Administration settings. Developers can set the client-side flag by running App.config.logger.writeToServer = true; in their browser's console.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-4", "text": "To simulate logging actions through the console, developers can use:App.logger.trace('message');App.logger.debug('message');App.logger.info('message');App.logger.warn('message');App.logger.fatal('message');TypeBooleanRange of valuestrue and falseVersions7.5.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['additional_js_config']['logger']['write_to_server'] = true;additional_js_config.sidecarCompatMode\nDescriptionBy default, the Sidecar framework will prevent customizations from calling private Sidecar methods. If after upgrading you find this to be an issue, the configuration can be set to true as a temporary workaround. All JavaScript customizations are expected to use public Sidecar APIs. TypeBooleanRange of valuestrue and falseVersions7.10.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['additional_js_config']['sidecarCompatMode'] = true;admin_access_control\nDescriptionRemoves Sugar Updates, Upgrade Wizard, Backups and Module Builder from the Admin menu. For developers, these restrictions can be found in ./include/MVC/Controller/file_access_control_map.php and overriden by creating ./custom/include/MVC/Controller/file_access_control_map.php.TypeBooleanRange of valuestrue and falseVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['admin_access_control'] = true;admin_export_only\nDescriptionAllow only users with administrative privileges to export data.TypeBooleanRange of valuestrue and falseVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['admin_export_only'] = true;allowFreezeFirstColumn", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-5", "text": "DescriptionGlobal admin config that turns the frozen first columns on/off. This setting can be toggled on and off via Admin > System Settings in Sugar or via code in the config.php file. When this setting is turned off, the ability to freeze the first column of data on a list view is disabled. If the setting is enabled, users will have an option to either freeze or unfreeze the first column on a per-module basis, similar to how you can toggle whether or not a field is included as a column in your list view. Instances running on Sugar's cloud environment will have this setting enforced as true.TypeBooleanVersions12.0.0+ProductsEnterprise, Serve, SellDefault ValuetrueSugarCloud ValuetrueOverride Example$sugar_config['allowFreezeFirstColumn'] = false;allow_oauth_via_get\nDescriptionAs of 7.8, Sugar does not support auth tokens being passed in from GET query string parameters by default. While allowing this functionality is not a recommended practice from a security standpoint, administrators may enable the setting at their own risk.TypeBooleanRange of valuestrue and falseVersions7.8.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['allow_oauth_via_get'] = true;allow_pop_inbound\nDescriptionInbound email accounts are setup to work with IMAP protocols by default. If your email provider required POP3 access instead of IMAP, you can enables POP3 as an available inbound email protocol. Please note that mailboxes configured with a POP3 connection are not supported by SugarCRM and may cause unintended consequences. IMAP is the recommended protocol to use for inbound email accounts.TypeBooleanRange of valuestrue and falseVersions5.5.1+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['allow_pop_inbound'] = true;allow_sendmail_outbound", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-6", "text": "DescriptionEnables the option of choosing sendmail as an SMTP server in Admin > Email Settings. Sendmail must be enabled on the server for this option to work. Please note that mailboxes configured with sendmail are not supported and may cause unintended consequences. Instances running on Sugar's cloud environment will have this setting enforced as false.TypeBooleanRange of valuestrue and falseVersions5.5.1+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseSugarCloud ValuefalseOverride Example$sugar_config['allow_sendmail_outbound'] = true;analytics\nDescriptionAn array defining properties for an analytics connector. Instances running on Sugar's cloud environment will have this setting enforced as a predetermined array.TypeArrayVersions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellSugarCloud Valuea predetermined arrayOverride Example$sugar_config['analytics'] = array();analytics.connector\nDescriptionThe name of the connector to use for gathering analytics. Instances running on Sugar's cloud environment will have this setting enforced as a predetermined value.TypeString : Connector nameVersions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellSugarCloud Valuea predetermined valueOverride Example$sugar_config['analytics']['connector'] = 'Pendo';analytics.enabled\nDescriptionDetermines if the analytics are enabled. Instances running on Sugar's cloud environment will have this setting enforced as true.TypeBooleanRange of valuestrue and falseVersions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseSugarCloud ValuetrueOverride Example$sugar_config['analytics']['enabled'] = true;analytics.id", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-7", "text": "DescriptionThe tracking id for the analytics connector. Instances running on Sugar's cloud environment will have this setting enforced as a predetermined value.TypeString : Tracking IDVersions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellSugarCloud Valuea predetermined valueOverride Example$sugar_config['analytics']['id'] = 'UA-XXXXXXX-X';api\nDescriptionAPI specific configurations.TypeIntegerVersions7.5.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['api']=array();api.timeout\nDescriptionThe timeout in seconds when uploading files through the REST API.TypeInteger : SecondsVersions7.5.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value180Override Example$sugar_config['api']['timeout'] = 240;authenticationClass\nDescriptionThe class to be used for login authentication.TypeString : Sugar Authentication ClassRange of valuesSAMLAuthenticateVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValueSugarAuthenticateOverride Example$sugar_config['authenticationClass'] = 'SAMLAuthenticate';aws\nDescriptionThis configuration's functionality has been deprecated and will be removed in an upcoming release.TypeArrayVersions6.7.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['aws'] = array();aws.aws_key\nDescriptionThis configuration's functionality has been deprecated and will be removed in an upcoming release.TypeString : KeyVersions6.7.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['aws']['aws_key'] = 'key';aws.aws_secret\nDescriptionThis configuration's functionality has been deprecated and will be removed in an upcoming release.TypeString : KeyVersions6.7.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['aws']['aws_secret'] = 'secret';aws.upload_bucket", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-8", "text": "DescriptionThis configuration's functionality has been deprecated and will be removed in an upcoming release.TypeString : S3 bucket nameVersions6.7.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['aws']['upload_bucket'] = 'bucket';cache\nDescriptionArray that defines additional properties for SugarCache if it's enabled (see external_cache).TypeArrayVersions8.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['cache'] = array();cache.backend\nDescriptionDefines the SugarCache backend to use via a fully qualified class name (FQCN). Instances running on Sugar's cloud environment will have this setting enforced as Sugarcrm\\Sugarcrm\\Cache\\Backend\\BackwardCompatible.TypeString : Cache LibraryRange of values'Sugarcrm\\Sugarcrm\\Cache\\Backend\\Redis' , '\\Sugarcrm\\Sugarcrm\\Cache\\Backend\\APCu' , '\\Sugarcrm\\Sugarcrm\\Cache\\Backend\\Memcached' , '\\Sugarcrm\\Sugarcrm\\Cache\\Backend\\InMemory' , ''Versions8.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValueSugarcrm\\Sugarcrm\\Cache\\Backend\\BackwardCompatibleSugarCloud ValueSugarcrm\\Sugarcrm\\Cache\\Backend\\BackwardCompatibleOverride Example$sugar_config['cache']['backend'] = 'Sugarcrm\\Sugarcrm\\Cache\\Backend\\Redis';cache.disable_gz\nDescriptionDefines whether the SugarCache compression should be disabled in multi-tenant deployment, which is not applicable without cache.multi_tenant. This will modify Sugar's caching behavior to disable compression of the cached data. Instances running on Sugar's cloud environment will have this setting enforced as false.TypeBooleanRange of valuestrue and falseVersions12.1.0+ProductsEnterprise, Serve, SellDefault ValuefalseSugarCloud ValuefalseOverride Example$sugar_config['cache']['disable_gz'] = true;cache.encryption_key", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-9", "text": "DescriptionUsed to store encryption key for SugarCache is in multi-tenant mode. By default, Sugar will generate a random UUID string for the encryption key as needed. It is not recommended to change or override this value since it will be regenerated whenever the cache is cleared. Not applicable without cache.multi_tenant. Instances running on Sugar's cloud environment will have this setting enforced as Random value (unique for each SugarCloud instance).TypeString : UUID stringRange of valuesN/A as it is generated automaticallyVersions8.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValueRandom value (generated on cache initialization)SugarCloud ValueRandom value (unique for each SugarCloud instance)Override Example$sugar_config['cache']['encryption_key'] = 'Sugar-generated encryption key';cache.gz_level\nDescriptionDefines the SugarCache compression level, which is not applicable without cache.multi_tenant. Instances running on Sugar's cloud environment will have this setting enforced as 9.TypeIntegerRange of values0, 1, 2, 3, 4, 5, 6, 7, 8, 9Versions12.1.0+ProductsEnterprise, Serve, SellDefault Value9SugarCloud Value9Override Example$sugar_config['cache']['gz_level'] = 2;cache.multi_tenant\nDescriptionDefines whether the SugarCache backend will be used by multiple Sugar instances as part of a multi-tenant deployment. This will modify Sugar's caching behavior to maintain isolation between Sugar instances. Instances running on Sugar's cloud environment will have this setting enforced as true.TypeBooleanRange of valuestrue and falseVersions8.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseSugarCloud ValuetrueOverride Example$sugar_config['cache']['multi_tenant'] = true;cache_dir", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-10", "text": "DescriptionThis is the directory SugarCRM will store all cached files. Can be relative to Sugar root directory.TypeString : DirectoryVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Valuecache/Override Example$sugar_config['cache_dir'] = 'cache/';cache_expire_timeout\nDescriptionThe length of time cached items should be expired after. TypeInteger : SecondsVersions6.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value300Override Example$sugar_config['cache_expire_timeout'] = 400;calendar\nDescriptionAn array that defines all of the various settings for the Calendar module.TypeArrayVersions6.4.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['calendar'] = array();calendar.day_timestep\nDescriptionSets the default day time step.TypeInteger : DaysRange of values15, 30 and 60Versions6.4.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value15Override Example$sugar_config['calendar']['day_timestep'] = 15;calendar.default_view\nDescriptionChanges the default view in the calendar module.TypeStringRange of values'day', 'week', 'month' and 'share'Versions6.4.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['calendar']['default_view'] = 'week';calendar.items_draggable\nDescriptionEnable/Disable drag-and-drop feature to move calendar items.TypeBooleanRange of valuestrue and falseVersions6.4.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuetrueOverride Example$sugar_config['calendar']['items_draggable'] = true;calendar.items_resizable", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-11", "text": "DescriptionSets whether items on the calendar can be resized via clicking and dragging.TypeBooleanRange of valuestrue and falseVersions6.5.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuetrueOverride Example$sugar_config['calendar']['items_resizable'] = true;calendar.show_calls_by_default\nDescriptionDisplay/Hide calls by default.TypeBooleanRange of valuestrue and falseVersions6.4.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuetrueOverride Example$sugar_config['calendar']['show_calls_by_default'] = true;calendar.week_timestep\nDescriptionThe default week step size when viewing the calendar.TypeInteger : Calendar Step SizeRange of values15, 30, and 60Versions6.4.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['calendar']['week_timestep'] = 30;check_query\nDescriptionValidates queries when adding limits.TypeBooleanRange of valuestrue and falseVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuetrueOverride Example$sugar_config['check_query'] = true;check_query_cost\nDescriptionSets the maximum cost limit of a query.TypeIntegerVersions5.2.0+ProductsEnterprise, Ultimate, Serve, SellDefault Value10Override Example$sugar_config['check_query_cost'] = 10;clear_resolved_date\nDescriptionIn Sugar Serve version 9.3 and higher, the Resolved Date field on Cases is automatically cleared when the case's status changes from \"Closed\", \"Rejected\", or \"Duplicate\" to any other value. Setting this parameter to false prevents Sugar from automatically clearing the Resolved Date field.TypeBooleanRange of valuestrue and falseVersions9.3.0+ProductsServeDefault ValuetrueOverride Example$sugar_config['clear_resolved_date'] = false;cloud_insight", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-12", "text": "DescriptionArray that defines the properties for SugarCloud Insights. TypeArrayVersions9.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['cloud_insight'] = array();cloud_insight.enabled\nDescriptionDetermines if the SugarCloud Insights service is enabled. TypeBooleanRange of valuestrue and falseVersions9.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuetrueOverride Example$sugar_config['cloud_insight']['enabled'] = false;cloud_insight.key\nDescriptionSpecifies the unique key for the SugarCloud Insights service.TypeString : KeyVersions9.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['cloud_insight']['key'] = '';cloud_insight.url\nDescriptionThe current URL for SugarCloud Insights service. TypeString : URLVersions9.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['cloud_insight']['url'] = 'https://sugarcloud-insights.service.sugarcrm.com';collapse_subpanels\nDescriptionPertains to Sidecar modules only. By default, all subpanels are in a collapsed state. If a user expands a subpanel, Sugar caches this preference so that it remains expanded on future visits to the same view. Set this value to 'true' to force a collapsed state for subpanels regardless of user preference, which may improve page-load performance by not querying for data until a user explicitly chooses to expand a subpanel.TypeBooleanRange of valuestrue and falseVersions7.6.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuetrueOverride Example$sugar_config['collapse_subpanels'] = true;cron", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-13", "text": "DescriptionArray that defines all of the cron parameters.TypeArrayVersions6.5.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['cron'] = array();cron.enforce_runtime\nDescriptionDetermines if cron.max_cron_runtime is enforced during the cron run.TypeBooleanRange of valuestrue and falseVersions7.2.2.2+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['cron']['enforce_runtime'] = true;cron.max_cron_jobs\nDescriptionMaximum jobs per cron run. Default is 10. If you are using a version prior to 6.5.14, you will need to also populate max_jobs to set this value due to bug #62936 ( https://web.sugarcrm.com/support/issues/62936 ).TypeIntegerVersions6.5.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value6.5.x: 107.6.x: 25Override Example$sugar_config['cron']['max_cron_jobs'] = 10;cron.max_cron_runtime\nDescriptionDetermines the maximum time in seconds that a single job should be allowed to run. If a single job exceeds this limit, cron.php is aborted with the long-running job marked as in progress in the job queue. The next time cron runs, it will skip the job that overran the limit and start on the next job in the queue. This limit is only enforced when cron.enforce_runtime is set to true.TypeInteger : SecondsVersions6.5.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value180Override Example$sugar_config['cron']['max_cron_runtime'] = 60;cron.min_cron_interval", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-14", "text": "DescriptionMinimum time between cron runs. Setting this to 0 will disable throttling completely.TypeInteger : SecondsVersions6.5.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value30Override Example$sugar_config['cron']['min_cron_interval'] = 30;csrf\nDescriptionAn array defining attributes for CSRF token protection.TypeArrayVersions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['csrf'] = array();csrf.soft_fail_form\nDescriptionWhen opted in for CSRF form authentication, any failures will result in a CSRF message to the user indicating a potential CSRF attack and an aborted action. If you are unsure whether the CSRF tokens are properly implemented in your backward compatible modules, this configuration parameter can be set to true. Setting this to true will avoid any exceptions being thrown to the end user. By default, any failures will result in a fatal log message indicating the issue. If you are running in \"soft failure\", a second fatal message will be logged such as \"CSRF: attack vector NOT mitigated, soft failure mode enabled\". Be careful enabling this configuration as it will only log CSRF authentication failures and will not protect your system.TypeBooleanRange of valuestrue and falseVersions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['csrf']['soft_fail_form'] = true;csrf.token_size\nDescriptionThe size in bytes of the CSRF token to generate.TypeInteger : BytesVersions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value32Override Example$sugar_config['csrf']['token_size'] = 16;customPortalPlatforms", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-15", "text": "DescriptionThis configuration allows a platform with custom authentication to be excluded from an IDM integration.TypeArray : PlatformsVersions9.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['customPortalPlatforms'] = array('platform1', 'platform2');custom_help_base_url\nDescriptionAllows an instance to specify a custom help url for their userTypeString : URLVersions6.4.3+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Valuehttp://www.sugarcrm.com/crm/product_doc.phpOverride Example$sugar_config['custom_help_base_url'] = 'http://www.custom_url/index.php';custom_help_url\nDescriptionDesignate the URL used to redirect the user to help documentation.TypeString : Website addressVersions6.4.3+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Valuehttp://www.sugarcrm.com/crm/product_doc.phpOverride Example$sugar_config['custom_help_url'] = 'http://www.sugarcrm.com/crm/product_doc.php';dbconfig\nDescriptionDefines all of the connection parameters for the database server.TypeArrayVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['dbconfig'] = array();dbconfig.db_host_instance\nDescriptionDefines the host instance for MSSQL connections.TypeString : Database Host Instance NameVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValueemptyOverride Example$sugar_config['dbconfig']['db_host_instance'] = 'SQLEXPRESS';dbconfig.db_host_name\nDescriptionPart of the 'dbconfig' array. Defines the host name of the database server.TypeString : Host nameRange of valueshost name of database serverVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValueemptyOverride Example$sugar_config['dbconfig']['db_host_name'] = 'localhost';dbconfig.db_manager", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-16", "text": "DescriptionPart of the 'dbconfig' array. Defines the specific library used to connect with your database. Instances running on Sugar's cloud environment will have this setting enforced as MysqliManager.TypeString : Database ManagerRange of valuesThe class name of the database driver, Possible values are: 'MysqlManager', 'MysqliManager', 'FreeTDSManager', 'MssqlManager', and 'SqlsrvManager'.Versions6.4.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValueDetermined by install: 'MysqlManager', 'MysqliManager', 'FreeTDSManager', 'MssqlManager', or 'SqlsrvManager'SugarCloud ValueMysqliManagerOverride Example$sugar_config['dbconfig']['db_manager'] = 'MysqliManager';dbconfig.db_name\nDescriptionPart of the 'dbconfig' array. Defines the database name to connect to on the database server.TypeString : Database NameRange of valuesdatabase nameVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValueemptyOverride Example$sugar_config['dbconfig']['db_name'] = 'sugar_db';dbconfig.db_password\nDescriptionPart of the 'dbconfig' array. Defines the password that correlates to the db_user_name parameter.TypeString : PasswordRange of valuespassword of the user defined in db_user_nameVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValueemptyOverride Example$sugar_config['dbconfig']['db_password'] = 'sql_password';dbconfig.db_port\nDescriptionPart of the 'dbconfig' array. Defines the port number on the server to connect to for authentication and transactions.TypeString : Network PortRange of valuesport number to connect to on the database serverVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value3306Override Example$sugar_config['dbconfig']['db_port'] = '3306';dbconfig.db_type", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-17", "text": "DescriptionDefines the type of database being used with Sugar. It is important to note that db2 and oracle are only applicable to Sugar Enterprise and Ultimate.TypeString : Database EngineRange of values'mysql', 'mssql', 'db2', and 'oci8'Versions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['dbconfig']['db_type'] = 'mysql';dbconfig.db_user_name\nDescriptionDefines the user to connect to the Sugar database as.TypeString : Database UserVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['dbconfig']['db_user_name'] = 'sql_user';dbconfigoption.autofree\nDescriptionAutomatically frees the database reference when it closes the reference.TypeBooleanRange of valuestrue and falseVersions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['dbconfigoption']['autofree'] = true;dbconfigoption.collation\nDescriptionThe set of rules to be used for comparing characters in a character set.TypeString : Collation typeVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Valueutf8_general_ciOverride Example$sugar_config['dbconfigoption']['collation'] = 'utf8_general_ci';dbconfigoption.debug\nDescriptionEnables debugging on the database connection.TypeBooleanRange of valuestrue and falseVersions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['dbconfigoption']['debug'] = true;dbconfigoption.persistent", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-18", "text": "DescriptionDetermines whether Sugar should use persistent connection when possible to connecting to the database.TypeBooleanRange of valuestrue and falseVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['dbconfigoption']['persistent'] = true;dbconfigoption.ssl\nDescriptionEnables SSL on the database connection.TypeBooleanRange of valuestrue and falseVersions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['dbconfigoption']['ssl'] = true;dbconfigoption.ssl_options\nDescriptionAn array detailing the SSL database connection options.TypeArrayRange of valuestrue and falseVersions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValueemptyOverride Example$sugar_config['dbconfigoption']['ssl_options'] = array();dbconfigoption.ssl_options.ssl_capath\nDescriptionThe path the trusted SSL certificate authority file in PEM format for SSL connection to the database.TypeString : File pathRange of valuestrue and falseVersions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValueemptyOverride Example$sugar_config['dbconfigoption']['ssl_options']['ssl_capath'] = 'path/to/ca-cert';dbconfigoption.ssl_options.ssl_cert\nDescriptionThe path the SSL certificate file for SSL connection to the database.TypeString : File pathRange of valuestrue and falseVersions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValueemptyOverride Example$sugar_config['dbconfigoption']['ssl_options']['ssl_cert'] = 'path/to/cert';dbconfigoption.ssl_options.ssl_cipher", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-19", "text": "DescriptionThe SSL cipher to be used for encryption.TypeString : CipherRange of valuestrue and falseVersions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValueemptyOverride Example$sugar_config['dbconfigoption']['ssl_options']['ssl_cipher'] = 'cipher';dbconfigoption.ssl_options.ssl_key\nDescriptionThe path the SSL key for SSL connection to the database.TypeString : File pathRange of valuestrue and falseVersions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValueemptyOverride Example$sugar_config['dbconfigoption']['ssl_options']['ssl_key'] = 'path/to/key';default_currency_significant_digits\nDescriptionChanges the number of significant digits in currency by default.TypeInteger : Number of significant digitsVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value2Override Example$sugar_config['default_currency_significant_digits'] = 2;default_date_format\nDescriptionModifies the default date format for all users.TypeString : Date formatVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Valuem/d/YOverride Example$sugar_config['default_date_format'] = 'm/d/Y';default_decimal_seperator\nDescriptionSets the character used as a decimal separator for numbers.TypeString : Text characterRange of valuesAny characterVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value.Override Example$sugar_config['default_decimal_seperator'] = '.';default_email_client\nDescriptionSets the default email client that opens when users send emails.TypeString : Email clientRange of values'sugar', 'external'Versions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuesugarOverride Example$sugar_config['default_email_client'] = 'sugar';default_language", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-20", "text": "DescriptionSets each user's default language. Possible values include any language offered by Sugar, such as: 'ar_SA', 'bg_BG', 'ca_ES', 'cs_CZ', 'da_DK', 'de_DE', 'el_EL', 'en_UK', 'en_us', 'es_ES', 'es_LA', 'et_EE', 'fi_FI', 'fr_FR', 'he_IL', 'hu_HU', 'it_it', 'ja_JP', 'ko_KR', 'lt_LT', 'lv_LV', 'nb_NO', 'nl_NL', 'pl_PL', 'pt_BR', 'pt_PT', 'ro_RO', 'ru_RU', 'sk_SK', 'sq_AL', 'sr_RS', 'sv_SE', 'tr_TR', 'uk_UA', 'zh_CN'TypeString : Language keyRange of valuesAny available languageVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Valueen_usOverride Example$sugar_config['default_language'] = 'en_us';default_number_grouping_seperator\nDescriptionSets the character used as the 1000s separator for numbers.TypeString : Text characterRange of valuesAny characterVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value,Override Example$sugar_config['default_number_grouping_seperator'] = ',';default_permissions\nDescriptionArray that defines the ownership and permissions for directories and files created naturally by the application.TypeArrayVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['default_permissions'] = array();default_permissions.dir_mode", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-21", "text": "DescriptionPart of the 'default_permissions' array. Used in UNIX-based systems only to define the permissions on newly created directories. The value is stored in decimal notation while UNIX file permissions are octal. For example, an octal value of 1528 equates to the permissions 2770. Instances running on Sugar's cloud environment will have this setting enforced as 1528.TypeInteger : Octal ValueVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellSugarCloud Value1528Override Example$sugar_config['default_permissions']['dir_mode'] = 1528;default_permissions.file_mode\nDescriptionPart of the 'default_permissions' array. Used in UNIX-based systems only to define the permissions on newly created files. The value is stored in decimal notation while UNIX file permissions are octal. For example, an octal value of 432 in equates to the permissions 660. Instances running on Sugar's cloud environment will have this setting enforced as 432.TypeInteger : Octal valueVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellSugarCloud Value432Override Example$sugar_config['default_permissions']['file_mode'] = 432;default_permissions.group\nDescriptionUsed in UNIX-based systems only to define the group membership of any newly created directories and files. This value should be a group that the Apache user is a member of to help ensure proper functionality. Instances running on Sugar's cloud environment will have this setting enforced as empty.TypeString : Web groupVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellSugarCloud ValueemptyOverride Example$sugar_config['default_permissions']['group'] = 'apache';default_permissions.user", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-22", "text": "DescriptionPart of the 'default_permissions' array. Used in UNIX-based systems only to define the ownership of any newly created directories and files. This value should be the Apache user. Instances running on Sugar's cloud environment will have this setting enforced as empty.TypeString : Web userRange of valuesApache userVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellSugarCloud ValueemptyOverride Example$sugar_config['default_permissions']['user'] = 'apache';default_user_is_admin\nDescriptionAllows for determining whether a user is a system administrator by default.TypeBooleanRange of valuestrue, falseVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['default_user_is_admin'] = true;deny_license_update\nDescriptionDetermines whether the license key in Admin > License Management is editable in the user interface. Instances running on Sugar's cloud environment will have this setting enforced as true.TypeBooleanRange of valuestrue and falseVersions9.3.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseSugarCloud ValuetrueOverride Example$sugar_config['deny_license_update'] = true;developerMode\nDescriptionRebuilds various cached files when a page is accessed. Can be set by an admin in Admin > System Settings. Instances running on Sugar's cloud environment will have this setting enforced as false.TypeBooleanRange of valuestrue and falseVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseSugarCloud ValuefalseOverride Example$sugar_config['developerMode'] = true;developer_mode_visible", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-23", "text": "DescriptionDetermines whether the Developer Mode flag is visible to administrators in Admin > System Settings. Instances running on Sugar's cloud environment will have this setting enforced as false.TypeBooleanRange of valuestrue or falseVersions11.3.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuetrueSugarCloud ValuefalseOverride Example$sugar_config['developer_mode_visible'] = false;diagnostic_file_max_lifetime\nDescriptionThe interval in seconds of when to expire and remove diagnostic files. It is important to note that the \"Remove diagnostic files\" scheduler job must be enabled to remove the diagnostic files.TypeInteger : SecondsVersions7.6.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value604800Override Example$sugar_config['diagnostic_file_max_lifetime'] = 604800;disabled_languages\nDescriptionAllows an admin to select languages that are disabled for the instance.TypeString : CSV Language KeysVersions6.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValueemptyOverride Example$sugar_config['disabled_languages'] = 'bg_BG,da_DK,de_DE';disable_count_query\nDescriptionRemoves the count totals from listviews. This is commonly used to prevent performing expensive count queries on the database when loading listviews and subpanels. It is important to note that in 7.x, this parameter will only affect modules running in Backward Compatibility mode.TypeBooleanRange of valuestrue and falseVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['disable_count_query'] = true;disable_export\nDescriptionPrevents exports of data into .csv files. Normally set in the UI via Admin > Locale.TypeBooleanRange of valuestrue and falseVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['disable_export'] = true;disable_related_calc_fields", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-24", "text": "DescriptionWhen a calculated field in Sugar uses the related function in the Sugar Logic, this will cause the calculated field to be executed when the related module is updated. This can cause a cascading effect through the system to update related calculated fields. When this happens you may receive a 502 Gateway Error. Please note that this is a global setting that will affect all modules. If you have a calculated field in Accounts that sums up all Opportunities for the account, setting this value to true will no longer update the opportunity account sum in Accounts until the account record itself is modified. However, if this setting is left disabled, the sum would update any time a related opportunity or the account is modified.TypeBooleanRange of valuestrue and falseVersions6.3.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['disable_related_calc_fields'] = true;disable_team_access_check\nDescriptionPrevents the system from checking to see if the creating/editing user has access to the record being saved. In normal circumstances, if a user creates a record and assigns it to a team they are not part of - their private team will be added. Setting this to true will prevent this.TypeBooleanRange of valuestrue and falseVersions5.5.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['disable_team_access_check'] = true;disable_unknown_platforms", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-25", "text": "DescriptionControls whether or not unregistered platforms are allowed to be used when logging in using REST API. Custom platforms can be registered via Admin > Configure API Platforms or by using the Platform extension. Used to prevent excessive metadata generation when invalid or unrecognized platform types are specified in an API call.TypeBooleanRange of valuestrue and falseVersions7.6.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value7.6 - 7.10: false7.11 and higher: trueOverride Example$sugar_config['disable_unknown_platforms'] = true;disable_uw_upload\nDescriptionDisables the upgrade wizard from being accessible through the Sugar admin interface. Instances running on Sugar's cloud environment will have this setting enforced as true.TypeBooleanRange of valuestrue and falseVersions5.2.0.j+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseSugarCloud ValuetrueOverride Example$sugar_config['disable_uw_upload'] = true;disable_vcr\nDescriptionDisables record paging in the detailview (VCR controls). Increases performance by not loading all records from a listview into memory when accessing the record detailview. In 7.x versions, this setting is only applicable to modules running in Backward Compatibility Mode.TypeBooleanRange of valuestrue and falseVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['disable_vcr'] = true;dump_slow_queries\nDescriptionLogs slow queries to the sugar log file. Instances running on Sugar's cloud environment will have this setting enforced as false.TypeBooleanRange of valuestrue and falseVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseSugarCloud ValuefalseOverride Example$sugar_config['dump_slow_queries'] = true;email_address_separator", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-26", "text": "DescriptionSets the character used to separate email addresses.TypeString : Text characterRange of valuesAny characterVersions6.4.3+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value,Override Example$sugar_config['email_address_separator'] = ',';email_default_client\nDescriptionSets the default email client for all users.TypeString : StringRange of valuessugar, externalVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuesugarOverride Example$sugar_config['email_default_client'] = 'sugar';email_default_delete_attachments\nDescriptionWhen deleting an email, this setting will mark all related notes as deleted, and attempt to delete files that are related to those notes.TypeBooleanRange of valuestrue and falseVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuetrueOverride Example$sugar_config['email_default_delete_attachments'] = false;email_default_editor\nDescriptionAllows configuring the default editor type for email. 'plain' sets the editor to only use plain text. 'html' allows the editor to be html enabled.TypeString : StringRange of values'plain' and 'html'Versions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuehtmlOverride Example$sugar_config['email_default_editor'] = 'plain';email_mailer_timelimit\nDescriptionThe timeout period in seconds for SMTP commands. Instances running on Sugar's cloud environment will have this setting enforced as 2.TypeInteger : SecondsRange of valuesAny integer greater than or equal to 1Versions12.2.0+ProductsEnterprise, Ultimate, Serve, SellDefault Value2SugarCloud Value2Override Example$sugar_config['email_mailer_timelimit'] = 30;email_mailer_timeout\nDescriptionThe connection timeout period when sending an email.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-27", "text": "DescriptionThe connection timeout period when sending an email. \nNote: The default value for this configuration is 2 seconds for Sugar versions 12.2.0 and higher. The default value for Sugar versions 7.8.0.0 to 12.1.0 is 10 seconds. \n Instances running on Sugar's cloud environment will have this setting enforced as 2.TypeInteger : SecondsVersions7.8.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value2SugarCloud Value2Override Example$sugar_config['email_mailer_timeout'] = 30;email_recipient_chunk_size\nDescriptionDefines the maximum number of addresses in the email's To field. If an email is to be sent to more than the email_recipient_chunk_size addresses, the list will be split and multiple duplicate emails will be sent, each one with no more than the email_recipient_chunk_size recipients in the To field. Some email service providers limit maximum number of recipients in an email, this option is intended to workaround such limitations. Instances running on Sugar's cloud environment will have this setting enforced as 10.TypeIntegerRange of valuesAny integer greater than or equal to 1Versions12.1.0+ProductsEnterprise, Serve, SellDefault Value10SugarCloud Value10Override Example$sugar_config['email_recipient_chunk_size'] = 20;enable_link_to_drawer\nDescriptionWhen true, the link-to-drawer feature known as \"Focus Drawers\" will be enabled for links to Sidecar module records instance-wide. Focus Drawers are exclusive to Sugar Sell and Sugar Serve.TypeBooleanRange of valuestrue and falseVersions10.3.0+ProductsServe, SellDefault ValuetrueOverride Example$sugar_config['enable_link_to_drawer'] = false;enable_long_text_search", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-28", "text": "DescriptionWhen true, Elasticsearch will enable long-text search for the following field types: 'longtext', 'htmleditable_tinymce'.TypeBooleanRange of valuestrue and falseVersions10.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['enable_long_text_search'] = true;enable_mobile_redirect\nDescriptionFlag indicating whether smartphone users are automatically redirected to the mobile view when navigating to a Sugar instance.TypeBooleanRange of valuestrue and falseVersions7.1.5+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuetrueOverride Example$sugar_config['enable_mobile_redirect'] = false;enable_one_index\nDescriptionIf you are running Elasticsearch 6 or higher, Elasticsearch creates a separate index for each full-text-search-enabled module. However, performance advantages are gained from instead using a single index for the entire instance. The 'enable_one-index' config enables you to move from 1-index-per-module to 1-index-per-instance. This setting can be enabled by an administrator via Admin > Search > Re-Index, and the re-index will automatically switch the instance over to 1 index and change this config to true. TypeBooleanRange of valuestrue or falseVersions11.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['enable_one_index'] = true;exclude_notifications\nDescriptionThis setting controls the modules that are excluded from assignment notifications.TypeArrayVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['exclude_notifications'] = array();exclude_notifications.module\nDescriptionAllows an administrator to explicitly disable modules from sending assignment notifications to users.TypeBooleanRange of valuestrue and falseVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['exclude_notifications'][''] = true;external_cache", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-29", "text": "DescriptionSugarCache basic configuration.TypeArrayVersions6.2.0+ProductsEnterprise, Serve, SellOverride Example$sugar_config['external_cache'] = array();external_cache.memcache\nDescriptionThis setting controls the memcache properties.TypeArrayVersions6.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['external_cache']['memcache'] = array();external_cache.memcache.host\nDescriptionThe host url for memchache.TypeString : Host URLVersions6.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value127.0.0.1Override Example$sugar_config['external_cache']['memcache']['host'] = '192.168.1.1';external_cache.memcache.port\nDescriptionThe host port for memcache.TypeInteger : Port numberVersions6.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value11211Override Example$sugar_config['external_cache']['memcache']['port'] = 11212;external_cache.redis\nDescriptionThis setting controls the redis properties.TypeArrayVersions9.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['external_cache']['redis'] = array();external_cache.redis.host\nDescriptionThe IP address or the hostname of the Redis host.TypeStringRange of values'127.0.0.1', '192.168.0.2', 'redis.serveraddress.com', 'local.redis.server.local'Versions9.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value127.0.0.1Override Example$sugar_config['external_cache'] ['redis'] ['host'] = '127.0.0.1';external_cache.redis.persistent", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-30", "text": "DescriptionThe type of connection to the Redis server: persistent or not.TypeBooleanRange of valuestrue and falseVersions9.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuetrueOverride Example$sugar_config['external_cache'] ['redis'] ['persistent'] = false;external_cache.redis.port\nDescriptionThe Port number configured in the Redis host.TypeIntegerRange of valuesAny TCP port numberVersions9.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value6379Override Example$sugar_config['external_cache'] ['redis'] ['port'] = 6377;external_cache.redis.timeout\nDescriptionConnection timeout to the Redis server. 0 means unlimited or OS defined.TypeIntegerRange of valuesAny integer greater than or equal to 0Versions9.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value0Override Example$sugar_config['external_cache'] ['redis'] ['timeout'] = false;external_cache_db_gc_probability\nDescriptionProbability factor to determine when garbage collection on stale keys from the DB backend will happen.TypeInteger : Probability factorVersions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value0.0001Override Example$sugar_config['external_cache_db_gc_probability'] = 0.0005;external_cache_db_gc_threshold\nDescriptionThe threshold in milliseconds to flag garbage collection queries as [SLOW] in sugarcrm.log.TypeInteger : MillisecondsRange of valuestrue and falseVersions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value200Override Example$sugar_config['external_cache_db_gc_threshold'] = 500;external_cache_disabled", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-31", "text": "DescriptionDisables all external caching in Sugar. This is normally set to true to determine if there is a conflict with PHP caching. Instances running on Sugar's cloud environment will have this setting enforced as true.TypeBooleanRange of valuestrue and falseVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseSugarCloud ValuetrueOverride Example$sugar_config['external_cache_disabled'] = true;external_cache_disabled_memcached\nDescriptionDisables Memcached caching from working with Sugar. Recommended setting is false and is normally set to true to determine if there is a conflict with PHP caching. Instances running on Sugar's cloud environment will have this setting enforced as true.TypeBooleanRange of valuestrue and falseVersions6.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseSugarCloud ValuetrueOverride Example$sugar_config['external_cache_disabled_memcached'] = false;external_cache_disabled_wincache\nDescriptionDisables WinCache caching from working with Sugar. Recommended setting is false and is normally set to true to determine if there is a conflict with PHP caching. Instances running on Sugar's cloud environment will have this setting enforced as true.TypeBooleanRange of valuestrue and falseVersions6.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseSugarCloud ValuetrueOverride Example$sugar_config['external_cache_disabled_wincache'] = false;external_cache_force_backend\nDescriptionForce given external key/value cache backend. Make sure that the requirements are met and any other cache backend specific configuration is applied.TypeString : Backend typeRange of valuesapc, db, file, memcache, memcached, memory, redis, smash, wincache, and zendVersions6.2.0+ProductsProfessional, EnterpriseDefault ValueemptyOverride Example$sugar_config['external_cache_force_backend'] = 'db';forms", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-32", "text": "DescriptionAn array defining form requirements.TypeArrayVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['forms'] = array();forms.requireFirst\nDescriptionPresents all required fields grouped together in the first panel on the EditView form.TypeBooleanRange of valuestrue and falseVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['forms']['requireFirst'] = true;freebusy_use_vcal_cache\nDescriptionPrior to Sugar version 7.6, FreeBusy Calendar searches used the vcals table to cache user meeting and call activity for the purpose of determining user availability in for future free time search. As of 7.6, a new design allowed for more accurate free/busy searching that no longer used this cache, but the cache was still being written to, by default, when calls/meetings were created/updated for backward compatibility reasons. As of Sugar 7.9, in order to enhance performance, the cache is no longer being written to by default. Instead, the override variable 'FreeBusyCache_Enabled' must be set to true for the Cache to be written. Since this cache is no longer used inside the Sugar application, this option should be used with caution as the cache itself is expected to be removed from the Sugar product in a future release.TypeBooleanRange of valuestrue and falseVersions6.1.0RC1+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['freebusy_use_vcal_cache'] = true;freezeListHeaders", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-33", "text": "DescriptionGlobal admin config that turns the frozen headers on/off. By default, most list views now have frozen headers and a static pagination element at the bottom of the screen. When the setting is turned off (set to false), this will revert to non-frozen headers and a user having to scroll down to see the pagination buttons. This is enforced in almost every list view in Sugar with the exception of some unique list views that do not have pagination controls. Instances running on Sugar's cloud environment will have this setting enforced as true.TypeBooleanVersions12.0.0+ProductsEnterprise, Serve, SellDefault ValuetrueSugarCloud ValuetrueOverride Example$sugar_config['freezeListHeaders'] = false;gs_use_shortcut_operator\nDescriptionThe default value of true permits use of shortcut operators in global search. These operators are: '&' for AND, '|' for OR, and '-' for NOT. Setting this to false will disable the shortcut operators in global search and cause these characters to be interpreted as literals.TypeBooleanRange of valuestrue and falseVersions8.3.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuetrueOverride Example$sugar_config['gs_use_shortcut_operator'] = falsehide_admin_licensing\nDescriptionHides the License settings subpanel in the administrative panel. Instances running on Sugar's cloud environment will have this setting enforced as false.TypeBooleanRange of valuestrue and falseVersions6.5.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseSugarCloud ValuefalseOverride Example$sugar_config['hide_admin_licensing'] = true;hide_full_text_engine_config", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-34", "text": "DescriptionDetermines if the FTS settings are present in the admin search page in Admin > Search. Instances running on Sugar's cloud environment will have this setting enforced as true.TypeBooleanRange of valuestrue and falseVersions6.5.15+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseSugarCloud ValuetrueOverride Example$sugar_config['hide_full_text_engine_config'] = true;hide_subpanels\nDescriptionThis setting only applies to modules running in Backward Compatibility Mode. When a DetailView is loaded, all subpanels are collapsed. Collapsing subpanels on load increases performance by not querying for data until a user explicitly expands a subpanel.TypeBooleanRange of valuestrue and falseVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['hide_subpanels'] = true;hide_subpanels_on_login\nDescriptionThis setting only applies to modules running in backward compatibility mode. Collapses subpanels per session. When a DetailView is initially loaded during a session, all subpanels are collapsed. Once explanded, it will remain expanded until the user logs out. Collapsing subpanels on load increases performance by not querying for data until a user explicitly expands a subpanel.TypeBooleanRange of valuestrue and falseVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['hide_subpanels_on_login'] = true;hint\nDescriptionThe array of configurations related to Hint.TypeArrayVersions10.3.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['hint'] = array();hint.hint_install_target_geo", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-35", "text": "DescriptionThis optional property allows you to, before installation of Hint, explicitly set which region you would like Hint to connect to, overriding the default behavior of the Hint installer. The default behavior is for Hint to connect to services hosted in the region nearest to that of the Sugar instance on which it is being installed. See the Hint Administration Guide for more details on Hint service regions: https://support.sugarcrm.com/Documentation/Installable_Connectors/Hint/Hint_Installation_Guide/#Choosing_the_Hint_Services_Region\nNote: Once configured, it is not possible to modify the region Hint connects to. Switching regions requires completely uninstalling and reinstalling Hint, which will cause you to lose all existing system and end-user settings. \nNote: 'APSE' is only available for 12.0 and higher.TypeStringRange of values'US', 'EU', 'APSE'Versions10.3.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['hint']['hint_install_target_geo'] = 'US';history_max_viewed\nDescriptionThe number of history items from the tracker to display for a user.TypeIntegerVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value50Override Example$GLOBALS['sugar_config']['history_max_viewed'] = 25;host_name\nDescriptionSets the host name of the instance, such as the website address or location where the instance is hosted and accessed.TypeString : StringVersions6.5.10+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuelocalhostOverride Example$sugar_config['host_name'] = 'localhost';installer_locked", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-36", "text": "DescriptionSets whether the installer is locked or not. When false, it is possible to access Sugar's initial configuration page to reinstall the instance. Instances running on Sugar's cloud environment will have this setting enforced as true.TypeBooleanRange of valuestrue and falseVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuetrueSugarCloud ValuetrueOverride Example$sugar_config['installer_locked'] = false;jobs\nDescriptionJob Queue configurations.TypeArrayVersions6.5.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['jobs'] = array();jobs.hard_lifetime\nDescriptionHard deletes all jobs that are older than the hard cutoff. Default is 21 days.TypeInteger : DaysVersions6.5.1+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value21Override Example$sugar_config['jobs']['hard_lifetime'] = 21;jobs.max_retries\nDescriptionMaximum number of failures for job. Default is 5.TypeInteger : Number of failuresVersions6.5.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value5Override Example$sugar_config['jobs']['max_retries'] = 5;jobs.min_retry_interval\nDescriptionMinimal interval between job reruns. Default is 30 seconds.TypeInteger : SecondsVersions6.5.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value30Override Example$sugar_config['jobs']['min_retry_interval'] = 30;jobs.soft_lifetime\nDescriptionSoft deletes all jobs that are older than cutoff. Default is 21 days.TypeInteger : DaysVersions6.5.1+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value7Override Example$sugar_config['jobs']['soft_lifetime'] = 7;jobs.timeout", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-37", "text": "DescriptionIf a job is running longer than the limit, the job is failed by force. Specified in seconds. Default is 3600 seconds (1 hour).TypeInteger : SecondsVersions6.5.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value3600Override Example$sugar_config['jobs']['timeout'] = 86400;languages\nDescriptionThe list of languages available in the system. An administrator can limit the languages available by removing them from this array. When modifying this array, you will need to make sure that the default_language config setting matches a language available in the list.TypeArray : Language KeysVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValueAll available languagesOverride Example$sugar_config['languages'] = array ('en_us' => 'English (US)');list_max_entries_per_page\nDescriptionListview items per page.TypeString : Records per pageVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value20Override Example$sugar_config['list_max_entries_per_page'] = '20';list_report_max_per_page\nDescriptionSets the maximum number of reports that are listed on each page in the Reports module.TypeInteger : Number of recordsVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value100Override Example$sugar_config['list_report_max_per_page'] = 100;logger\nDescriptionAn array that defines all of the logging settings.TypeArrayVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['logger'] = array();logger.channels", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-38", "text": "DescriptionThis setting controls the PSR-3 Logger channels. There are stock channels included in Sugar that can be utilized for various troubleshooting, and custom channels can easily be utilized in custom code. Please consult the PSR-3 Logger Documentation for further information on modifying channels and utilizing them.TypeArrayVersions7.9.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['logger']['channels'] = array();logger.channels.authentication\nDescriptionThis setting controls the PSR-3 Logger Channel configuration for the authentication channel.TypeArrayVersions7.10.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['logger']['channels']['authentication'] = array();logger.channels.authentication.handlers\nDescriptionThis setting controls the PSR-3 Logger Handler utilized by the authentication logging channel. TypeArrayVersions7.10.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['logger']['channels']['authentication']['handlers'][] = 'File';logger.channels.authentication.level\nDescriptionThis setting controls the authentication PSR-3 Logger channel's log level. If you need to troubleshoot authentication issues in Sugar, and do not want to enable debug logging on the entire system, you can utilize this channel for more robust logging around the Authentication Controller.TypeString : Logging levelRange of values'emergency', 'alert', 'critical', 'error', 'warning', 'notice', 'info', 'debug', 'off'Versions7.10.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['logger']['channels']['authentication']['level'] = 'debug';logger.channels.authentication.processors", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-39", "text": "DescriptionThis setting controls the authentication PSR-3 Logger channels processors. TypeArray : Logging ProcessorsRange of values'request', 'backtrace'Versions7.10.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['logger']['authentication']['authentication']['processors'] = array('request', 'backtrace');logger.channels.channel\nDescriptionThis setting controls the PSR-3 Logger channels. There are stock channels included in Sugar that can be utilized for various troubleshooting, and custom channels can easily be utilized in custom code. The channel configuration typically consists of three properties, the level, handlers, and processors, however not all need to be defined as they do inherit their properties from the default Logger implementation. Please consult the PSR-3 Logger Documentation for further information on adding custom channels and utilizing them.TypeArrayVersions7.9.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['logger']['channels'][''] = array();logger.channels.channel.handlers\nDescriptionThis setting controls the PSR-3 Logger Handler utilized by the defined logging channel. By default Sugar only comes with the 'File' handler, however custom handlers can easily be added as outlined in our PSR-3 Logger Documentation.TypeArrayVersions7.9.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['logger']['channels']['']['handlers'][] = 'File';logger.channels.channel.level", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-40", "text": "DescriptionThis setting controls the PSR-3 Log Level for the specified log channel.TypeString : Logging levelRange of values'emergency', 'alert', 'critical', 'error', 'warning', 'notice', 'info', 'debug', 'off'Versions7.9.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['logger']['channels']['']['level'] = 'alert';logger.channels.channel.processors\nDescriptionThis setting controls a specific PSR-3 Logger channels processors. To more easily debug issues, you can enable the provided backtrace or request Log Processors to provide more insight into a particular log. For more information on adding custom processors and using them on logging channels consult the PSR-3 Logger Documentation.TypeArray : Logging ProcessorsRange of values'request', 'backtrace'Versions7.9.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['logger']['channels']['']['processors'] = array('request', 'backtrace');logger.channels.db\nDescriptionThis setting controls the PSR-3 Logger Channel configuration for the db channel.TypeArrayVersions8.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['logger']['channels']['db'] = array();logger.channels.db.handlers\nDescriptionThis setting controls the PSR-3 Logger Handler utilized by the db logging channel. TypeArrayVersions8.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['logger']['channels']['db']['handlers'][] = 'File';logger.channels.db.level", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-41", "text": "DescriptionThis setting controls the Log Level for the db channel of the PSR-3 Logger. TypeString : Logging levelRange of values'emergency', 'alert', 'critical', 'error', 'warning', 'notice', 'info', 'debug', 'off'Versions8.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['logger']['channels']['db']['level'] = 'debug';logger.channels.db.processors\nDescriptionThis setting controls the db PSR-3 Logger channels processors. TypeArray : Logging ProcessorsRange of values'request', 'backtrace'Versions8.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['logger']['channels']['db']['processors'] = array('request', 'backtrace');logger.channels.deprecation\nDescriptionThis setting controls the PSR-3 Logger Channel configuration for the deprecation channel. If you need to clean up your customizations from usage of deprecated functionality of Sugar or some underlying libraries which implement runtime deprecation logging and you do not want to enable warning logging on the entire system, you can utilize this channel. Instances running on Sugar's cloud environment will have this setting enforced as empty.TypeArrayVersions11.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValueemptySugarCloud ValueemptyOverride Example$sugar_config['logger']['channels']['deprecation'] = [];logger.channels.deprecation.handlers", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-42", "text": "DescriptionThis setting controls the PSR-3 Logger Handler utilized by the deprecation logging channel. By default, Sugar only comes with the File handler, however custom handlers can be added as outlined in our PSR-3 Logger documentation. Instances running on Sugar's cloud environment will have this setting enforced as empty.TypeArrayVersions11.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValueemptySugarCloud ValueemptyOverride Example$sugar_config['logger']['channels']['deprecation']['handlers'][] = [ 'type' => 'File', 'name' => 'symfony_deprecations', ];logger.channels.deprecation.level\nDescriptionThis setting controls the deprecation PSR-3 Logger channel's log level. Instances running on Sugar's cloud environment will have this setting enforced as alert.TypeString : Logging LevelRange of valuesemergency, alert, critical, error, warning, notice, info, debug, offVersions11.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuealertSugarCloud ValuealertOverride Example$sugar_config['logger']['channels']['deprecation']['level'] = 'warning';logger.channels.deprecation.processors\nDescriptionThis setting controls the deprecation PSR-3 Logger channels processors. To more easily debug issues, you can enable the provided backtrace or request Log Processors to provide more insight into a particular log. For more information on adding custom processors and using them on logging channels, please refer to the PSR-3 Logger documentation. Instances running on Sugar's cloud environment will have this setting enforced as empty.TypeArray : Logging ProcessorsRange of valuesrequest, backtraceVersions11.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValueemptySugarCloud ValueemptyOverride Example$sugar_config['logger']['deprecation']['processors'] = ['request', 'backtrace'];logger.channels.input_validation", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-43", "text": "DescriptionThis setting controls the PSR-3 Logger Channel configuration for the input_validation channel.TypeArrayVersions7.9.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['logger']['channels']['input_validation'] = array();logger.channels.input_validation.handlers\nDescriptionThis setting controls the PSR-3 Logger Handler utilized by the input_validation logging channel. TypeArrayVersions7.9.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['logger']['channels']['input_validation']['handlers'][] = 'File';logger.channels.input_validation.level\nDescriptionThis setting controls the logging level for input validation failure messages when validation.soft_fail is enabled.TypeString : Logging levelRange of values'emergency', 'alert', 'critical', 'error', 'warning', 'notice', 'info', 'debug', 'off'Versions7.9.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['logger']['channels']['input_validation']['level'] = 'warning';logger.channels.input_validation.processors\nDescriptionThis setting controls the input_validation PSR-3 Logger channels processors. TypeArray : Logging ProcessorsRange of values'request', 'backtrace'Versions7.9.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['logger']['channels']['input_validation']['processors'] = array('request', 'backtrace');logger.channels.metadata\nDescriptionThis setting controls the PSR-3 Logger Channel configuration for the metadata channel.TypeArrayVersions7.9.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['logger']['channels']['metadata'] = array();logger.channels.metadata.handlers", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-44", "text": "DescriptionThis setting controls the PSR-3 Logger Handler utilized by the metadata logging channel. TypeArrayVersions7.9.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['logger']['channels']['metadata']['handlers'][] = 'File';logger.channels.metadata.level\nDescriptionThis logging channel can be used to track and debug metadata refresh issues. Overly frequent metadata refreshes will cause performance issues for affected Sugar instances. This metadata logging channel can help determine the frequency and causes of metadata refreshes.TypeString : Logging levelRange of values'emergency', 'alert', 'critical', 'error', 'warning', 'notice', 'info', 'debug', 'off'Versions7.9.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['logger']['channels']['metadata']['level'] = 'debug';logger.channels.metadata.processors\nDescriptionThis setting controls the metadata PSR-3 Logger channels processors. TypeArray : Logging ProcessorsRange of values'request', 'backtrace'Versions7.9.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['logger']['channels']['metadata']['processors'] = array('request', 'backtrace');logger.channels.rest\nDescriptionThis setting controls the PSR-3 Logger Channel configuration for the rest channel.TypeArrayVersions7.10.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['logger']['channels']['rest'] = array();logger.channels.rest.handlers\nDescriptionThis setting controls the PSR-3 Logger Handler utilized by the rest logging channel. TypeArrayVersions7.10.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['logger']['channels']['rest']['handlers'][] = 'File';logger.channels.rest.level", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-45", "text": "DescriptionThis setting controls the Log Level for the rest channel of the PSR-3 Logger. TypeString : Logging levelRange of values'emergency', 'alert', 'critical', 'error', 'warning', 'notice', 'info', 'debug', 'off'Versions7.10.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['logger']['channels']['rest']['level'] = 'debug';logger.channels.rest.processors\nDescriptionThis setting controls the rest PSR-3 Logger channels processors. TypeArray : Logging ProcessorsRange of values'request', 'backtrace'Versions7.10.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['logger']['channels']['rest']['processors'] = array('request', 'backtrace');logger.file.dateFormat\nDescriptionThe date format for the log file is any value that is acceptable to the PHP strftime() function. The default is '%c'. For a complete list of available date formats, please see the strftime() PHP documentation at http://php.net/manual/en/function.strftime.php.TypeString : Date formatRange of valuesPattern for date formatVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value%cOverride Example$sugar_config['logger']['file']['dateFormat'] = '%c';logger.file.ext\nDescriptionThe extension of the log file. The default value is '.log'. Instances running on Sugar's cloud environment will have this setting enforced as .log.TypeString : File extensionRange of valuesExtension for the logVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value.logSugarCloud Value.logOverride Example$sugar_config['logger']['file']['ext'] = '.log';logger.file.maxLogs", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-46", "text": "DescriptionWhen the log file grows to the logger.file.maxSize value, the system will automatically roll the log file. The logger.file.maxLogs value controls the max number of logs that will be saved before it deletes the oldest. The default value is 10.TypeInteger : Number of logsVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value10Override Example$sugar_config['logger']['file']['maxLogs'] = 10;logger.file.maxSize\nDescriptionThis value controls the max file size of a log before the system will roll the log file. It must be set in the format '10MB' where 10 is number of MB to store. Always use MB as no other value is currently accepted. To disable log rolling set the value to false. The default value is '10MB'. Instances running on Sugar's cloud environment will have this setting enforced as 10MB.TypeString : SizeVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value10MBSugarCloud Value10MBOverride Example$sugar_config['logger']['file']['maxSize'] = '10MB';logger.file.name\nDescriptionThe name of the log file to be written to. Instances running on Sugar's cloud environment will have this setting enforced as sugarcrm.TypeString : FilenameVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuesugarcrmSugarCloud ValuesugarcrmOverride Example$sugar_config['logger']['file']['name'] = 'sugarcrm';logger.file.suffix", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-47", "text": "DescriptionThe suffix to the file name to track logs chronologically. For instance, if you wanted to append the month and year to a file name, you can change this setting to '%m_%Y'. For a complete list of available date formats, please see the strftime() PHP documentation at http://php.net/manual/en/function.strftime.php. Instances running on Sugar's cloud environment will have this setting enforced as empty.TypeString : Suffix patternVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValueemptySugarCloud ValueemptyOverride Example$sugar_config['logger']['file']['suffix'] = '%m_%Y';logger.level\nDescriptionDetermines the logging level of the system. The recommended setting is 'fatal'. Instances running on Sugar's cloud environment will have this setting enforced as fatal.TypeString : Logging levelRange of values'debug', 'info', 'warn', 'deprecated', 'error', 'fatal', 'security', 'off'Versions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefatalSugarCloud ValuefatalOverride Example$sugar_config['logger']['level'] = 'fatal';logger_visible\nDescriptionDetermines whether the Logger Settings panel is visible to administrators in Admin > System Settings. Instances running on Sugar's cloud environment will have this setting enforced as false.TypeBooleanRange of valuestrue and falseVersions6.7.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuetrueSugarCloud ValuefalseOverride Example$sugar_config['logger_visible'] = false;log_dir", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-48", "text": "DescriptionSets the location in the file system where the Sugar log file will be stored. By default, it is set to '.' meaning that it is stored in the root instance directory. Instances running on Sugar's cloud environment will have this setting enforced as ..TypeString : Directory PathVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value.SugarCloud Value.Override Example$sugar_config['log_dir'] = '.';log_file\nDescriptionDesignates the file name where the instance's logs will be stored. Instances running on Sugar's cloud environment will have this setting enforced as sugarcrm.log.TypeString : Name of the log fileVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Valuesugarcrm.logSugarCloud Valuesugarcrm.logOverride Example$sugar_config['log_file'] = 'new_sugarcrm.log'log_memory_usage\nDescriptionLogs the memory usage. Instances running on Sugar's cloud environment will have this setting enforced as false.TypeBooleanRange of valuestrue and falseVersions5.5.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseSugarCloud ValuefalseOverride Example$sugar_config['log_memory_usage'] = true;maintenanceMode\nDescriptionAllows the instance to be placed in a maintenance mode where non-admin users cannot access the instance.TypeBooleanRange of valuestrue and falseVersions7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['maintenanceMode'] = false;marketing_extras_enabled\nDescriptionThis configuration disables the marketing content on the Sugar login screen.TypeBooleanRange of valuestrue and falseVersions8.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuetrueOverride Example$sugar_config['marketing_extras_enabled'] = false;mark_emails_seen", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-49", "text": "DescriptionDetermines whether to mark an email as read before importing the email to Sugar during the inbound email import. This is not recommended as an import failure will cause the email to be marked as read which will be skipped during the next inbound email import.TypeBooleanRange of valuestrue and falseVersions6.5.17+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['mark_emails_seen'] = true;mass_actions\nDescriptionArray that defines mass action behaviors.TypeArrayVersions7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['mass_actions'] = array();mass_actions.mass_delete_chunk_size\nDescriptionNumber of records per chunk while performing a mass delete.TypeIntegerVersions7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value20Override Example$sugar_config['mass_delete_chunk_size'] = 20;mass_actions.mass_link_chunk_size\nDescriptionNumber of records per chunk while performing mass linking updates.TypeIntegerVersions7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value20Override Example$sugar_config['mass_actions']['mass_link_chunk_size'] = 20;mass_actions.mass_update_chunk_size\nDescriptionNumber of records per chunk while performing a mass update.TypeIntegerVersions7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value500Override Example$sugar_config['mass_actions']['mass_update_chunk_size'] = 500;mass_actions.max_records_to_merge\nDescriptionNumber of records per chunk while performing a mass merge.TypeIntegerVersions7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value5Override Example$sugar_config['mass_actions']['max_records_to_merge'] = 20;maxPinnedModules\nDescriptionThe number of pinned modules to be displayed on the navigation bar (in the collapsed state).", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-50", "text": "DescriptionThe number of pinned modules to be displayed on the navigation bar (in the collapsed state).\nNote: For Sugar versions 13.0.0 and higher, the number of pinned modules can also be configured via Admin > Navigation Bar and Subpanels. Instances running on Sugar's cloud environment will have this setting enforced as 4.TypeIntegerVersions12.3.0+ProductsEnterprise, Serve, SellDefault Value4SugarCloud Value4Override Example$sugar_config['maxPinnedModules'] = 6;max_aggregate_email_attachments_bytes\nDescriptionThe maximum allowed size of all uploaded attachments added together for a single email message. Users may upload files as email attachments within to the lowest of the PHP upload_max_filesize, post_max_size, and system upload_maxsize size limits, but users cannot upload more files to a single message than the max_aggregate_email_attachments_bytes configuration permits.TypeInteger : bytesVersions7.10.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value10000000Override Example$sugar_config['max_aggregate_email_attachments_bytes'] = 20000000;max_session_time\nDescriptionDetermines the maximum lock time in seconds between session requests. When a session request is locked for long periods of time, other requests are blocked until it is released. A null value will not implement a max session time. Instances running on Sugar's cloud environment will have this setting enforced as 1.TypeInteger : SecondsVersions6.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuenullSugarCloud Value1Override Example$sugar_config['max_session_time'] = 1;metrics_enabled\nDescriptionWhether or not system metrics have been enabled.TypeBooleanRange of valuestrue and falseVersions6.7.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['metrics_enabled'] = true;metric_providers", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-51", "text": "DescriptionA Name/Path array of metric providers for measuring system metricsTypeArrayVersions6.7.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['metric_providers'] = array ('provider' => 'path/to/provider');metric_settings\nDescriptionThe individual settings required by a metric provider. And values provided will be passed when instantiating the metric providers object.TypeArray : Metric Provider SettingsVersions6.7.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['metric_settings'] = array ('provider' => array('setting' => 'value'));minify_resources\nDescriptionDetermines whether minification and compression are applied to javascript resourcesTypeBooleanRange of valuestrue and falseVersions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuetrueOverride Example$sugar_config['minify_resources'] = false;moduleInstaller\nDescriptionArray that defines restrictions on module installations via the Module Loader utility.TypeArrayVersions5.2.0.j+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['moduleInstaller'] = array();moduleInstaller.disableActions\nDescriptionPart of the moduleInstaller array. When packageScan is set to 'true', Sugar does not restrict any specific actions that can be completed during the installation process. The disableActions parameter allows you to define any actions you wish to restrict from executing.TypeArrayRange of valuesSpecific actions to restrict in module packagesVersions5.2.0j+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Valuearray()Override Example$sugar_config['moduleInstaller']['disableActions'] = array('pre_execute', 'post_execute');moduleInstaller.disableFileScan", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-52", "text": "DescriptionWhen packageScan is set to 'true', Sugar scans all files in an installable package to ensure that the file extensions are acceptable and that the files do not contain denylisted class or function calls. Setting the disableFileScan parameter to 'true' avoids this scan from occurring while still enforcing other parameters set.TypeBooleanRange of valuestrue and falseVersions5.2.0j+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['moduleInstaller']['disableFileScan'] = true;moduleInstaller.packageScan\nDescriptionEnables package scanning on any modules uploaded through Module Loader prior to the installation. If the package is found to violate any restrictions of the packageScan, the installation will not proceed and an error report will be generated to the user attempting the install. Instances running on Sugar's cloud environment will have this setting enforced as true.TypeBooleanRange of valuestrue and falseVersions5.5.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseSugarCloud ValuetrueOverride Example$sugar_config['moduleInstaller']['packageScan'] = true;moduleInstaller.validExt", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-53", "text": "DescriptionPart of the moduleInstaller array. When moduleInstaller.packageScan is set to true, Sugar will not allow certain file extensions to be present in an installable package. By default, Sugar allows the following extensions: 'png', 'gif', 'jpg', 'css', 'js', 'php', 'txt', 'html', 'htm', 'tpl', 'pdf', 'md5', 'xml', 'hbs', 'less', and 'wsdl'. This parameter allows you to define additional extensions deemed safe to install on your instance of Sugar. Instances running on Sugar's cloud environment will have this setting enforced as array('eot','svg','tff','woff','woff2','xml','md').TypeArray : ExtensionsRange of valuesFile extensions to allowVersions6.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Valuearray()SugarCloud Valuearray('eot','svg','tff','woff','woff2','xml','md')Override Example$sugar_config['moduleInstaller']['validExt'] = array('swf', 'log');mso_fixup_paragraph_tags\nDescriptionDetermines whether email HTML is scrubbed for empty paragraph tags when displayed in the application. Setting this value to true will enable the HTML scrubbing. Enabling this setting does not affect the HTML stored in the database from the initial import. Created as a result of bug 66022 (https://web.sugarcrm.com/support/issues/66022).TypeBooleanRange of valuestrue and falseVersions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['mso_fixup_paragraph_tags'] = true;new_email_addresses_opted_out", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-54", "text": "DescriptionIf true, then newly created EmailAddress records in Sugar will be opted-out by default. This setting can also be controlled using the \"Opt-out new email addresses by default\" setting in Admin > System Email Settings.TypeBooleanRange of valuestrue and falseVersions8.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['new_email_addresses_opted_out'] = true;noPrivateTeamUpdate\nDescriptionPrevents name changes to a users private team. This setting can be modified by changing in Admin > System Settings > Advanced > Prevent name changes by users to update their Private Team NameTypeBooleanRange of valuestrue and falseVersions7.6.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['noPrivateTeamUpdate'] = true;oauth2\nDescriptionConfigutations for the oauth2 server.TypeArrayVersions7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['oauth2'] = array();oauth2.access_token_lifetime\nDescriptionThe lifetime of the access token in seconds. This setting controls how often Sugar will check to see if the user's token has expired. It is recommended for this value not to surpass more than half of the oauth2.refresh_token_lifetime setting. Note: This setting cannot exceed the maximum PHP session timeout, which is configured by PHP setting session.gc_maxlifetime. In SugarCloud the maximum session timeout is set to 7200s (2 hours).Note: This setting is not respected for instances that use SugarIdentity.TypeInteger : SecondsVersions7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value3600Override Example$sugar_config['oauth2']['access_token_lifetime'] = 3600;oauth2.refresh_token_lifetime", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-55", "text": "DescriptionThe lifetime of refresh token in seconds. We recommend the oauth2.refresh_token_lifetime remains at 1209600 seconds or less for security. Should you increase this number, do not exceed 2147220 seconds. Note: This setting is not respected for instances that use SugarIdentity.TypeIntegerVersions7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value1209600Override Example$sugar_config['oauth2']['refresh_token_lifetime'] = 1409600;oauth_token_expiry\nDescriptionSets whether OAuth tokens will expire.TypeStringRange of valuestrue and falseVersions7.5.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValueFalseOverride Example$sugar_config['oauth_token_expiry'] = '0';oauth_token_life\nDescriptionSets the length (in seconds) of the life of an OAuth token.TypeInteger : SecondsVersions7.5.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value86400Override Example$sugar_config['oauth_token_life'] = '86400';passwordHash\nDescriptionArray that defines the password hashing behaviors.\nNote: This configuration's functionality has been deprecated in Sugar versions 13.0 and higher and will be removed in a future release.TypeArrayVersions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['passwordHash'] = array();passwordHash.algo\nDescriptionThe specific algorithm to be used by the hashing backend. The available values depend on the selected passwordHash.backend. See http://php.net/manual/en/password.constants.php for more information when using the native backend.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-56", "text": "Note: This configuration's functionality has been deprecated in Sugar versions 13.0 and higher and will be removed in a future release.TypeString : Algorithm TypeRange of valuesFor native backend: \"PASSWORD_DEFAULT\" and \"PASSWORD_BCRYPT\". For sha2 backend: \"CRYPT_SHA256\" and \"CRYPT_SHA512\"Versions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value\"PASSWORD_DEFAULT\" for native. \"CRYPT_SHA256\" for sha2 backend.Override Example$sugar_config['passwordHash']['algo'] = 'PASSWORD_BCRYPT';passwordHash.allowLegacy\nDescriptionAllow logins of users who have their password stored using the insecure legacy MD5 hash. During the transition period for the 7.7 series, this will be allowed out of the box. Versions past 7.7 will no longer allow by default authentication against insecure hashes. This configuration parameter can be used to change the default behavior.\nNote: This configuration's functionality has been deprecated in Sugar versions 13.0 and higher and will be removed in a future release.TypeBooleanRange of valuestrue and falseVersions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value7.7.x: true7.8.x+:falseOverride Example$sugar_config['passwordHash']['allowLegacy'] = false;passwordHash.backend\nDescriptionThe password hash backend class to use. By default, the \"native\" backend is used which uses Blowfish to hash the passwords in the database. An alternative is using the \"sha2\" backend which makes use of SHA-2 hashing instead. Depending on the backend, different configuration options are available for passwordHash.algo and passwordHash.options.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-57", "text": "Note: This configuration's functionality has been deprecated in Sugar versions 13.0 and higher and will be removed in a future release.TypeStringRange of values'sha2' and 'native'Versions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuenativeOverride Example$sugar_config['passwordHash']['backend'] = 'sha2';passwordHash.options\nDescriptionThe available configuration values depend on the selected passwordHash.backend. See http://php.net/manual/en/function.password-hash.php when using the native backend and http://php.net/manual/en/function.crypt.php for the sha2 backend. Note that only the following specified options are allowed. For native backend: passwordHash.options.cost. For sha2 backend: passwordHash.options.rounds.\nNote: This configuration's functionality has been deprecated in Sugar versions 13.0 and higher and will be removed in a future release.TypeArrayVersions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['passwordHash']['options'] = array();passwordHash.options.cost\nDescriptionAn available option when the passwordHash.backend configuration is set to \"native\". More information on the native backend can be found at http://php.net/manual/en/function.password-hash.php\nNote: This configuration's functionality has been deprecated in Sugar versions 13.0 and higher and will be removed in a future release.TypeIntegerVersions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value10Override Example$sugar_config['passwordHash']['options']['cost'] = 15;passwordHash.options.rounds\nDescriptionAn available option when the passwordHash.backend configuration is set to \"sha2\". More information on the sha2 backend can be found at http://php.net/manual/en/function.crypt.php", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-58", "text": "Note: This configuration's functionality has been deprecated in Sugar versions 13.0 and higher and will be removed in a future release.TypeIntegerVersions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value5000Override Example$sugar_config['passwordHash']['options']['rounds'] = 4000;passwordHash.rehash\nDescriptionWhen enabled, the system will automatically rehash the user's password when successfully authenticated. This allows adoption to the newly configured password hash backend without resetting user's passwords.\nNote: This configuration's functionality has been deprecated in Sugar versions 13.0 and higher and will be removed in a future release.TypeBooleanRange of valuestrue and falseVersions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuetrueOverride Example$sugar_config['passwordHash']['rehash'] = false;passwordsetting\nDescriptionDefines all of the password requirements for the instance.TypeArrayVersions5.5.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['passwordsetting'] = array();passwordsetting.forgotpasswordON\nDescriptionEnables the Forgot Password features. When enabled, users will have the ability to reset their own passwords at the Login page. Set in UI via Admin->Password Management.TypeStringRange of values0, 1Versions5.5.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value1Override Example$sugar_config['passwordsetting']['forgotpasswordON'] = '0';passwordsetting.linkexpiration\nDescriptionDetermines whether the password reset link expires.TypeStringRange of values0, 1Versions6.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value0Override Example$sugar_config['passwordsetting']['linkexpiration'] = '0';passwordsetting.onelower", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-59", "text": "DescriptionConfigures whether at least one lower-case letter is required in users' passwords.TypeStringRange of values0, 1Versions6.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value0Override Example$sugar_config['passwordsetting']['onespecial'] = '0';passwordsetting.onenumber\nDescriptionConfigures whether at least one number is required in users' passwords.TypeStringRange of values0, 1Versions6.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value1Override Example$sugar_config['passwordsetting']['onenumber'] = '1';passwordsetting.oneupper\nDescriptionConfigures whether at least one upper-case letter is required in users' passwords.TypeBooleanRange of values0, 1Versions6.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value0Override Example$sugar_config['passwordsetting']['oneupper'] = 1;passwordsetting.systexpirationtype\nDescriptionSpecifies the unit of measurement for passwordsetting.systexpirationtime. The available options are: Days (1), Weeks (7) and Months (30). This value can be set in the UI via Admin > Password Management.TypeIntegerRange of values1, 7, and 30Versions5.5.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value1Override Example$sugar_config['passwordsetting']['systexpirationtype'] = '7';pdf_file_max_lifetime\nDescriptionThe interval in seconds of when to expire and remove generated PDF files. It is important to note that the \"Remove temporary PDF files\" scheduler job must be enabled to remove the PDF files.TypeInteger : SecondsVersions7.6.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value86400Override Example$sugar_config['pdf_file_max_lifetime'] = 86400;perfProfile", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-60", "text": "DescriptionAllows for an admin to tweak aspects of the system for performance enhancements when fetching records. As every system is different, your mileage will vary when using the perfProfile settings. Increases or decreases in performance will depend on a combination of primarily the amount of users, amount of unique team sets, and data size per module. The perfProfile parameters are available to be able to fine tune the team security performance no your platform. It is not recommended to change any setting directly in a production environment without testing and understanding the impact.TypeArrayVersions7.2.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['perfProfile'] = array();perfProfile.TeamSecurity\nDescriptionDetermines whether the team security filtering is applied.TypeArrayVersions7.2.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['perfProfile']['TeamSecurity'] = array();perfProfile.TeamSecurity.default\nDescriptionThis setting is used to enable or disable Team Security denormalization feature by default across the application.TypeArrayRange of valuestrue and falseVersions7.7.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['perfProfile']['TeamSecurity']['default'] = array();perfProfile.TeamSecurity.default.disable_subquery_optimizer_hint", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-61", "text": "DescriptionAs of Sugar 11.0.2, the default behavior of TeamSecurity on MySQL no longer uses an INNER JOIN to a 'team_sets' subquery; instead, Sugar 11.0.2 and higher use WHERE team_set_id IN [team_sets subquery] with a MySQL optimizer hint. To disable this approach and switch back to the INNER JOIN implementation, set this config to 'true'.TypeBooleanRange of valuestrue and falseVersions11.0.2+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['perfProfile']['TeamSecurity']['default']['disable_subquery_optimizer_hint'] = true;perfProfile.TeamSecurity.default.teamset_prefetch\nDescriptionFetches the list of team sets that the current user is a member of in a separate query and use those ID's directly in the team security clause to avoid adding a subquery. Under certain conditions, this may improve team security performance.\nIt is important to note that 'default' applies this applied to all modules. To set specific settings for a specific module, you will need to use:\n$sugar_config['perfProfile']['TeamSecurity']['{module}']['teamset_prefetch'] = true;TypeBooleanRange of valuestrue and falseVersions7.2.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['perfProfile']['TeamSecurity']['default']['teamset_prefetch'] = true;perfProfile.TeamSecurity.default.teamset_prefetch_max\nDescriptionThe maximum amount of team set ID's to include in the team security clause. If the current user is a member of more unique teams sets than this value, the system will fall back to using a regular subquery instead. Under certain conditions, this may improve team security performance.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-62", "text": "It is important to note that 'default' applies this applied to all modules. To set specific settings for a specific module, you will need to use:\n$sugar_config['perfProfile']['TeamSecurity']['{module}']['teamset_prefetch_max'] = true;TypeInteger : RecordsVersions7.2.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValueemptyOverride Example$sugar_config['perfProfile']['TeamSecurity']['default']['teamset_prefetch_max'] = 500;perfProfile.TeamSecurity.default.use_denorm\nDescriptionThis setting is used to enable or disable Team Security denormalization feature. Team Security denormalization can significantly improve SQL query performance when there are a large number of Teams in a Sugar instance. The cost is that this feature relies on a separate Team security denormalization table that needs to be updated as records change to ensure Sugar's Team security visibility rules are applied properly.\nIt is important to note that 'default' applies this to all modules. To set specific settings for a specific module, you will need to use:\n$sugar_config['perfProfile']['TeamSecurity']['{module}']['use_denorm'] = true;TypeBooleanRange of valuestrue and falseVersions8.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['perfProfile']['TeamSecurity']['default']['use_denorm'] = true;perfProfile.TeamSecurity.default.where_condition\nDescriptionDetermines whether the team security filtering is applied in the WHERE clause instead of SELECT clause. Under certain conditions, this may improve team security performance.\nIt is important to note that 'default' applies this applied to all modules. To set specific settings for a specific module, you will need to use:", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-63", "text": "$sugar_config['perfProfile']['TeamSecurity']['{module}']['where_condition'] = true;TypeBooleanRange of valuestrue and falseVersions7.2.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['perfProfile']['TeamSecurity']['default']['where_condition'] = true;perfProfile.TeamSecurity.gs_use_normalized_teams\nDescriptionDetermines whether the team set IDs are cached; this may improve Elasticsearch indexing performance, especially for those instances with a large number of team sets per user. Admin must schedule re-indexing Elasticsearch server if this value has been changed.TypeBooleanRange of valuestrue and falseVersions11.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['perfProfile']['TeamSecurity']['gs_use_normalized_teams'] = true;perfProfile.TeamSecurity.inline_update\nDescriptionWhen denormalization is in use (perfProfile.TeamSecurity.default.use_denorm config set to true), this setting will allow the denormalization table to be updated in real time as records are updated in the system. If this setting is disabled, the denormalization table must be scheduled by the Sugar administrator via Schedulers > Rebuild Denormalized Team Security Data.TypeBooleanRange of valuestrue and falseVersions8.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['perfProfile']['TeamSecurity']['inline_update'] = true;pmse_settings_default\nDescriptionSettings for troubleshooting and debugging SugarBPMTypeArrayVersions7.6.0.0+ProductsEnterprise, Ultimate, Serve, SellOverride Example$sugar_config['pmse_settings_default'] = array();pmse_settings_default.error_number_of_cycles", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-64", "text": "DescriptionNumber of cycles before triggering an error in SugarBPMTypeString : CyclesVersions7.6.0.0+ProductsEnterprise, Ultimate, Serve, SellDefault Value10Override Example$sugar_config['pmse_settings_default']['error_number_of_cycles'] = 15;pmse_settings_default.error_timeout\nDescriptionTime in seconds of timeout before triggering an error in SugarBPMTypeString : SecondsVersions7.6.0.0+ProductsEnterprise, Ultimate, Serve, SellDefault Value40Override Example$sugar_config['pmse_settings_default']['error_timeout'] = 45;pmse_settings_default.logger_level\nDescriptionThe default logger level for SugarBPMTypeStringRange of valuesemergency, alert, critical, error, warning, notice, info, debugVersions7.6.0.0+ProductsEnterprise, Ultimate, Serve, SellDefault ValuecriticalOverride Example$sugar_config['pmse_settings_default']['logger_level'] = 'emergency';portal_enableSelfSignUp\nDescriptionThis portal configuration option controls whether external portal sign-ups are permitted and is also controlled in the user interface via the \"Allow new users to sign up\" Sugar Portal setting. See the Sugar Portal page in the Administration Guide for details on this setting: https://support.sugarcrm.com/SmartLinks/Administration_Guide/Developer_Tools/Sugar_Portal/hdr_Configure_Portal\nThis option is disabled by default for new instances. Note: Upon upgrade to 11.1.0 or higher from version 11.0.x or lower, the default value will be 'true' for instances that had their portal enabled before upgrade and at least one contact configured for portal.TypeBooleanRange of valuestrue and falseVersions11.1.0+ProductsEnterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['portal_enableSelfSignUp'] = true;processes_auto_save_interval", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-65", "text": "DescriptionDefines the interval (in milliseconds) at which auto-saving of process definitions will occur while using the SugarBPM process designer. A value of 0 will disable auto-saving.TypeInteger : MillisecondsVersions8.3.0+ProductsEnterprise, Ultimate, Serve, SellDefault Value30000Override Example$sugar_config['processes_auto_save_interval'] = 120000processes_auto_validate_on_autosave\nDescriptionDefines whether validation of process definitions will automatically occur when a process definition is auto-saved. To enable this setting, 'processes_auto_save_interval' must be greater than 0.TypeBooleanRange of valuestrue and falseVersions8.3.0+ProductsEnterprise, Ultimate, Serve, SellDefault ValuetrueOverride Example$sugar_config['processes_auto_validate_on_autosave'] = falseprocesses_auto_validate_on_import\nDescriptionDetermines whether validation of process definitions will automatically occur immediately after a process definition is imported.TypeBooleanRange of valuestrue and falseVersions8.3.0+ProductsEnterprise, Ultimate, Serve, SellDefault ValuetrueOverride Example$sugar_config['processes_auto_validate_on_import'] = falseproxy_visible\nDescriptionDetermines whether the Proxy Settings panel is visible to administrators in Admin > System Settings. Instances running on Sugar's cloud environment will have this setting enforced as false. Instances running on Sugar's cloud environment will have this setting enforced as false.TypeBooleanRange of valuestrue or falseVersions11.3.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuetrueSugarCloud ValuefalseOverride Example$sugar_config['proxy_visible'] = false;push_notification\nDescriptionThe array of configurations related to push notifications.TypeArrayVersions11.0.0+ProductsEnterprise, Ultimate, Serve, SellOverride Example$sugar_config['push_notification'] = array();push_notification.enabled", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-66", "text": "DescriptionFor Sugar instances that are eligible for push notifications, use this setting to turn push notifications on or off. See the Android and iOS User Guides for the requirements to be eligible:\nhttps://support.sugarcrm.com/Documentation/Mobile_Solutions/SugarCRM_Mobile/SugarCRM_Mobile_for_iOS_User_Guide/#Eligible_Sugar_Instances\nhttps://support.sugarcrm.com/Documentation/Mobile_Solutions/SugarCRM_Mobile/SugarCRM_Mobile_for_Android_User_Guide/#Eligible_Sugar_InstancesTypeBooleanRange of valuestrue and falseVersions11.0.0+ProductsEnterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['push_notification']['enabled'] = true;push_notification.service_provider\nDescriptionFor Sugar instances that are eligible for push notifications, this setting specifies the provider. Currently, SugarPush is the only available provider. See the Android and iOS User Guides for the requirements to be eligible:\nhttps://support.sugarcrm.com/Documentation/Mobile_Solutions/SugarCRM_Mobile/SugarCRM_Mobile_for_iOS_User_Guide/#Eligible_Sugar_Instances\nhttps://support.sugarcrm.com/Documentation/Mobile_Solutions/SugarCRM_Mobile/SugarCRM_Mobile_for_Android_User_Guide/#Eligible_Sugar_InstancesTypeStringRange of values'SugarPush'Versions11.0.0+ProductsEnterprise, Ultimate, Serve, SellDefault Value'SugarPush'Override Example$sugar_config['push_notification']['service_provider'] = 'SugarPush';reports_complexity_display\nDescriptionArray that establishes the thresholds for the number of cells in a report above which the formatting changes.TypeArrayRange of valuesPositive integersVersions13.0.0+ProductsEnterprise, Serve, SellOverride Example$sugar_config['reports_complexity_display'] = array();reports_complexity_display.export", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-67", "text": "DescriptionWhen a report has more than this many cells, you will only be able to view results in a table by exporting the table.TypeInteger : Number of cellsRange of valuesAny integer greater than or equal to 1Versions13.0.0+ProductsEnterprise, Serve, SellDefault Value300000Override Example$sugar_config['reports_complexity_display']['export']=30000;reports_complexity_display.simplified\nDescriptionWhen a report has more than this many cells, you will be able to view results as a simplified table or export the results. TypeInteger : Number of cellsRange of valuesAny integer greater than or equal to 1Versions13.0.0+ProductsEnterprise, Serve, SellDefault Value50000Override Example$sugar_config['reports_complexity_display']['simplified']=5000;require_accounts\nDescriptionDetermines whether an account is required for record creation within the system.TypeBooleanRange of valuestrue and falseVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuetrueOverride Example$sugar_config['require_accounts'] = false;rest_response_etag_cache_age\nDescriptionControls how long the browser should cache rest responses.TypeInteger : SecondsVersions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value10Override Example$sugar_config['rest_response_etag_cache_age'] = 15;roleBasedViews\nDescriptionEnables role based views and dropdowns.TypeBooleanRange of valuestrue and falseVersions7.6.0.0+ProductsEnterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['roleBasedViews'] = true;SAML_provisionUser", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-68", "text": "DescriptionDetermines whether or not a new user is auto-provisioned when authenticating through SAML. Setting this setting to false will prevent a new user from being created.TypeBooleanRange of valuestrue and falseVersions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuetrueOverride Example$sugar_config['SAML_provisionUser'] = false;SAML_X509Cert\nDescriptionThe SAML Certificate Key.TypeString : SAML Certificate KeyVersions6.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['SAML_X509Cert'] = '-----BEGIN CERTIFICATE-----CERTIFICATE KEY-----END CERTIFICATE-----';schedule_report_with_chart\nDescriptionBy default, reports distributed via the Reports Schedule module in 8.1 and later will not include a chart in the emailed PDF even if one has been configured for display in Sugar. Because the report charts are not re-built when the scheduler runs a scheduled report, the chart may not accurately represent the data presented in the PDF. Instead, the chart will represent the data that was pulled the last time a user triggered a \"Run Report\" action on the report, which may or may not match the data available when the report is generated for the scheduled report. Consider this potential conflict carefully before using this config to override the default behavior.TypeBooleanRange of valuestrue and falseVersions8.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['schedule_report_with_chart'] = true;search_engine\nDescriptionArray that defines the search enginer behaviors.TypeArrayVersions7.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['search_engine'] = array();search_engine.max_bulk_delete_threshold", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-69", "text": "DescriptionThe maximun number of records that can be deleted at a time.TypeInteger : Number of recordsVersions7.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value3000Override Example$sugar_config['search_engine']['max_bulk_delete_threshold'] = 3000;search_engine.max_bulk_query_threshold\nDescriptionThe maximum number of records to process before starting to bulk insert. Prevents memory issues.TypeInteger : Number of recordsVersions7.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value15000Override Example$sugar_config['search_engine']['max_bulk_query_threshold'] = 20000;search_engine.max_bulk_threshold\nDescriptionThe maximum number of records to process before starting to bulk insert. Prevents memory issues.TypeIntegerVersions7.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value5000Override Example$sugar_config['search_engine']['search_engine.max_bulk_threshold'] = 10000;search_engine.postpone_job_time\nDescriptionAmount of time to postpone a job by so that it's not executed twice during the same request.TypeInteger : SecondsVersions7.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value120Override Example$sugar_config['search_engine']['search_engine.postpone_job_time'] = 70;search_wildcard_infront\nDescriptionIn Sugar 7.x+, this setting is only valid for modules running in BWC mode. When enabled, automatically adds a wildcard in front of any searches performed in the application. This setting is not recommended to be enabled as preceding wildcards results in database indices not being utilized and performance decreasing.TypeBooleanRange of valuestrue and falseVersions6.4.3+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['search_wildcard_infront'] = true;security.private_ips", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-70", "text": "DescriptionDefines a range of IPs considered to be private. Such IPs and corresponding domains are not reachable via ExternalResourceClient. Instances running on Sugar's cloud environment will have this setting enforced as ['10.0.0.0|10.255.255.255', '172.16.0.0|172.31.255.255', '192.168.0.0|192.168.255.255', '169.254.0.0|169.254.255.255', '127.0.0.0|127.255.255.255',].TypeArrayRange of valuesPipe-delimited range of IPs (e.g., '10.0.0.0|10.255.255.255')Versions12.1.0+ProductsEnterprise, Serve, SellDefault Value['10.0.0.0|10.255.255.255', '172.16.0.0|172.31.255.255', '192.168.0.0|192.168.255.255', '169.254.0.0|169.254.255.255', '127.0.0.0|127.255.255.255',]SugarCloud Value['10.0.0.0|10.255.255.255', '172.16.0.0|172.31.255.255', '192.168.0.0|192.168.255.255', '169.254.0.0|169.254.255.255', '127.0.0.0|127.255.255.255',]Override Example$sugar_config['security']['private_ips'] = [ '127.0.0.0|127.255.255.255', '8.8.8.0|8.8.8.8', ];security.use_doh", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-71", "text": "DescriptionEnables remote Domain Name System (DNS) resolution via the HTTPS protocol. A goal of the method is to increase user privacy and security by preventing eavesdropping and manipulation of DNS data by man-in-the-middle attacks by using the HTTPS protocol to encrypt the data between the DoH (DNS over HTTPS) client and the DoH-based DNS resolver.\nWhen enabled, it will use dns.google (8.8.4.4) to resolve hostnames. Instances running on Sugar's cloud environment will have this setting enforced as false.TypeBooleanRange of valuestrue and falseVersions13.0.0+ProductsEnterprise, Serve, SellDefault ValuefalseSugarCloud ValuefalseOverride Example$sugar_config['security']['use_doh'] = true;session_dir\nDescriptionDirectory on the server to store Sugar session data. If left empty, the PHP session settings will be inherited. Instances running on Sugar's cloud environment will have this setting enforced as empty.TypeStringRange of valuesDirectory pathVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValueemptySugarCloud ValueemptyOverride Example$sugar_config['session_dir'] = '/tmp/SugarSession/';showThemePicker\nDescriptionRemoves the theme selection drop down.TypeBooleanRange of valuestrue and falseVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuetrueOverride Example$sugar_config['showThemePicker'] = false;show_download_tab\nDescriptionUsed to determine whether the download tab will appear in the User settings. The download tab provides users with access to Sugar plug-ins and other available downloads.TypeBooleanRange of valuestrue and falseVersions6.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['show_download_tab'] = true;site_url", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-72", "text": "DescriptionCurrent URL of your Sugar instance. This value is critical in its accuracy for multiple points of functionality in the instance.TypeString : URLRange of valuesCurrent URL of SugarVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['site_url'] = 'http://my.sugarinstance.com';slow_query_time_msec\nDescriptionSlow query time threshold. Instances running on Sugar's cloud environment will have this setting enforced as 5000.TypeString : MillisecondsVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value5000SugarCloud Value5000Override Example$sugar_config['slow_query_time_msec'] = '1000';smtp_mailer_debug\nDescriptionThe smtp_mailer_debug is used for increasing the debugging output for PHPMailer on individual instances so that more information can be seen when there are bugs or escalations. The default is 0 and produces no additional output for errors. 1-4 log the additional error information to sugarcrm.log as specified by PHPMailer at https://github.com/PHPMailer/PHPMailer/wiki/SMTP-Debugging#debug-levels .\nTypeIntegerRange of values0, 1, 2, 3, 4Versions7.9.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value0Override Example$sugar_config['smtp_mailer_debug'] = 4;stack_trace_errors\nDescriptionDisplays stack trace of errors. Instances running on Sugar's cloud environment will have this setting enforced as false.TypeBooleanRange of valuestrue and falseVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseSugarCloud ValuefalseOverride Example$sugar_config['stack_trace_errors'] = true;studio_max_history", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-73", "text": "DescriptionWhen layout changes are made in Studio, a history of those changes are recorded with each save & deploy under ./custom/history/modules/. The studio_max_history parameter controls how many files Sugar keeps for a particular module. If this parameter is undefined, a default of 50 is observed and to keep all historical Studio actions, set this parameter to 0. Instances running on Sugar's cloud environment will have this setting enforced as 50.TypeInteger : Number of files to keepRange of valuesAny integerVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value50SugarCloud Value50Override Example$sugar_config['studio_max_history'] = 100;sugar_version\nDescriptionThe current version of Sugar that is being used. This value should not be modified as it is updated in the config when Sugar is upgraded.TypeString : Version NumberVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['sugar_version'] = '6.7.3';symfony_deprecation_log\nDescriptionBy default, the deprecation warnings, triggered by Symfony components, are written to sugarcrm.log in the Sugar root directory. But since the default log level is set to Fatal, the deprecation warning messages will not appear in the log. As an option, you can add the $sugar_config['logger']['channels']['deprecation'] configuration and configure the log level and output method to just capture the deprecation warnings in a separate deprecations.log file. Instances running on Sugar's cloud environment will have this setting enforced as false.TypeBooleanRange of valuestrue and falseVersions12.2.0+ProductsEnterprise, Ultimate, Serve, SellDefault ValuefalseSugarCloud ValuefalseOverride Example$sugar_config['symfony_deprecation_log'] = true;time_aware_job_max_batch_size", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-74", "text": "DescriptionThe number of records processed per batch by the \"Process Time-Aware Schedules\" job scheduler. It is important to note that the scheduler job must be enabled.TypeInteger : RecordsVersions10.3.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value100Override Example$sugar_config['time_aware_job_max_batch_size'] = 200;tmp_dir\nDescriptionThe directory path for temporary XML files used by charts and diagnostics.TypeString : Directory pathRange of valuesFilesystem pathVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Valuecache/xml/Override Example$sugar_config['tmp_dir'] = 'cache/xml/';tmp_file_max_lifetime\nDescriptionThe interval in seconds of when to expire and remove temporary upload files. It is important to note that the \"Remove temporary files\" scheduler job must be enabled to remove the temporary files.TypeInteger : SecondsVersions7.6.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value86400Override Example$sugar_config['tmp_file_max_lifetime'] = 86400;tracker_max_display_length\nDescriptionThe number of records that will be shown per record in the \"Last Viewed\" section located under each module tab.TypeInteger : Number of recordsVersions6.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['tracker_max_display_length'] = 45;tracker_module_config\nDescriptionArray that defines the parameters that control which modules are tracked when Tracker Actions are enabled.TypeArrayVersions11.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['tracker_module_config'] = array();tracker_module_config.disable", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-75", "text": "DescriptionThe list of modules that are ignored by Tracker Actions. If tracker_module_config.enable_only is defined, then tracker_module_config.disable will be ignored. If neither config is defined, then all modules are enabled. By default, neither config is defined and all actions for all modules across all platforms will be enabled when Tracker Actions is enabled.TypeArrayRange of valuesModule keysVersions11.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['tracker_module_config']['disable'] = ['Reports', 'ActivityStream'];tracker_module_config.enable_only\nDescriptionA list of module names for which records are saved in the tracker table when Tracker Actions are enabled; all other modules will be disabled. If tracker_module_config.enable_only is empty or null or undefined, tracker_module_config.disable will apply. If neither config is defined, then all modules are enabled. By default, neither config is defined and all actions for all modules across all platforms will be enabled when Tracker Actions is enabled.\nTypeArrayRange of valuesModule keysVersions11.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['tracker_module_config']['enable_only'] = ['Reports', 'ActivityStream'];uninstallOnError\nDescriptionToggles the switch that uninstalls the package that was just installed if the install ended up with a PHP error. Instances running on Sugar's cloud environment will have this setting enforced as true.TypeBooleanRange of valuestrue and falseVersions12.0.3+ProductsEnterprise, Ultimate, Serve, SellDefault ValuetrueSugarCloud ValuetrueOverride Example$sugar_config['uninstallOnError'] = false;uninstall_timeout\nDescriptionControls the timeout time in seconds for an uninstall process.TypeInteger : SecondsVersions10.2.1+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value600Override Example$sugar_config['uninstall_timeout'] = 300;unique_key", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-76", "text": "DescriptionSpecifies the unique identifier for the instance. This value is used in features such as PHP caching, FTS indexing, and email archiving. It is extremely important that this string is unique from any other instances deployed even if they are only for development purposes only.TypeString : Unique IdentifierVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['unique_key'] = 'c0b5475f3f5b26ddb2976edc8865b5f6';upload_badext\nDescriptionAn array of extensions that cannot be uploaded in their native file format. Sugar will append a .txt extension to the end of any files with an invalid extension to avoid security issues with running unauthorized scripts on an instance.TypeArrayRange of valuesExtensions that cannot be uploaded as isVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['upload_badext'][] = 'swf';upload_dir\nDescriptionThe directory path where uploaded files are stored for note attachments, documents, and module loadable packages. By default, uploads are stored in the ./upload/ directory. For more information, refer to the Uploads documentation.TypeStringRange of valuesDirectory pathVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Valueupload/Override Example$sugar_config['upload_dir'] = 'upload/'upload_maxsize", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-77", "text": "DescriptionThe maximum individual file size that users can upload to modules that support file uploads. Restricts the upload limit from within Sugar without affecting any other applications that may be running on your server. This limit can be easily adjusted in Sugar via Admin > System Settings but is only useful if it is set to a size smaller than the php.ini limits. For more information, refer to the Uploads documentation.TypeInteger : Filesize in bytesVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['upload_maxsize'] = 40000000;upload_wrapper_class\nDescriptionThe name of the class used as upload wrapper.TypeString : Upload wrapper classVersions6.7.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValueUploadStreamOverride Example$sugar_config['upload_wrapper_class'] = 'SugarUploadS3';use_common_ml_dir\nDescriptionA security control that allows you to restrict Module Loader to read modules from a specific directory on the server and disable the ability to upload new modules into the Module Loader. To specify a new directory you will need to populate the config parameter 'common_ml_dir'.TypeBooleanRange of valuestrue and falseVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['use_common_ml_dir'] = true;use_php_code_json\nDescriptionDetermines if the environment has a valid version of PHP-JSON. This should be determined by the function returnPhpJsonStatus() and shouldn't be overridden.TypeBooleanRange of valuestrue and falseVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['use_php_code_json'] = true;use_real_names", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-78", "text": "DescriptionDisplay users' full names instead of their User Names in assignment fields.TypeBooleanRange of valuestrue and falseVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuetrueOverride Example$sugar_config['use_real_names'] = true;use_sprites\nDescriptionA sprite is a two-dimensional image or animation that is integrated into a larger scene. This parameter is used to disable sprites. This is set to true by default (if you have GD libraries installed).TypeBooleanRange of valuestrue and falseVersions6.4.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['use_sprites'] = false;validation\nDescriptionAn array that defines settings for user input validation behaviors.TypeArrayVersions7.7.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['validation'] = array();validation.compat_mode\nDescriptionDetermines compatibility mode for superglobals in the input validation framework. When enabled, setting, unsetting, and modifying $_GET, $_POST, or $_REQUEST values through PHP code is supported. Using PHP code to manipulate superglobals is discouraged. User input parameters should be considered read-only. As a transition period, this is currently allowed out-of-box, but may change in a future release. It is highly recommended for developers to verify their customizations work with this parameter set to false in preparation for the 7.9 release.TypeBooleanRange of valuestrue and falseVersions7.7.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value7.7.x: true7.8.x: true7.9.x: falseOverride Example$sugar_config['validation']['compat_mode'] = false;validation.soft_fail", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-79", "text": "DescriptionDetermines whether soft failure mode for the input validation framework is enabled. When this mode is enabled, any input validation violations will only be reported as a warning in the sugarcrm.log without having any negative impact on the request. When disabled, violations are reported as fatal in the sugarcrm.log and actual exceptions are being thrown resulting in an HTTP 500 response. \nIt is highly recommended for developers to verify their customizations work with this parameter set to false in preparation for the 8.0 release.TypeBooleanRange of valuestrue and falseVersions7.7.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value7.7.x: true7.8.x: true7.9.x: true8.0.x: falseOverride Example$sugar_config['validation']['soft_fail'] = false;vcal_time\nDescriptionUsed to determine the number of months in advance of the current date that the Free/Busy information for calls and meetings will be published. To turn Free/Busy publishing off, set this variable to '0'. The minimum is 1 month; the maximum is 12 months.TypeString : MonthsRange of values'1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', and '12'Versions5.2.0.c+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value2Override Example$sugar_config['vcal_time'] = '5';verify_client_ip\nDescriptionWhether or not to verify the client IP. Setting this to true will enable the system checking to see if the user is accessing Sugar from the IP address of their last page load.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-80", "text": "Note: This default value must be set to \"false\" in order to use Sugar Connect and Sugar Integrate.TypeBooleanRange of valuestrue and falseVersions10.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['verify_client_ip'] = true;web_logic_hook_timeout\nDescriptionTimeout for requests to web logic hooks. Any requests that run longer than the set limit will fail and trigger an error in the log.TypeInteger : secondsVersions11.1.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value10Override Example$sugar_config['web_logic_hook_timeout'] = 2;wl_list_max_entries_per_page\nDescriptionThe number of records to be shown per page on the listview of the mobile browser.TypeInteger : Number of records to displayVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value10Override Example$sugar_config['wl_list_max_entries_per_page'] = 10;wl_list_max_entries_per_subpanel\nDescriptionDetermines the number of records shown in the subpanels on the DetailView of the mobile browser.TypeInteger : RecordsVersions5.2.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value3Override Example$sugar_config['wl_list_max_entries_per_subpanel'] = 3;xhprof_config\nDescriptionConfiguration settings for xhprof. More information on xhprof can be found at http://pecl.php.net/package/xhprof.TypeArrayVersions6.5.10+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['xhprof_config'] = array();xhprof_config.enable", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-81", "text": "DescriptionEnables the xhprof profiler.TypeBooleanRange of valuestrue and falseVersions6.5.10+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuefalseOverride Example$sugar_config['xhprof_config']['enable'] = true;xhprof_config.filter_wt\nDescriptionThe wall time. Values are specified in milliseconds.TypeInteger : Wall time in millisecondsVersions7.6.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value0Override Example$sugar_config['xhprof_config']['filter_wt'] = 2;xhprof_config.flags\nDescriptionThe flags for xhprof profiler.TypeString : xhprof flagsVersions6.5.10+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['xhprof_config']['flags'] = XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY;xhprof_config.ignored_functions\nDescriptionAn array of function names to ignore from the profile.TypeArray : Function namesVersions6.5.10+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['xhprof_config']['ignored_functions'] = array(\"function_name\");xhprof_config.log_to\nDescriptionThe path to log the xhprof profiler output to.TypeString : Directory pathVersions6.5.10+ProductsProfessional, Enterprise, Ultimate, Serve, SellOverride Example$sugar_config['xhprof_config']['log_to'] = '{instance server path}/cache/xhprof';xhprof_config.manager\nDescriptionThe xhprof manager class to use. Prior to 7.7, specifying values xhprof_config.save_to, xhprof_config.mongodb_uri, xhprof_config.mongodb_db, xhprof_config.mongodb_collection, xhprof_config.mongodb_options, and", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-82", "text": "xhprof_config.filter_wt will need to have set xhprof_config.manager set to 'SugarXHprofPerformance'. As of 7.7, setting xhprof_config.manager is not longer required. \nIf you want to customize SugarXHprof, you can create the folder ./custom/include/SugarXHprof/ and create a file with your custom class class name. The custom class will need to extend SugarXHprof. If a custom class doesn't exist or hasn't been specified, SugarXHprof will be used.TypeString : ClassVersions6.5.10+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValueSugarXHprofOverride Example$sugar_config['xhprof_config']['manager'] = 'CustomSugarXHprof';xhprof_config.memory_limit\nDescriptionThe memory limit to set while saving profile data to storage.TypeString : Memory UsageVersions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value2048MOverride Example$sugar_config['xhprof_config']['memory_limit'] = '1024M';xhprof_config.mongodb_collection\nDescriptionThe name of the mongo db collections.TypeString : Mongo collection nameVersions7.6.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValueresultsOverride Example$sugar_config['xhprof_config']['mongodb_db'] = 'results_new';xhprof_config.mongodb_db\nDescriptionThe name of the mongo database.TypeString : Database nameVersions7.6.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuexhprofOverride Example$sugar_config['xhprof_config']['mongodb_db'] = 'xhprof2';xhprof_config.mongodb_options", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-83", "text": "DescriptionOptions for mongo db connection. The list of construct options can be found at: http://php.net/manual/en/mongoclient.construct.php#mongo.mongoclient.construct.parametersTypeArray : Mongo db optionsVersions7.6.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValueresultsOverride Example$sugar_config['xhprof_config']['mongodb_options'] = array();xhprof_config.mongodb_uri\nDescriptionThe mongo server URL.TypeString : URLVersions7.6.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Valuemongodb://localhost:27017Override Example$sugar_config['xhprof_config']['mongodb_uri'] = 'mongodb://localhost:27018';xhprof_config.sample_rate\nDescriptionThe sample rate of the xhprof profiler. 1/{specified value} requests are profiled. To sample all requests, set this value to 1.TypeInteger : Sample Rate (1/{value})Versions6.5.10+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault Value10Override Example$sugar_config['xhprof_config']['sample_rate'] = 1;xhprof_config.save_to\nDescriptionThe place to save xhprof data. If set to 'mongodb', the data is stored in the mongo database.TypeString : Save LocationRange of values'file' and 'mongodb'Versions7.6.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuemongodbOverride Example$sugar_config['xhprof_config']['save_to'] = 'mongodb';xhprof_config.track_elastic", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "b191d6b5f35c-84", "text": "DescriptionWhether or not to track elastic data.TypeBooleanRange of valuestrue or falseVersions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuetrueOverride Example$sugar_config['xhprof_config']['track_elastic'] = false;xhprof_config.track_elastic_backtrace\nDescriptionWhether or not to store the elastic backtrace data.TypeBooleanRange of valuestrue or falseVersions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuetrueOverride Example$sugar_config['xhprof_config']['track_elastic_backtrace'] = false;xhprof_config.track_sql\nDescriptionWhether or not to track SQL queries.TypeBooleanRange of valuestrue or falseVersions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuetrueOverride Example$sugar_config['xhprof_config']['track_sql'] = false;xhprof_config.track_sql_backtrace\nDescriptionWhether or not to store the SQL backtrace data.TypeBooleanRange of valuestrue or falseVersions7.7.0.0+ProductsProfessional, Enterprise, Ultimate, Serve, SellDefault ValuetrueOverride Example$sugar_config['xhprof_config']['track_sql_backtrace'] = false;\n \tLast modified: 2023-05-25 16:37:57", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Configurator/Core_Settings/index.html"} {"id": "c4d92fa83f81-0", "text": "Validation Constraints\nOverview\nThis article will cover how to add validation constraints to\u00c2\u00a0your custom\u00c2\u00a0code.\nConstraints\nValidation constraints\u00c2\u00a0allow developers to validate user input\nSymfony Validation Constraints\nThe\u00c2\u00a0Symfony's Validation library, located in ./vendor/symfony/validator/,\u00c2\u00a0contains many open source constraints. You can find the full list of constraints documented in Symphony's\u00c2\u00a0Validation Constraints. They are listed below for your reference.\nBasic Constraints\nNotBlank\nBlank\nNotNull\nIsNull\nIsTrue\nIsFalse\nType\nString Constraints\nEmail\nLength\nUrl\nRegex\nIp\nUuid\nNumber Constraints\nRange\nComparison Constraints\nEqualTo\nNotEqualTo\nIdenticalTo\nNotIdenticalTo\nLessThan\nLessThanOrEqual\nGreaterThan\nGreaterThanOrEqual\nDate Constraints\nDate\nDateTime\nTime\nCollection Constraints\nChoice\nCollection\nCount\nUniqueEntity\nLanguage\nLocale\nCountry\nFile Constraints\nFile\nImage\nFinancial and other Number Constraints\nBic\nCardScheme\nCurrency\nLuhn\nIban\nIsbn\nIssn\nOther Constraints\nCallback\nExpression\nAll\nUserPassword\nValid\nSugar Constraints\nSugar contains\u00c2\u00a0its own\u00c2\u00a0set of\u00c2\u00a0validation constraints. These constraints extend\u00c2\u00a0from Symfony's validation constraints\u00c2\u00a0and are located in ./src/Security/Validator/Constraints of\u00c2\u00a0your Sugar installation.\nBean/ModuleName\nBean/ModuleNameValidator\nComponentName\nComponentNameValidator\nDelimited\nDelimitedValidator\nDropdownList\nDropdownListValidator\nFile\nFileValidator\nGuid\nGuidValidator\nInputParameters\nInputParametersValidator\nJSON\nJSONValidator\nLanguage\nLanguageValidator\nLegacyCleanString\nLegacyCleanStringValidator\nMvc/ModuleName\nMvc/ModuleNameValidator\nPhpSerialized\nPhpSerializedValidator\nSql/OrderBy\nSql/OrderByValidator\nSql/OrderDirection\nSql/OrderDirectionValidator\nSugarLogic/FunctionName\nSugarLogic/FunctionNameValidator", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Validation_Constraints/index.html"} {"id": "c4d92fa83f81-1", "text": "Sql/OrderDirectionValidator\nSugarLogic/FunctionName\nSugarLogic/FunctionNameValidator\nCustom Constraints\nIf you find that the existing constraints do not meet your needs,\u00c2\u00a0you can also create your own. These constraints exist under\u00c2\u00a0./custom/src/Security/Validator/Constraints/.\u00c2\u00a0The following section will outline the details.\u00c2\u00a0The example below will demonstrate how to create a phone number validation constraint.\u00c2\u00a0\nThe constraint file will contain your validations error message.\n./custom/src/Security/Validator/Constraints/Phone.php\ncontext->buildViolation($constraint->message)\n ->setParameter('%msg%', 'invalid format')\n ->setInvalidValue($value)\n ->addViolation();\n return;\n }\n }\n}\nOnce the files are in place,\u00c2\u00a0navigate to Admin > Repairs and run a Quick Repair and Rebuild. Once completed, your constraint will be ready for use.\nUsing Constraints in API End Points\nIn this section, we will create a custom endpoint and trigger\u00c2\u00a0the custom phone constraint we created above.\u00c2\u00a0The\u00c2\u00a0code below will create a\u00c2\u00a0REST\u00c2\u00a0API endpoint path of\u00c2\u00a0/phoneCheck:\n./custom/clients/base/api/MyEndpointsApi.php\n array(\n //request type\n 'reqType' => 'POST',\n //endpoint path\n 'path' => array('phoneCheck'),", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Validation_Constraints/index.html"} {"id": "c4d92fa83f81-3", "text": "//endpoint path\n 'path' => array('phoneCheck'),\n //endpoint variables\n 'pathVars' => array(''),\n //method to call\n 'method' => 'phoneCheck', //minimum api version 'minVersion' => 10,\n //short help string to be displayed in the help documentation\n 'shortHelp' => 'An example of a POST endpoint to validate phone numbers',\n //long help to be displayed in the help documentation\n 'longHelp' => 'custom/clients/base/api/help/MyEndPoint_phoneCheck_help.html',\n ),\n );\n }\n /**\n * Method to be used for my MyEndpointsApi/phoneCheck endpoint\n */\n public function phoneCheck($api, $args)\n {\n $validator = Validator::getService();\n /**\n * Validating Phone Number\n */\n $phoneContraintBuilder = new ConstraintBuilder();\n $phoneConstraints = $phoneContraintBuilder->build(\n array(\n 'Assert\\Phone',\n )\n );\n $errors = $validator->validate($args['phone'], $phoneConstraints);\n if (count($errors) > 0) {\n /*\n * Uses a __toString method on the $errors variable which is a\n * ConstraintViolationList object. This gives us a nice string\n * for debugging.\n */\n $errorsString = (string) $errors;\n // include/api/SugarApiException.php\n throw new SugarApiExceptionInvalidParameter($errorsString);\n }\n //custom logic\n return $args;\n }\n}\nAfter creating the endpoint, navigate to Admin > Repairs and run a Quick Repair and Rebuild. The API will then be ready to use.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Validation_Constraints/index.html"} {"id": "c4d92fa83f81-4", "text": "Valid Payload - POST to /phoneCheck\nThe example below demonstrates a valid phone number post the /phoneCheck\u00c2\u00a0endpoint.\n{ phone: \"+1.23.456.789\"}\nResult\n{ phone: \"+1.23.456.789\"}\nInvalid Payload - POST to /phoneCheck\nThe example below demonstrates an invalid phone number post the\u00c2\u00a0/phoneCheck\u00c2\u00a0endpoint.\n{ phone: \"Invalid+1.23.456.789\"}\nResult\n{ \"error\":\"invalid_parameter\", \"error_message\":\"Invalid+1.23.456.789:\\n Phone number violation: invalid format\\n\"}\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Validation_Constraints/index.html"} {"id": "52fdaae5e07c-0", "text": "Sugar Logic\nOverview\nSugar Logic, a feature in all Sugar products, enables custom business logic that is easy to create, manage, and reuse on both the server and client.\nSugar Logic is made up of multiple components that build on each other and is extensible at every step. The base component is the Sugar Formula Engine, which parses and evaluates human-readable formulas. Dependencies are units made up of triggers and actions that can express custom business logic. Each dependency defines a list of actions to be performed depending on the outcome of a trigger formula.\nTerminology\nFormula : An expression that conforms to the Formula Engine syntax, consisting of nested functions and field variables\nFunction : A method that can be called in a formula\nTrigger : A formula that evaluates to either true or false when a field in the equation is updated or when a record is retrieved/saved\nAction : A method that modifies the current record or layout in some way\nDependency : A complete logical unit that includes a trigger and one or more actions\nSugar Formula Engine\nFormulas\nThe fundamental object is called a formula. A formula can be evaluated for a given record using the Sugar Logic parser.\nSome example formulas are:\nBasic addition:\nadd(1, 2)\nBoolean values:\nnot(equal($billing_state, \"CA\"))\nCalculation:\nmultiply(number($employees), $seat_cost, 0.0833)\nTypes\nSugar Logic has several fundamental types: number, string, boolean, and enum (lists). Functions may take in any of these types or combinations thereof and return as output one of these types. Fields may also often have their value set to only a certain type.\nNumber Type\nNumber types essentially represent any real number (which includes positive, negative, and decimal numbers). They can be plainly typed as input to any function. For example, the operation (10 + 10 + (15 - 5)) can be performed as follows:", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Sugar_Logic/index.html"} {"id": "52fdaae5e07c-1", "text": "add(10, 10, subtract(15, 5))\nString Type\nA string type is very much like a string in most programming languages. However, it can only be declared within double quotes. For example, consider this function, which returns the length of the input string:\nstrlen(\"Hello World\")\nThe function would appropriately return the value 11.\nBoolean Type\nA boolean type is simple. It can be one of two values: \"true\" or \"false\". This type mainly acts as a flag that indicates whether a condition has been met or not. For example, this function contains takes two strings as input and returns \"true\" if the first string contains the second string, or \"false\" otherwise:\nand(contains(\"Hello World\", \"llo Wo\"), true)\nThe function would appropriately return the value \"true\".\nEnum Type (list)\nAn enum type is a collection of items. The items do not need to all be of the same type, they can be varied. An enum can be declared using the enum function as follows:\nenum(\"hello world!\", false, add(10, 15))\nAlternatively, the createList() function (an alias to enum) can be used to create enums in a formula.\ncreateList(\"hello world!\", false, add(10, 15))\nThis function would appropriately return an enum type containing \"hello world!\", false, and 25 as its elements.\nLink Type (relationship)\nA link represents one side of a relationship and is used to access related records. For example, the accounts link field of Contacts is used to access the account_type field of the account related to a contact:\nrelated($accounts, \"account_type\")\nFor most of the out-of-the-box relationships, links are named with the name of the related module, in lower case.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Sugar_Logic/index.html"} {"id": "52fdaae5e07c-2", "text": "Follow these steps to find the name of the link fields for relationships that do not follow the convention above:\nOpen the vardef file for the module you are working on: ./cache/modules/{module}/{module}vardefs.php\nFind the link field that matches the relationship you are looking for.\nFunctions\nFunctions are methods to be used in formulas. Each function has a function name, a parameter count, a parameter type requirement, and returns a value. Some functions such as add() can take any number of parameters. For example: add(1), add(1, 2), and add(1, 2, 3) are all valid formulas. Functions are designed to produce the same result whether executed on the server or client.\nTriggers\nA trigger is an object that listens for changes in field values and, after a change occurs, triggers the associated actions in a dependency.\nActions\nActions are functions that\u00c2\u00a0modify a target in some way and are fired when the trigger is TRUE. Most Actions require at least two parameters: a target and a formula. For example, a style action will change the style of a field based on a passed-in string formula. A value action will update a value of a field by evaluating a passed in formula.\nnotActions\nnotActions are functions that\u00c2\u00a0modify a target in some way and are fired when the trigger is FALSE. notActions are optional and if they are not defined then nothing will fire when the trigger is FALSE.\u00c2\u00a0 Most notActions require at least two parameters: a target and a formula. For example, a style action will change the style of a field based on a passed-in string formula. A value action will update a value of a field by evaluating a passed in formula.\nDependencies", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Sugar_Logic/index.html"} {"id": "52fdaae5e07c-3", "text": "Dependencies\nA Dependency describes a set of rules based on a trigger and a set of actions. Examples include a field whose properties must be updated dynamically or a panel which must be hidden when a drop down value is not selected. When a Dependency is triggered it will appropriately carry out the action it is designed to. A basic Dependency is when a field's value is dependent on the result of evaluating a Expression. For example, consider a page with five fields with It's \"a\", \"b\", \"c\", \"d\", and \"sum\". A generic Dependency can be created between \"sum\" and the other four fields by using an Expression that links them together, in this case an add Expression. So we can define the Expression in this manner: 'add($a, $b, $c, $d)' where each field id is prefixed with a dollar ($) sign so that the value of the field is dynamically replaced at the time of the execution of the Expression.\nAn example of a more customized Dependency is when the field's style must be somehow updated to a certain value. For example, the DIV with id \"temp\" must be colored blue. In this case we need to change the background-color property of \"temp\". So we define a StyleAction in this case and pass it the field id and the style change that needs to be performed and when the StyleAction is triggered, it will change the style of the object as we have specified.\nSugar Logic Based Features\nCalculated Fields\nFields with calculated values can now be created from within Studio and Module Builder. The values are calculated based on Sugar Logic formulas. These formulas are used to create a new dependency that are executed on the client side in edit views and the server side on save. The formulas are saved in the varies or vardef extensions and can be created and edited directly. For example, the metadata for a simple calculated commission field in opportunities might look like:\n'commission_c' => array(", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Sugar_Logic/index.html"} {"id": "52fdaae5e07c-4", "text": "'commission_c' => array(\n 'name' => 'commission_c',\n 'type' => 'currency',\n 'calculated' => true,\n 'formula' => 'multiply($amount, 0.1)',\n //enforced causes the field to appear read-only on the layout\n 'enforced' => true\n),\nDependent fields\nA dependent field will only appear on a layout when the associated formula evaluates to the Boolean value true. Currently these cannot be created through Studio and must be enabled manually with a custom vardef or vardef extension. The \"dependency\" property contains the expression that defines when this field should be visible. An example field that only appears when an account has an annual revenue greater than one million.\n'dep_field'=> array(\n 'name' => 'dep_field',\n 'type' => 'varchar',\n 'dependency' => 'greaterThan($annual_revenue, 1000000)',\n),\nDependent dropdowns\nDependent dropdowns are dropdowns for which options change when the selected value in a trigger dropdown changes. The metadata is defined in the vardefs and contains two major components, a \"trigger\" id which is the name of the trigger dropdown field and a 'visibility grid' that defines the set of options available for each key in the trigger dropdown. For example, you could define a sub-industry field in accounts whose available values depend on the industry field.\n'sub_industry_c' => array(\n 'name' => 'sub_industry_c',\n 'type' => 'enum',\n 'options' => 'sub_industry_dom',\n 'visibility_grid'=> array(\n 'trigger' => 'industry',\n 'values' => array(\n 'Education' => array(\n 'primary', \n 'secondary', \n 'college'\n ),", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Sugar_Logic/index.html"} {"id": "52fdaae5e07c-5", "text": "'primary', \n 'secondary', \n 'college'\n ),\n 'Engineering' => array(\n 'mechanical', \n 'electrical', \n 'software'\n ),\n ),\n ),\n),\nClearing the Sugar Logic Cache\nThe ./updatecache.php script traverses the Expression directory for every file that ends with \"Expression.php\" (ignoring a small list of excepted files) and constructs both a PHP and a JavaScript functions cache file which resides in ./cache/Expressions/functions_cache.js and ./cache/Expressions/functionmap.php. If you create your custom expressions, you will need to rebuild the sugar logic functions by navigating to:\nAdmin > Repair > Rebuild Sugar Logic Functions\nTopicsDependency ActionsThe following sections outline the available SugarLogic dependency actions.Extending Sugar LogicHow to write custom Sugar Logic functions.Using Sugar Logic DirectlyHow to use Sugar Logic\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Sugar_Logic/index.html"} {"id": "d5f594202e9a-0", "text": "Dependency Actions\nOverview\nThe following sections outline the available SugarLogic dependency actions.\nDependency Parameters\nDependency definitions will generally contain\u00c2\u00a0most, if not all, of the parameters displayed in the table below. The following sections will outline each dependency\u00c2\u00a0action as well as dependency specific parameters.\nParameter\nType\nDescription\nhooks\n\u00c2\u00a0Array\n\u00c2\u00a0The views to execute the trigger on. Possible values are:\u00c2\u00a0\"edit\", \"view\", \"save\" and \"all\". \u00c2\u00a0 If you include 'save' or\u00c2\u00a0'all' then SugarCRM will try to save the calculated value to the database. \u00c2\u00a0So if your dependency is display only then\u00c2\u00a0only include the views that it will show up on.\ntrigger\n\u00c2\u00a0String\n\u00c2\u00a0Optional. The trigger for the dependency. Defaults to 'true'.\ntriggerFields\n\u00c2\u00a0Array\n\u00c2\u00a0The list of fields to watch for change events. When changed, the trigger expressions will be recalculated.\nonload\n\u00c2\u00a0Boolean\n\u00c2\u00a0Whether or not to trigger the dependencies when the page is loaded.\nactions\n\u00c2\u00a0Array\n\u00c2\u00a0The list of dependencies to execute when the trigger expression is true.\nnotActions\n\u00c2\u00a0Array\n\u00c2\u00a0The list of dependencies to execute when the trigger expression is false.\n\u00c2", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Sugar_Logic/Dependency_Actions/index.html"} {"id": "d5f594202e9a-1", "text": "\u00c2\u00a0The list of dependencies to execute when the trigger expression is false.\n\u00c2\u00a0\nTopicsReadOnlyThe SugarLogic ReadOnly action, located in ./include/Expressions/Actions/ReadOnlyAction.php, is used to determine if a field is editable or not based on a formula.SetOptionsThe SugarLogic SetOptions action, located in ./include/Expressions/Actions/SetOptionsAction.php, is used to set the options list of a dropdown field based on a formula.SetPanelVisibilityThe SugarLogic SetPanelVisibility action, defined in ./include/Expressions/Actions/PanelVisibilityAction.php, is used to determine the visibility of a record view panel based on a formula.SetRequiredThe SugarLogic SetRequired action, located in ./include/Expressions/Actions/SetRequiredAction.php, is used to determine if a field is required.SetValueThe SugarLogic SetValue action, located in ./include/Expressions/Actions/SetValueAction.php, is used to set the value of a field based on a formula.SetVisibilityThe SugarLogic SetVisibility action, located in ./include/Expressions/Actions/VisibilityAction.php , is used to determine the visibility logic of a field based on a formula.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Sugar_Logic/Dependency_Actions/index.html"} {"id": "1e62e6705f0d-0", "text": "SetValue\nOverview\nThe SugarLogic\u00c2\u00a0SetValue action, located in ./include/Expressions/Actions/SetValueAction.php, is used to set the value of a field based on a formula.\nImplementation\nWhile the dependency metadata for your module can be defined in\u00c2\u00a0./modules//metadata/dependencydefs.php and \u00c2\u00a0./custom/modules//metadata/dependencydef.php, it is recommended to use the extension framework when customizing stock modules to prevent third party\u00c2\u00a0plugins from conflicting with your customizations. The following section\u00c2\u00a0will demonstrate how to implement a read-only dependency.\nSetValue Parameters\nParameter\nType\nDescription\ntarget\nString\nThe name of the field to target for visibility.\nvalue\nString\nSugarLogic formula used to get the value for the target field.\nFor more information on the various parameters in the dependency definitions, please refer to the dependency actions documentation.\nExamples\nThe follow sections outline the various ways this dependency can be implemented.\nDependency Extensions\nFor our example, we will create a dependency on the Leads module that will display the number of activities related to a Lead. \u00c2\u00a0Activities are composed of calls, meetings, tasks, notes, and emails.\u00c2\u00a0An\u00c2\u00a0example extension definition is shown below:\n./custom/Extension/modules//Ext/Dependencies/custom_phone_alternate.php\n array(\"edit\", \"view\"), //not including save so that the value isn't stored in the DB\n 'trigger' => 'true', //Optional, the trigger for the dependency. Defaults to 'true'.\n 'onload' => true, //Whether or not to trigger the dependencies when the page is loaded\n 'actions' => array(\n array(\n 'name' => 'SetValue',\n 'params' => array(", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Sugar_Logic/Dependency_Actions/SetValue/index.html"} {"id": "1e62e6705f0d-1", "text": "'name' => 'SetValue',\n 'params' => array(\n 'target' => 'activity_count_c',\n 'value' => 'add(\n count($notes),\n count($calls),\n count($emails),\n count($meetings),\n count($tasks)\n )'\n )\n )\n )\n);\nOnce you have\u00c2\u00a0the file in place, you will need to navigate to Admin > Repairs > and\u00c2\u00a0run\u00c2\u00a0a Quick Repair and Rebuild.\nNote: It is important that the module name is plural ('Cases' vs. 'Case') and that the name of the dependency, \"activity_count_dep\" in this example,\u00c2\u00a0is\u00c2\u00a0unique.\nChaining Dependencies\nYou can also add as many actions as you need to the array.\u00c2\u00a0In the example below, we want to display our count value but prevent users from being able to edit the value.\u00c2\u00a0An\u00c2\u00a0example extension definition is shown below:\n array(\"edit\", \"view\"), //not including save so that the value isn't stored in the DB\n 'trigger' => 'true', //Optional, the trigger for the dependency. Defaults to 'true'.\n //'triggerFields' => array('status'), //unneeded for this example as its not field triggered\n 'onload' => true,\n 'actions' => array(\n array(\n 'name' => 'SetValue',\n 'params' => array(\n 'target' => 'activity_count_c',\n 'value' => 'add(\n count($notes),\n count($calls),\n count($emails),\n count($meetings),\n count($tasks)", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Sugar_Logic/Dependency_Actions/SetValue/index.html"} {"id": "1e62e6705f0d-2", "text": "count($emails),\n count($meetings),\n count($tasks)\n )'\n )\n ),\n array(\n 'name' => 'ReadOnly',\n 'params' => array(\n 'target' => 'activity_count_c',\n 'value' => 'true', //Set to true instead of a formula because its always read-only\n ),\n )\n )\n);\nOnce you have\u00c2\u00a0the file in place, you will need to navigate to Admin > Repairs > and\u00c2\u00a0run\u00c2\u00a0a Quick Repair and Rebuild.\nNote: It is important that the module name is plural ('Cases' vs. 'Case') and that the name of the dependency, \"number_of_cases_dep\" in this example,\u00c2\u00a0is\u00c2\u00a0unique.\nDependencies in Field Definitions\nUnlike several of the other dependencies, SetValue is built into Studio.\u00c2\u00a0 So this dependency can be set as a custom vardef value or in the vardefs file of a\u00c2\u00a0custom module.\u00c2\u00a0 If you wanted to add this dependency to an existing field then you can create a vardef extension\u00c2\u00a0such as\u00c2\u00a0./custom/Extension/modules//Ext/Vardefs/.\u00c2\u00a0An\u00c2\u00a0example extension definition is shown below:\n./custom/Extension/modules/Accounts/Ext/Vardefs/activity_count_c.php\n Repairs > and\u00c2\u00a0run\u00c2\u00a0a Quick Repair and Rebuild.\n\u00c2\u00a0\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Sugar_Logic/Dependency_Actions/SetValue/index.html"} {"id": "e87c2fec07a6-0", "text": "ReadOnly\nOverview\nThe SugarLogic \u00c2\u00a0ReadOnly\u00c2\u00a0action, located in ./include/Expressions/Actions/ReadOnlyAction.php, is used to determine\u00c2\u00a0if a field is editable or not based on a formula.\nImplementation\nWhile the dependency metadata for your module can be defined in\u00c2\u00a0./modules//metadata/dependencydefs.php and \u00c2\u00a0./custom/modules//metadata/dependencydef.php, it is recommended to use the extension framework when customizing stock modules to prevent third-party\u00c2\u00a0plugins from conflicting with your customizations. The following section\u00c2\u00a0will demonstrate how to implement a read-only dependency.\nReadOnly Parameters\nParameter\nType\nDescription\ntarget\nString\nThe name of the field to make read only.\nvalue\nString\nThis parameter can accept a boolean formula or\u00c2\u00a0true\u00c2\u00a0and\u00c2\u00a0false\u00c2\u00a0values.\u00c2\u00a0 Normally you would put aSugarLogic formula here to set the boolean.\nFor more information on the various parameters in the\u00c2\u00a0dependency definitions, please refer to the dependency actions\u00c2\u00a0documentation.\nExample\nFor our example, we will create a dependency on the Accounts module that makes the name field read-only\u00c2\u00a0when the lock_record_c field has been checked.\u00c2\u00a0The first step is to create the\u00c2\u00a0\u00c2\u00a0lock_record_c\u00c2\u00a0checkbox field in Studio and add it to your Record View layout. When this checkbox is checked, we will make the name field read-only. Our example extension definition is shown below:\u00c2\u00a0\n./custom/Extension/modules//Ext/Dependencies/custom_name_read_only.php\n array(\"edit\"),\n 'trigger' => 'true',\n //Optional, the trigger for the dependency. Defaults to 'true'.\n 'triggerFields' => array('lock_record_c'),\n 'onload' => true,", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Sugar_Logic/Dependency_Actions/ReadOnly/index.html"} {"id": "e87c2fec07a6-1", "text": "'onload' => true,\n //Actions is a list of actions to fire when the trigger is true\n // You could list multiple fields here each in their own array under 'actions'\n 'actions' => array(\n array(\n 'name' => 'ReadOnly',\n //The parameters passed in will depend on the action type set in 'name'\n 'params' => array(\n 'target' => 'name',\n 'value' => 'equal($lock_record_c,true)',\n ),\n ),\n ),\n);\nOnce you have all the files in place you will need to navigate to Admin > Repairs > and\u00c2\u00a0run\u00c2\u00a0a Quick Repair and Rebuild.\nNote: It is important that the module name is plural ('Accounts' vs. 'Account') and that the name of the dependency, \"readonly_fields\" in this example,\u00c2\u00a0is\u00c2\u00a0unique.\nConsiderations\nIn some scenarios, you may want a specific field to always be read-only. To accomplish this, you can modify the\u00c2\u00a0'value'\u00c2\u00a0attribute to always be \"true\". Given the above example, you would\u00c2\u00a0modify:\n'value' => 'equal($lock_record_c,true)', \nto be:\n'value' => 'true', \n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Sugar_Logic/Dependency_Actions/ReadOnly/index.html"} {"id": "add168159293-0", "text": "SetRequired\nOverview\nThe SugarLogic SetRequired action, located in ./include/Expressions/Actions/SetRequiredAction.php, is used to determine\u00c2\u00a0if a field is required.\u00c2\u00a0\nImplementation\nWhile the dependency metadata for your module can be defined in\u00c2\u00a0./modules//metadata/dependencydefs.php and \u00c2\u00a0./custom/modules//metadata/dependencydef.php, it is recommended to use the extension framework when customizing stock modules to prevent third-party\u00c2\u00a0plugins from conflicting with your customizations. The following section\u00c2\u00a0will demonstrate how to implement a read-only dependency.\nSetRequired Parameters\nParameter\nType\nDescription\ntarget\nString\nThe name of the field to make required.\nlabel\nString\nid of label element for this field\nvalue\nString\nFormula used to determine if the field should be required.\nFor more information on the various parameters in the dependency definitions, please refer to the dependency actions documentation.\nExample\nFor our example, we will create a dependency on the Cases module that will mark the resolution field as required when the status field is set to \"Closed\".\u00c2\u00a0Our example extension definition is shown below:\n./custom/Extension/modules//Ext/Dependencies/required_resolution_dep.php\n array(\"edit\"),\n 'trigger' => 'true',\n 'triggerFields' => array('status'),\n 'onload' => true,\n //Actions is a list of actions to fire when the trigger is true\n 'actions' => array(\n array(\n 'name' => 'SetRequired',\n //The parameters passed in will depend on the action type set in 'name'\n 'params' => array(\n 'target' => 'resolution',\n 'label' => 'resolution_label',", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Sugar_Logic/Dependency_Actions/SetRequired/index.html"} {"id": "add168159293-1", "text": "'target' => 'resolution',\n 'label' => 'resolution_label',\n 'value' => 'equal($status, \"Closed\")',\n ),\n ),\n ),\n);\nOnce you have\u00c2\u00a0the file in place, you will need to navigate to Admin > Repairs > and\u00c2\u00a0run\u00c2\u00a0a Quick Repair and Rebuild.\nNote: It is important that the module name is plural ('Cases' vs. 'Case') and that the name of the dependency, \"required_resolution_dep\" in this example,\u00c2\u00a0is\u00c2\u00a0unique.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Sugar_Logic/Dependency_Actions/SetRequired/index.html"} {"id": "56ffbe1f1dba-0", "text": "SetOptions\nOverview\nThe SugarLogic\u00c2\u00a0SetOptions action, located in ./include/Expressions/Actions/SetOptionsAction.php, is used to set the options list of a dropdown field based on a formula.\nImplementation\nWhile the dependency metadata for your module can be defined in\u00c2\u00a0./modules//metadata/dependencydefs.php and \u00c2\u00a0./custom/modules//metadata/dependencydef.php, it is recommended to use the extension framework when customizing stock modules to prevent third party\u00c2\u00a0plugins from conflicting with your customizations. The following section\u00c2\u00a0will demonstrate how to implement a read-only dependency.\nSetoptions Parameters\nParameter\nType\nDescription\ntarget\nString\nThe name of the dropdown field that you want to change the option list for\nkeys\nString\nA formula used to get the option list keys for the target field or a list name from which keys will be extracted.\nlabels\nString\nA formula used to get the option list labels for the target field or a list name from which labels will be extracted.\nFor more information on the various parameters in the dependency definitions, please refer to the dependency actions documentation.\nExamples\nThe following sections outline the various ways this dependency can be implemented.\nUsing an Existing DropDown List\nYou can also set the options list to any current options list already in the system\u00c2\u00a0 For example if you wanted to have the industry dropdown in Accounts show the 'bug_type_dom' list from Bugs you could do this\n array(\"edit\",\"save\"),\n 'trigger' => 'true',\n 'triggerFields' => array('industry'),\n 'onload' => true,\n 'actions' => array(\n array(\n 'name' => 'SetOptions',\n 'params' => array(", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Sugar_Logic/Dependency_Actions/SetOptions/index.html"} {"id": "56ffbe1f1dba-1", "text": "'name' => 'SetOptions',\n 'params' => array(\n 'target' => 'industry',\n 'keys' => 'getDropdownKeySet(\"bug_type_dom\")',\n 'labels' => 'getDropdownValueSet(\"bug_type_dom\")'\n ),\n ),\n ),\n);\nThis would grab the keys and label from the 'bug_type_dom' using the getDropdownKeySet() and getDropdownValueSet() JavaScript functions and display them instead of the normal list.\u00c2\u00a0\nOnce you have\u00c2\u00a0the file in place, you will need to navigate to Admin > Repairs > and\u00c2\u00a0run\u00c2\u00a0a Quick Repair and Rebuild.\nNote: It is important that the module name is plural ('Accounts' vs. 'Account') and that the name of the dependency, \"setoptions_industry\" in this example,\u00c2\u00a0is\u00c2\u00a0unique.\nComplex Dynamic Lists\nFor our first example, we will change a dropdown called fruits_c to include only fruits that are\u00c2\u00a0in season.\u00c2\u00a0 This could be done with a dependent dropdown but that would require the user to pick the proper season.\u00c2\u00a0 With this, we can have a function that returns only fruit that is in season right now.\u00c2\u00a0 I added the dropdown fruits_c to Leads and created a new list for it that looks like this\n$app_list_strings['fruits_list']=array (\n\t'Apples' => 'Apples',\n\t'Strawberries' => 'Strawberries',\n\t'Mangos' => 'Mangos',\n\t'Pineapples' => 'Pineapples',\n\t'Blackberries' => 'BlackBerries',\n\t'BlueBerries' => 'BlueBerries',\n);\nTo keep it simple I made the labels and the keys the same.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Sugar_Logic/Dependency_Actions/SetOptions/index.html"} {"id": "56ffbe1f1dba-2", "text": ");\nTo keep it simple I made the labels and the keys the same.\nThen I extended SugarLogic as outlined in Extending SugarLogic and made a new function\u00c2\u00a0called fruitInSeason() that returns a string reflecting what fruit is in season right now. \u00c2\u00a0To work for the createList() function it would return a list like \"Apples\",\"Mangos\",\"BlueBerries\".\n./custom/Extension/modules//Ext/Dependencies/custom_fruit_in_season.php\n array(\"edit\",\"save\"),\n 'trigger' => 'true',\n 'triggerFields' => array('fruits_c'),\n 'onload' => true,\n 'actions' => array(\n array(\n 'name' => 'SetOptions',\n 'params' => array(\n 'target' => 'fruits_c',\n 'keys' => \"createList(fruitInSeason())\",\n 'labels' => \"createList(fruitInSeason())\"\n ),\n ),\n ),\n);\nThe createList() function is a JavaScript function from Sidecar.\u00c2\u00a0 It requires a comma delimited quote enclosed list of options.\u00c2\u00a0\nWe only want this to affect EditViews and Saves, not normal record views since they need to be able to display all fruits and not a truncated list of them.\u00c2\u00a0 So we make the 'hooks' array\n'hooks' => array(\"edit\",\"save\"),\nOnce you have\u00c2\u00a0the file in place, you will need to navigate to Admin > Repairs > and\u00c2\u00a0run\u00c2\u00a0a Quick Repair and Rebuild.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Sugar_Logic/Dependency_Actions/SetOptions/index.html"} {"id": "56ffbe1f1dba-3", "text": "Note: It is important that the module name is plural ('Leads' vs. 'Lead') and that the name of the dependency, \"setoptions_fruit\" in this example,\u00c2\u00a0is\u00c2\u00a0unique.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Sugar_Logic/Dependency_Actions/SetOptions/index.html"} {"id": "2949c5c6b17b-0", "text": "SetVisibility\nOverview\nThe SugarLogic\u00c2\u00a0SetVisibility\u00c2\u00a0action, located in\u00c2\u00a0./include/Expressions/Actions/VisibilityAction.php\u00c2\u00a0, is used to\u00c2\u00a0determine\u00c2\u00a0the visibility logic of a field based on a formula.\nImplementation\nWhile the dependency metadata for your module can be defined in\u00c2\u00a0./modules//metadata/dependencydefs.php and \u00c2\u00a0./custom/modules//metadata/dependencydef.php, it is recommended to use the extension framework when customizing stock modules to prevent third party\u00c2\u00a0plugins from conflicting with your customizations. The following section\u00c2\u00a0will demonstrate how to implement a read-only dependency.\nSetVisibility Parameters\nParameter\nType\nDescription\ntarget\nString\nThe name of the field to target for visibility.\nvalue\nString\nThis parameter can accept a boolean formula or\u00c2\u00a0true\u00c2\u00a0and\u00c2\u00a0false\u00c2\u00a0values.\u00c2\u00a0 Normally you would put aSugarLogic formula here to set the boolean.\nFor more information on the various parameters in the dependency definitions, please refer to the dependency actions documentation.\nExamples\nThe follow sections outline the various ways this dependency can be implemented.\u00c2\u00a0\nSetVisibility Dependency Extensions\nFor our example, we will create a dependency on the Accounts module that shows the phone_alternate field when the phone_office field has been populated. An example is shown below.\n./custom/Extension/modules//Ext/Dependencies/custom_phone_alternate.php\n array(\"edit\"),\n 'triggerFields' => array('phone_office'),\n 'onload' => true,\n //Actions is a list of actions to fire when the trigger is true\n 'actions' => array(\n array(\n 'name' => 'SetVisibility',\n 'params' => array(", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Sugar_Logic/Dependency_Actions/SetVisibility/index.html"} {"id": "2949c5c6b17b-1", "text": "'name' => 'SetVisibility',\n 'params' => array(\n 'target' => 'phone_alternate',\n 'value' => 'not(equal($phone_office,\"\"))',\n ),\n ),\n ),\n );\nOnce you have\u00c2\u00a0the file in place, you will need to navigate to Admin > Repairs > and\u00c2\u00a0run\u00c2\u00a0a Quick Repair and Rebuild.\nNote: It is important that the module name is plural ('Accounts' vs. 'Account') and that the name of the dependency, \"phone_alternate_hide\" in this example,\u00c2\u00a0is\u00c2\u00a0unique.\u00c2\u00a0\nVisibility Dependencies in Field Definitions\nUnlike several of the other dependencies, SetVisibility is built into Studio.\u00c2\u00a0 So this dependency can be set as a custom vardef value or in the varefs file for a new module. If you wanted to add this dependency to an existing field then you could add a file to ./custom/Extension/modules//Ext/Vardefs/. An example is shown below.\nTo accomplish this, we will create an extension in ./custom/Extension/modules/Accounts/Ext/Vardefs/.\u00c2\u00a0\n./custom/Extension/modules/Accounts/Ext/Vardefs/phone_alternate.php\n Repairs > and\u00c2\u00a0run\u00c2\u00a0a Quick Repair and Rebuild. Once that is done, you can enter a value into phone_office and the phone_alternate field will show up once you tab out of the phone_office field. If you were coding a custom\u00c2\u00a0module with new fields, then you would just include it in the modules vardefs.php file\u00c2\u00a0as shown below\n array(\n ...\n 'phone_alternate' => array( \n\t 'name' => 'phone_alternate', \n\t 'vname' => 'LBL_PHONE_ALTERNATE', \n\t 'type' => 'varchar', \n\t 'len' => 10, \n\t 'dependency'=> 'not(equal($phone_office,\"\"))', \n\t 'comment' => 'Other Phone Number', \n\t 'merge_filter' => 'enabled', \n ),\n ...\n )\n ...\n);\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Sugar_Logic/Dependency_Actions/SetVisibility/index.html"} {"id": "1412c9e60367-0", "text": "SetPanelVisibility\nOverview\nThe SugarLogic SetPanelVisibility\u00c2\u00a0action,\u00c2\u00a0defined in ./include/Expressions/Actions/PanelVisibilityAction.php, is used to determine\u00c2\u00a0the visibility of a record view panel based on a formula.\u00c2\u00a0\nImplementation\nWhile the dependency metadata for your module can be defined in\u00c2\u00a0./modules//metadata/dependencydefs.php and \u00c2\u00a0./custom/modules//metadata/dependencydef.php, it is recommended to use the extension framework when customizing stock modules to prevent third-party\u00c2\u00a0plugins from conflicting with your customizations. The following section\u00c2\u00a0will demonstrate how to implement a read-only dependency.\nSetPanelVisibility Parameters\nParameter\nType\nDescription\ntarget\nString\nThe id of the panel to hide\nvalue\nString\nFormula used to determine if the panel should be visible.\nFor more information on the various parameters in the dependency definitions, please refer to the dependency actions documentation.\nExample\nFor our example, we will create a dependency on the Cases module that will hide a specific\u00c2\u00a0panel\u00c2\u00a0if the status field on\u00c2\u00a0a case is set to \"Closed\". Our example extension definition is shown below:\u00c2\u00a0\n./custom/Extension/modules//Ext/Dependencies/hide_panel_2_dep.php\n array(\"edit\",\"view\"),\n 'trigger' => 'equal($status, \"Closed\")',\n 'triggerFields' => array('status'),\n 'onload' => true,\n //Actions is a list of actions to fire when the trigger is true\n 'actions' => array(\n array(\n 'name' => 'SetPanelVisibility',\n 'params' => array(\n 'target' => 'detailpanel_2',\n 'value' => 'true',\n ),", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Sugar_Logic/Dependency_Actions/SetPanelVisibility/index.html"} {"id": "1412c9e60367-1", "text": "'value' => 'true',\n ),\n )\n ),\n //notActions is a list of actions to fire when the trigger is false\n 'notActions' => array(\n array(\n 'name' => 'SetPanelVisibility',\n 'params' => array(\n 'target' => 'detailpanel_2',\n 'value' => 'false',\n ),\n ),\n ),\n);\nOnce you have\u00c2\u00a0the file in place, you will need to navigate to Admin > Repairs > and\u00c2\u00a0run\u00c2\u00a0a Quick Repair and Rebuild.\nNote: It is important that the module name is plural ('Cases' vs. 'Case') and that the name of the dependency, \"panel_2_visibility\" in this example,\u00c2\u00a0is\u00c2\u00a0unique.\n\u00c2\u00a0\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Sugar_Logic/Dependency_Actions/SetPanelVisibility/index.html"} {"id": "9bb980ce6094-0", "text": "Extending Sugar Logic\nOverview\nHow to write custom Sugar Logic functions.\nWriting a Custom Formula Function\nThe most important feature of Sugar Logic is that it is simply and easily extendable. Both custom formula functions and custom actions can be added in an upgrade-safe manner to allow almost any custom logic to be added to Sugar. Custom functions will be stored in ./custom/include/Expressions/Expression/{Type}/{Function_Name}.php.\nThe first step in writing a custom function is to decide what category the function falls under. Take, for example, a function for calculating the factorial of a number. In this case, we will be returning a number so we will create a file in ./custom/include/Expressions/Expression/Numeric/ called FactorialExpression.php. In the new PHP file we just created, we will define a class called FactorialExpression that will extend NumericExpression. All formula functions must follow the format {functionName}Expression.php and the class name must match the file name.\nNext, we need to decide what parameters the function will accept. In this case, we need take in a single parameter, the number to return the factorial of. Since this class will be a sub-class of NumericExpression, it by default accepts only numeric types and we do not need to worry about specifying the type requirement.\nNext, we must define the logic behind evaluating this expression. So we must override the abstract evaluate() function. The parameters can be accessed by calling an internal function getParameters() which returns the parameters passed into this object. So, with all this information, we can go ahead and write the code for the function.\nNote: For the custom function to appear in Studio after completing these steps, you must compile your code by running the Rebuild Sugar Logic Functions job in Admin > Schedulers and then clear your browser cache.\ngetParameters();\n // params is an Expression object, so evaluate it\n // to get its numerical value\n $number = $params->evaluate();\n // exception handling\n if ( ! is_int( $number ) )\n {\n throw new Exception(\"factorial: Only accepts integers\");\n }\n if ( $number < 0 )\n {\n throw new Exception(\"factorial: The number must be positive\");\n }\n // special case 0! = 1\n if ( $number == 0 ) return 1;\n // calculate the factorial\n $factorial = 1;\n for ( $i = 2 ; $i <= $number ; $i ++ )\n {\n $factorial = $factorial * $i;\n }\n return $factorial;\n }\n // Define the javascript version of the function\n static function getJSEvaluate()\n {\n return <<\nOne of the key features of Sugar Logic is that the functions should be defined in both PHP and JavaScript and have the same functionality under both circumstances. As you can see above, the getJSEvaluate() method should return the JavaScript equivalent of your evaluate() method. The JavaScript code is compiled and assembled for you after you run the \"Rebuild Sugar Logic Functions\" script through Admin > Schedulers.\nWriting a Custom Action\nUsing custom actions, you can easily create reusable custom logic or integrations that can include user-editable logic using the Sugar Formula Engine. Custom actions will be stored in ./custom/include/Expressions/Actions/{ActionName}.php. Actions files must end in Action.php and the class defined in the file must match the file name and extend the AbstractAction class. The basic functions that must be defined are fire, getDefinition, getActionName, getJavascriptClass, and getJavscriptFire. Unlike functions, there is no requirement that an action works exactly the same\u00c2\u00a0for both server and client side as this is not always sensible or feasible.\nA simple action could be \"WarningAction\" that shows an alert warning the user that something may be wrong and logs a message to the ./sugarcrm.log file if triggered on the server side. It will take in a message as a formula so that the message can be customized at runtime. We would do this by creating a PHP file in ./custom/include/Expressions/Actions/WarningAction.php as shown below:\n./custom/include/Expressions/Actions/WarningAction.php\nmessageExp}')\";\n }\n /**\n * Applies the Action to the target.\n * @param SugarBean $target\n */\n function fire(&$target)\n {\n //Parse the message formula and log it to fatal.\n $expr = Parser::replaceVariables($this->messageExp, $target);\n $result = Parser::evaluate($expr)->evaluate();\n $GLOBALS['log']->warn($result);\n }\n /**\n * Returns the definition of this action in array format.\n */\n function getDefinition()\n {", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Sugar_Logic/Extending_Sugar_Logic/index.html"} {"id": "9bb980ce6094-4", "text": "*/\n function getDefinition()\n {\n return array(\"message\" => $this->messageExp);\n }\n /**\n * Returns the short name used when defining dependencies that use this action.\n */\n static function getActionName()\n {\n return \"Warn\";\n }\n}\n?>\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Sugar_Logic/Extending_Sugar_Logic/index.html"} {"id": "f47353f32369-0", "text": "Using Sugar Logic Directly\nHow to use Sugar Logic\nTopicsAccessing an External API with a Sugar Logic ActionLet us say we were building a new Action called \"SetZipCodeAction\" that uses the Yahoo geocoding API to get the zip code for a given street + city + state address.Creating a Custom Dependency for a ViewDependencies can also be created and executed outside of the built in features. For example, if you wanted to have the description field of the Calls module become required when the subject contains a specific value, you could extend the calls edit view to include that dependency.Creating a Custom Dependency Using MetadataThe files should be located in ./custom/Extension/modules/{module}/Ext/Dependencies/{dependency name}.php and be rebuilt with a quick repair after modification.Using Dependencies in Logic HooksDependencies can not only be executed on the server side but can be useful entirely on the server. For example, you could have a dependency that sets a rating based on a formula defined in a language file.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Sugar_Logic/Using_Sugar_Logic_Directly/index.html"} {"id": "478387601208-0", "text": "Creating a Custom Dependency for a View\nDependencies can also be created and executed outside of the built in features. For example, if you wanted to have the description field of the Calls module become required when the subject contains a specific value, you could extend the calls edit view to include that dependency.\n./custom/modules/Calls/views/view.edit.php\nsetTrigger(new Trigger($triggerExp, $triggerFields));\n //Set the description field to be required if \"important\" is in the call subject\n $dep->addAction(ActionFactory::getNewAction('SetRequired', array(\n 'target' => 'description',\n 'label' => 'description_label',\n 'value' => 'true'\n )));\n //Set the description field to NOT be required if \"important\" is NOT in the call subject\n $dep->addFalseAction(ActionFactory::getNewAction('SetRequired', array(\n 'target' => 'description',\n 'label' => 'description_label',\n 'value' => 'false'\n )));", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Sugar_Logic/Using_Sugar_Logic_Directly/Creating_a_Custom_Dependency_for_a_View/index.html"} {"id": "478387601208-1", "text": "'value' => 'false'\n )));\n //Evaluate the trigger immediatly when the page loads\n $dep->setFireOnLoad(true);\n $javascript = $dep->getJavascript();\n echo \n SUGAR.forms.AssignmentHandler.registerView('EditView');\n {$javascript}\n \nEOQ;\n }\n}\n?>\nThe above code creates a new Dependency object with a trigger based on the 'name' (Subject) field in of the Calls module. It then adds two actions. The first will set the description field to be required when the trigger formula evaluates to true (when the subject contains \"important\"). The second will fire when the trigger is false and removes the required property on the description field. Finally, the javascript version of the Dependency is generated and echoed onto the page.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Sugar_Logic/Using_Sugar_Logic_Directly/Creating_a_Custom_Dependency_for_a_View/index.html"} {"id": "296d69dda5da-0", "text": "Accessing an External API with a Sugar Logic Action\nLet us say we were building a new Action called \"SetZipCodeAction\" that uses the Yahoo geocoding API to get the zip code for a given street + city + state address.\nSince the Yahoo geocoding API requires JSON requests and returns XML data, we will have to write both PHP and JavaScript code to make and interpret the requests. Because accessing external APIs in a browser is considered cross-site scripting, a local proxy will have to be used. We will also allow the street, city, state parameters to be passed in as formulas so the action could be used in more complex Dependencies.\nFirst, we should add a new action that acts as the proxy for retrieving data from the Yahoo API. The easiest place to add that would be a custom action in the \"Home\" module. The file that will act as the proxy will be .custom/modules/Home/geocode.php. It will take in the parameters via a REST call, make the call to the Yahoo API, and return the result in JSON format.\ngeocode.php contents:\n getZipCode($_REQUEST['street'], $_REQUEST['city'], $_REQUEST['state'])));\n\t}\n}\n?>\nNext, we will need to map the geocode action to the geocode.php file. This is done by adding an action map to the Home Module. Create the file ./custom/modules/Home/action_file_map.php and add the following line of code:\ntarget = empty($params['target']) ? \" \" : $params['target'];", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Sugar_Logic/Using_Sugar_Logic_Directly/Accessing_an_External_API_with_a_Sugar_Logic_Action/index.html"} {"id": "296d69dda5da-2", "text": "$this->streetExp = empty($params['street']) ? \" \" : $params['street'];\n $this->cityExp = empty($params['city']) ? \" \" : $params['city'];\n $this->stateExp = empty($params['state']) ? \" \" : $params['state'];\n }\n static function getJavascriptClass()\n {\n return \"'($this->target}', '{$this->streetExp}', '{$this->cityExp}', '{$this->stateExp}')\";\n }\n function fire(&$bean)\n {\n require_once(\"custom/modules/Home/geocode.php\");\n $vars = array(\n 'street' => 'streetExp',\n 'city' => 'cityExp',\n 'state' => 'stateExp'\n );\n foreach($vars as $var => $exp)\n {\n $toEval = Parser::replaceVariables($this->$exp, $bean);\n $var = Parser::evaluate($toEval)->evaluate();\n }\n $target = $this->target;\n $bean->$target = getZipCode($street, $city, $state);\n }\n function getDefinition()\n {\n return array(\n \"action\" => $this->getActionName(),\n \"target\" => $this->target,\n );\n }\n static function getActionName()\n {\n return \"SetZipCode\";\n }\n}\n?>\nOnce you have the action written, you need to call it somewhere in the code. Currently, this must be done as shown above using custom views, logic hooks, or custom modules.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Sugar_Logic/Using_Sugar_Logic_Directly/Accessing_an_External_API_with_a_Sugar_Logic_Action/index.html"} {"id": "399c878a35a5-0", "text": "Creating a Custom Dependency Using Metadata\nThe files should be located in ./custom/Extension/modules/{module}/Ext/Dependencies/{dependency name}.php and be rebuilt with a quick repair after modification.\nDependencies can have the following properties:\nhooks : Defines when the dependency should be evaluated. Possible values are edit (on edit/quickCreate views), view (Detail/Wireless views), save (during a save action), and all (any time the record is accessed/saved).\ntrigger : A boolean formula that defines if the actions should be fired. (optional, defaults to 'true')\ntriggerFields : An array of field names that when when modified should trigger re-evaluation of this dependency on edit views. (optional, defaults to the set of fields found in the trigger formula)\nonload : If true, the dependency will be fired when an edit view loads (optional, defaults to true)\nactions : An array of action definitions to fire when the trigger formula is true.\nnotActions : An array of action definitions to fire when the trigger formula is false. (optional)\nThe actions are defined as an array with the name of the action and a set of parameters to pass to that action. Each action takes different parameters, so you will have to check each actions class constructor to check what parameters it expects.\nThe following example dependency will set the resolution field of cases to be required when the status is Closed:\n array(\"edit\"),\n //Optional, the trigger for the dependency. Defaults to 'true'.\n 'trigger' => 'true', \n 'triggerFields' => array('status'),\n 'onload' => true,\n //Actions is a list of actions to fire when the trigger is true\n 'actions' => array(\n array(", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Sugar_Logic/Using_Sugar_Logic_Directly/Creating_a_custom_dependency_using_metadata/index.html"} {"id": "399c878a35a5-1", "text": "'actions' => array(\n array(\n 'name' => 'SetRequired',\n //The parameters passed in will depend on the action type set in 'name'\n 'params' => array(\n 'target' => 'resolution',\n //id of the label to add the required symbol to\n 'label' => 'resolution_label',\n //Set required if the status is closed\n 'value' => 'equal($status, \"Closed\")' \n )\n ),\n ),\n //Actions fire if the trigger is false. Optional.\n 'notActions' => array(),\n);\n\u00c2\u00a0\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Sugar_Logic/Using_Sugar_Logic_Directly/Creating_a_custom_dependency_using_metadata/index.html"} {"id": "2fcaf2e098f2-0", "text": "Using Dependencies in Logic Hooks\nOverview\nDependencies can not only be executed on the server side\u00c2\u00a0but can be useful entirely on the server. For example, you could have a dependency that sets a rating based on a formula defined in a language file.\nsetTrigger(new Trigger('true', $triggerFields));\n $dep->addAction(ActionFactory::getNewAction('SetValue', array(\n 'target' => 'rating',\n 'value' => $formula\n )));\n $dep->fire($bean);\n }\n}\n\u00c2\u00a0\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Sugar_Logic/Using_Sugar_Logic_Directly/Using_dependencies_in_Logic_Hooks/index.html"} {"id": "73fee97a1d47-0", "text": "Performance Tuning\nThe following sections detail ways to enhance the performance of your Sugar instance.\nTopicsSugar PerformancePerformance recommendations when working with Sugar.PHP ProfilingAs of the 6.6.2 release, Sugar introduced the ability to profile via XHProf, which is an easy-to-use, hierarchical profiler for PHP. This allows developers to better manage and understand customer performance issues introduced by their customizations. This tool enables quick and accurate identification of the sources of performance sinks within the code by generating profiling logs. Profiling gives you the ability to see the call stack for the entire page load with timing details around function and method calls as well as statistics on call frequency.Integrating Sugar With New Relic APM for Performance ManagementSugar\u00c2\u00ae 7 includes support for New Relic APM\u00e2\u0084\u00a2, a third-party Application Performance Management (APM) tool that can facilitate deep insight into your Sugar instance in order to troubleshoot sluggish response times. This article explains how to set up and use New Relic in conjunction with Sugar for powerful performance management capabilities.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Performance_Tuning/index.html"} {"id": "d965c373ed42-0", "text": "Sugar Performance\nOverview\nAs your company uses Sugar over time, the size of your database will naturally grow and, without the proper maintenance, performance will inevitably begin to degrade. The purpose of this article is to review some of the most common recommendations for increasing the performance in Sugar to help increase the system's efficiency for your users.\nNote: This guide is intended for on-site installations. Customers hosted on Sugar's cloud service should file a support case for any performance issues.\nGeneral Settings in Sugar\nThe following recommendations can be modified in the Sugar admin interface\nDo Not Set Listview and Subpanel Items Per Page to Excessive Settings. Under Admin > System Settings, there are two settings 'Listview items per page' and 'Subpanel items per page'. The defaults for these settings are 20 and 10 respectively. When increasing these values, it should be expected that general system wide performance will be impacted. We generally recommend keeping listview settings to 100 or less and subpanel settings to be set to 10 or less to keep system performance optimal.\nMake sure 'Developer Mode' is disabled under Admin > System Settings. This setting should never be enabled in a production environment as it causes cached files to be rebuilt on every page load.\nSet the 'Log Level' to 'Fatal' and 'Maximum log size' to '10M' under Admin > System Settings. The log level should only be set to more verbose levels when troubleshooting the application as it will cause a performance degradation as user activity increases.\nEnsure the scheduled job, 'Prune Database on the 1st of Month', is set to 'Active'. This will go through your database and delete any records that have been deleted by your users. Sugar only soft deletes records when a user deletes a record and over time, this will cause performance degradation if these records are not removed from the database.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Performance_Tuning/Sugar_Performance/index.html"} {"id": "d965c373ed42-1", "text": "Make sure 'Tracker Performance' and 'Tracker Queries' are disabled under Admin > Tracker. These settings are intended to help diagnose performance issues and should never be left enabled in a production environment.\nEnsure large scheduler jobs are running at slower intervals under Admin > Scheduler. Jobs such as 'Check Inbound Mailboxes' can decrease overall performance if they are running every minute and polling a lot of data. It is important to set these jobs to every 5 or 10 minutes to help offset the performance impacts for your users.\nSugar Performance Settings\nGeneral Settings\nDisable client IP verification\u00c2\u00a0:\u00c2\u00a0Eliminates the system checking to see if the user is accessing Sugar from the IP address of their last page load.\n$sugar_config['verify_client_ip'] = false;\nBWC Modules\nFor modules running in Backward Compatibility mode, the following settings can be used to speed up performance:\nDrop the absolute totals from listviews :\u00c2\u00a0Eliminates performing expensive count queries on the database when populating listviews and subpanels.\n$sugar_config['disable_count_query'] = true;\nDisable automatic searches on listviews :\u00c2\u00a0Forces a user to perform a search when they access a listview rather than loading the results from their last search.\n$sugar_config['save_query'] = 'populate_only';\n\u00c2\u00a0Hide all subpanels\u00c2\u00a0:\u00c2\u00a0 Increases performance by collapsing all subpanels when accessing a detailview every time and not querying for data until a user explicitly expands a subpanel\u00c2\u00a0\n$sugar_config['hide_subpanels'] = true;\nHide subpanels per session\u00c2\u00a0:\u00c2\u00a0 Increases performance by collapsing all subpanels when accessing a detailview when the user logs in but any subpanels expanded during the user's session will remain expanded until the user logs out\n$sugar_config['hide_subpanels_on_login'] = true;\nGeneral Environment Checks", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Performance_Tuning/Sugar_Performance/index.html"} {"id": "d965c373ed42-2", "text": "$sugar_config['hide_subpanels_on_login'] = true;\nGeneral Environment Checks\nDepending on your environment and version of Sugar, there may be additional changes your system administrator can make to improve performance.\nIf your instance is running Sugar 6.3.x or lower, we highly recommend upgrading to 6.4.x or 6.5.x. Beginning in 6.4.x, we made a number of query improvement to address overall application performance. With 6.5.x, we drastically improved the UI to improve the speed of page loads.\nIf your instance of Sugar is version 6.3.x or higher with a MySQL database, we highly recommend upgrading the MySQL 5.5. MySQL 5.5 offers performance improvements in a number of areas over 5.1 such as subselects in queries.\nIf you are using MySQL as your database, we strongly recommend using InnoDB. InnoDB is tested to be better performing than MyISAM and should be the default configuration for using MySQL with Sugar.\nIf you are running PHP 5.2.x, we strongly recommend upgrading to a supported version of PHP 5.3. Our current list of supported PHP versions can be found on our Supported Platforms page.\nIf you are using a single server setup (web server and database on the same server), we have the following recommendations.\nThe server should have a minimum of 8 GB of RAM and roughly follow the 60/40 rule (60% for database / 40% for web server). On a 8 GB server, this would mean 4.8 GB for database and 3.2 GB for web server.\nMake sure the following parameters are set for MySQL (assumption is that the engine is InnoDB)\ninnodb_buffer_pool_size = 4294967296 (4 GB in size)", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Performance_Tuning/Sugar_Performance/index.html"} {"id": "d965c373ed42-3", "text": "innodb_buffer_pool_size = 4294967296 (4 GB in size)\ninnodb_log_buffer_size = anywhere from 10485760 (10 MB - Minimal writes) to 104857600 (100 MB - Lots of writes)\nIf you are using IE 8 or lower, we recommend upgrading to IE 9 or using Google Chrome. Earlier versions of IE 8 exhibit poor performance with our application and we recommend updating your browser to IE 9 or changing to Chrome.\nPHP Caching\nWhether your instance of Sugar is deployed on a Linux or Windows server, you should utilize opcode caching to ensure optimal performance. For Linux servers, APC is the recommended opcode cache for PHP with the following guidelines and settings:\nUse the latest stable version.\napc.shm size should be close to your program size. For Sugar, that's at least 150 MB (default for apc.shm is 32 MB). When in doubt, more is always better.\napc.stat_ctime should be enabled. This will ensure file changes are noticed. You should note that this may increase the\u00c2\u00a0stat() activity to your NFS.\napc.file_update_protection should be enabled.\u00c2\u00a0This helps the system when trying to add multiple files to\u00c2\u00a0the cache at the same time.\nIf your installation of Sugar is located on a network filesystem such as NFS or CIFS, make sure apc.stat is enabled.\napc.ttl should be set to 0. This parameter disables garbage collection and can cause fragmentation. Earlier APC releases had locking issues that made caches with many entries take forever to be garbage collected.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Performance_Tuning/Sugar_Performance/index.html"} {"id": "d965c373ed42-4", "text": "apc.shm_segments should be set to the default of 1. If you think you really need multiple shm_segments, you must also read the documentation on apc.mmap_file_mask as well and understand and set that value accordingly. If you don't understand apc.mmap_file_mask, you should leave apc.shm_segments at the default value.\nAPC ships with an additional apc.php file that when hit with a browser, will show settings, cache information, and fragmentation. If you suspect APC problems, this is a great tool to start checking things out.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Performance_Tuning/Sugar_Performance/index.html"} {"id": "b51d8c58060a-0", "text": "Integrating Sugar With New Relic APM for Performance Management\nOverview\nSugar\u00c2\u00ae 7 includes support for New Relic APM\u00e2\u0084\u00a2, a third-party Application Performance Management (APM) tool that can facilitate deep insight into your Sugar instance in order to troubleshoot sluggish response times. This article explains how to set up and use New Relic in conjunction with Sugar for powerful performance management capabilities.\nNote:\u00c2\u00a0This article pertains to on-site installations of Sugar only.\u00c2\u00a0SugarCloud customers who are experiencing performance-related issues should contact the Sugar Support team for assistance.\nPrerequisites\nTo install and configure New Relic for use with your Sugar instance, you must have Sugar hosted on-site and have access to the root directory.\u00c2\u00a0\nYou must be a New Relic account holder. To sign up for New Relic, please visit newrelic.com to find the subscription level best suited for your needs.\nSteps to Complete\nNew Relic can provide useful information outside of the Sugar integration, but the feedback it provides will be limited to the instance's PHP file structure, which could make troubleshooting your instance a challenge. Follow these instructions to set up and use New Relic for PHP with your Sugar instance.\nInstalling the New Relic for PHP Agent\nFirst, install the New Relic for PHP agent. For the most current installation steps, please refer to the Getting Started Guide on the documentation site for New Relic for PHP.\nConfiguring Sugar to Work With New Relic for PHP\nEnable the Sugar integration with New Relic by editing the\u00c2\u00a0./config_override.php\u00c2\u00a0file. Add the following lines to the end of the file contents (explanation follows):\n$sugar_config['metrics_enabled'] = 1;\n$sugar_config['metric_providers']['SugarMetric_Provider_Newrelic'] = 'include/SugarMetric/Provider/Newrelic.php';", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Performance_Tuning/Integrating_Sugar_With_New_Relic_APM_for_Performance_Management/index.html"} {"id": "b51d8c58060a-1", "text": "$sugar_config['metric_settings']['SugarMetric_Provider_Newrelic']['applicationname'] = \"SugarCRM New Relic\";\nThe first line of the configuration enables metrics collection for your Sugar instance.\nThe second line specifies the path where the New Relic provider files can be found. Note: When overwriting the New Relic provider, this path must be changed to the location where the files are located in the ./custom/ directory.\nThe last line allows you to configure a custom application name so that you may make a distinction between production, staging and development environments. This name will be displayed in your New Relic application list. Simply replace the text inside the double quotes with your desired application name. In the example above, we name the application, \"SugarCRM New Relic\".\nUsing New Relic for PHP\nNew Relic integrated with Sugar enables you to view the exact functions that cause unusual performance behavior in your instance, such as unexpected triggering of logic hooks, database queries that should be optimized, or customizations that are responding slower than expected.\nShortly after completing the configuration steps above, a new application will appear in the New Relic APM interface's application list.\u00c2\u00a0Click on the appropriate application's name to view the overview dashboard.\nOverview Dashboard\nThe dashboard gives you a quick overview of\u00c2\u00a0server response times over a selected period. By default, it will show data collected within the last 30 minutes. To the right of this chart is the Apdex\u00c2\u00a0(short for application performance index) chart. Apdex provides an easy way to measure whether performance meets user expectations.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Performance_Tuning/Integrating_Sugar_With_New_Relic_APM_for_Performance_Management/index.html"} {"id": "b51d8c58060a-2", "text": "In this instance, the Apdex threshold, or T-value, is configured to 0.5 seconds. This means that an app server response time of 0.5 seconds or less is satisfactory for the users, a response time between 0.5 seconds and 2.0 seconds is tolerable, and any value higher than 2.0 seconds becomes frustrating.\u00c2\u00a0\nThe default Apdex T-value for New Relic\u00c2\u00a0is 0.5 seconds but it can be configured to match your current environment and user expectations. For information on changing the Apdex T-value, please refer to the\u00c2\u00a0Change Your\u00c2\u00a0Apdex Settings\u00c2\u00a0article in the New Relic documentation.\nTransactions\nThe Transactions listing is one of the most powerful tools available in New Relic. It will reveal the specific calls or actions that are taking the most time and resources from the server, and speculate as to why. Select \"Transactions\" in the menu on the left to see a full overview of all the calls done in sugar, sorted by the most time consuming.\nIn this\u00c2\u00a0case, rest_Calls_filterList is selected, which monitors the length of time that it takes to call the Calls module's list view. The performance data for this transaction is displayed on the right. As you can see at the top of the chart, calling the Calls listview has an average response time of 1.5 seconds.\nRefer to the breakdown table\u00c2\u00a0in the lower part of the screen to see which part of the call is taking the most time, with a representation of the performed actions on the database per segment.\nBelow the breakdown table\u00c2\u00a0is a list of transaction traces. New Relic will automatically generate a transaction trace when a response time is in the frustrating zone of the Apdex\u00c2\u00a0or slower.\u00c2\u00a0Click on the transaction trace to learn what is having the negative impact on the performance for this activity.\u00c2", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Performance_Tuning/Integrating_Sugar_With_New_Relic_APM_for_Performance_Management/index.html"} {"id": "b51d8c58060a-3", "text": "The transaction trace shows how long various components took to load. In this case, the SELECT query on the Calls table took a significant amount of time.\nClick on the Trace Details tab above the chart to investigate further. The details page displays specific functions that are being called and how long they took to execute. By drilling down in the tree to the child functions, it is possible to find the root cause of the impaired performance.\nScroll down to find the SELECT query on calls took 1 second to load.\u00c2\u00a0\nClick on the database icon next to the action to reveal the SQL query called by Sugar.\nTo view all SQL queries at once, click on the SQL Statements tab.\nSummary\nFor critical business applications like CRM, an APM tool can you help keep your system running fast so\u00c2\u00a0end users\u00c2\u00a0stay productive and your organization sees a maximum return on investment. An integrated APM will monitor, analyze, and visualize the response times of your application to identify bottlenecks \u00c2\u00a0so that your team can proactively address them.\u00c2\u00a0\nTo learn more about using New Relic for PHP, please visit the New Relic\u00c2\u00a0documentation website.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Performance_Tuning/Integrating_Sugar_With_New_Relic_APM_for_Performance_Management/index.html"} {"id": "354b8af582e6-0", "text": "PHP Profiling\nOverview\nAs of the 6.6.2 release, Sugar introduced the ability to profile via XHProf, which is an easy-to-use, hierarchical profiler for PHP. This allows developers to better manage and understand customer performance issues introduced by their customizations. This tool enables quick and accurate identification of the sources of performance sinks within the code by generating profiling logs. Profiling gives you the ability to see the call stack for the entire page load with timing details around function and method calls as well as statistics on call frequency.\nAssuming XHProf is installed and enabled in your PHP configuration (which you can learn how to do in the PHP Manual), you can enable profiling in Sugar by adding the following parameters to the ./config_override.php file:\n$sugar_config['xhprof_config']['enable'] = true;\n$sugar_config['xhprof_config']['log_to'] = '{instance server path}/cache/xhprof';\n// x where x is a number and 1/x requests are profiled. So to sample all requests set it to 1\n$sugar_config['xhprof_config']['sample_rate'] = 1;\n// array of function names to ignore from the profile (pass into xhprof_enable)\n$sugar_config['xhprof_config']['ignored_functions'] = array();\n// flags for xhprof\n$sugar_config['xhprof_config']['flags'] = XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY;\nPlease note that with the above 'log_to' parameter, you would need to create the \u00c2\u00a0./cache/xhprof/ directory in your instance directory with proper permissions and ownership for the Apache user. You can also opt to leave the \u00c2\u00a0xhprof_config.log_to\u00c2\u00a0parameter empty and set the logging path via the \u00c2\u00a0xhprof.output_dir parameter in the \u00c2\u00a0php.ini file.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Performance_Tuning/PHP_Profiling/index.html"} {"id": "354b8af582e6-1", "text": "Once the above parameters are set, XHProf profiling will log all output to the indicated directory and allow you to research any performance related issues encountered in the process of developing and maintaining the application.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Performance_Tuning/PHP_Profiling/index.html"} {"id": "3c8aec8355c9-0", "text": "Caching\nOverview\nMuch of Sugar's\u00c2\u00a0user interface is built dynamically using a combination of templates, metadata and language files. A file caching mechanism improves the performance of the system by reducing the number of static metadata and language files that need to be resolved at runtime. This cache directory stores the compiled files for JavaScript files, Handlebars templates, and language files.\nIn a stock instance, the cache is located in the ./cache/\u00c2\u00a0directory. If you would like to move this directory to a new location, you can update the config parameter cache_dir in config.php or config_override.php to meet your needs. It is not advisable to move the cache\u00c2\u00a0to another network server\u00c2\u00a0as it may impact system performance.\nDeveloper Mode\nTo prevent caching while developing, a developer may opt to turn on Developer Mode by navigating to Admin > System Settings > Advanced > Developer Mode. This will disable caching so that developers can test code-level customizations without the need to manually rebuild the cache, which is especially helpful when developing templates, metadata, or language files. The system automatically refreshes the file cache. Make sure to deactivate Developer Mode after completing customizations because this mode degrades system performance.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Caching/index.html"} {"id": "0e08463a4399-0", "text": "Web Accessibility\nOverview\nLearn about the\u00c2\u00a0Sugar Accessibility Plugin for Sidecar.\nIntroduction\nMaking your application accessible -- per the standards defined by the W3C's WAI specifications -- is a hard thing to do and even harder to maintain. The goal of the Sugar Accessibility Plugin for Sidecar is to automatically apply rules to your rendered HTML, so that you don't have to be concerned with all of the intricacies of accessibility.\nWith respect to programmatically applying accessibility rules, you can generally assume that the rules fall into one of three categories:\nRules that are dependent on the context of the element's use and cannot be applied programmatically because the context is never clear.\nRules that can be applied programmatically, but only when the context is clear.\nRules that can always be applied programmatically.\nWe plan to continue to develop this plugin to address more and more accessibility concerns in an abstract way, with the intention of completely covering the latter two cases. In the meantime, the plugin handles two very specific cases: and (2) One from the third category.\nHow It Works\nThe plugin listens to the render event for all View.Component objects that are created. Anytime a component is rendered, the plugin runs its own plugins (hereinafter referred to as \"helpers\") on the component. Each of these helpers is responsible for determining if any modifications are necessary in order for the component's HTML to meet accessibility standards and then carrying out those changes in the DOM. This behavior is done automatically as a part of the sidecar framework, so you do not need to do anything to start using it.\nSometimes, a component that you write will modify the HTML after it has been rendered. The plugin has no means of becoming aware of these changes to the HTML and you will have to tell it to look for rules to apply. One example is found inView.Fields.Base.ActionmenuField.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Web_Accessibility/index.html"} {"id": "0e08463a4399-1", "text": "When the user selects all records in a list view, an alert is flashed indicating that all visible records are now selected. Within this alert, a link can be clicked to select all records, even those that are not currently visible. A new onclick event listener is registered for this link. And because this link is added to the DOM after the component is rendered, the author of the component must make sure that the new HTML meets accessibility requirements. Here is how that is done:\nvar $el = $('a#select-all');\n$el.on('click', function() {...});\napp.accessiblity.run($el, 'click');\nThis will only run the click helper. If you want to run all helpers, then call app.accessiblity.run($el) (without the second parameter). But be aware that some helpers only support View.Component objects, while others support eitherView.Component objects or jQuery DOM elements. So running all helpers on a jQuery DOM element may fail, or at least fail to apply some accessibility rules as expected.\nWhen the logger is configured for debug mode, messages are logged indicating which helpers are being run and which helpers could not be run when intended.\nPlugins\nA plugin (or helper) is a module that applies an accessibility rule to a View.Component (or jQuery DOM element). At runtime, these helpers can be found in app.accessibility.helpers and implement a run method. The run method takes aView.Component (or jQuery DOM element) and then checks its HTML to determine if anything needs to be done in order to make the HTML compliant with accessibility standards related to the rule or task with which the helper is concerned. If any changes are necessary, the helper then modifies the HTML to comply.\nClick\nThe click helper is responsible for making an element compliant with accessibility standards when click events are bound to said element. Since this helper only deals with onclick events, it only inspects elements within the component that include onclick event listeners.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Web_Accessibility/index.html"} {"id": "0e08463a4399-2", "text": "If the tag name cannot be determined for an element being inspected, then there is no way of knowing whether or not the element is accessible. Thus, the element is assumed to be compliant.\nInherently focusable elements are those elements that require no intervention. These elements include:\nbutton\ninput\nselect\ntextarea\nConditionally focusable elements are those elements that require intervention under certain circumstances. In the case of and tags, these elements are compliant as long as they contain an href attribute. These elements include:\na\narea\nAll other elements are not inherently focusable and require a tabindex attribute of -1 if a tabindex attribute does not already exist. This helper adds tabindex=\"-1\" to any elements within the component that are not compliant.\nWhen the logger is configured for debug mode, messages are logged...\nIn the event that no onclick events were found within the component. Thus, no action is taken.\nIn the event that an element being inspected has no tag name.\nTo report the type of element being made compliant.\nTo report the type of element that is already found to be compliant.\nLabel\nThe label helper adds an aria-label to the form element found within the component. This helper only inspects elements that can be found via the component's fieldTag selector and is consdered a \"best effort\" approach.\nThis helper will only work on View.Field components since it is extremely unlikely for the fieldTag selector forView.Layout or View.View components to match form elements.\nA form element is considered to be compliant if the aria-label attribute is already present or if its tag is not one that requires a label. These elements include:\nbutton\ninput\nselect\ntextarea", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Web_Accessibility/index.html"} {"id": "0e08463a4399-3", "text": "button\ninput\nselect\ntextarea\nThis helper adds aria-label=\"{label}\" to the element that needs to be made compliant. View.Field.label is the label that is assigned to the attribute. The component must be a View.Component. Plain jQuery DOM elements are not sufficient since they do not include alabel property.\nAPI\nSUGAR.accessibility.init()\nInitializes the accessibility module to execute all accessibility helpers on components as they are rendered. This is called by the application during bootstrapping.\nSUGAR.accessibility.run()\nLoads the accessibility helpers that are to be run and executes them on the component.\nArguments\nName\nType\nRequired\nDescription\ncomponent\nView.Component/jQuery\ntrue\nThe element to test for accessibility compliance.\nhelper\nString/Array\nfalse\nOne or more names of specified helpers to run. All registered helpers will be run if undefined.\nReturns\nVoid\nSUGAR.accessibility.whichHelpers()\nGet the helpers registered on a specific element.\nName\nType\nRequired\nDescription\nhelper\nString/Array\ntrue\nOne or more names of specified helpers to run.\nReturns\nArray - The accessibility helpers that were requested. Filters out any named helpers that are not registered. All registered helpers are returned if no helper names are provided as a parameter.\nSUGAR.accessibility.getElementTag()\nGenerates a human-readable string for identifying an element. For example, \u00c2\u00a0a[name=\"link\"][class=\"btn btn-link\"][href=\"http://www.sugarcrm.com/\"]. Primarily used for logging purposes, this method is useful for debugging.\nArguments\nName\nType\nRequired\nDescription\n$el\njQuery\ntrue\nThe element for which the tag should be generated.\nReturns\nString - A string representing an element's tag, with all attributes. The element's selector, if one exists, is returned when a representation cannot be reasonably generated.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Web_Accessibility/index.html"} {"id": "0e08463a4399-4", "text": "Last modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Web_Accessibility/index.html"} {"id": "b7889ecccad7-0", "text": "Languages\nOverview\nSugar as an application platform is internationalized and localizable. Data is stored and presented in the UTF-8 codepage, allowing for all character sets to be used. Sugar provides a language-pack framework that allows developers to build support for any language in the display of user interface labels. Each language pack has its own set of display strings which is the basis of language localization. You can add or modify languages using the information in this guide.Please scroll to the bottom of this page for additional language topics.\nLanguage Keys\nSugar differentiates languages with unique language keys. These keys prefix the files that correspond with particular languages. For example, the default language for the application is English (US), which is represented by the language key en_us. Any file that contains data specific to the English (US) language begins with the characters en_us. Language label keys that are not recognized will default to the English (US) version.\nThe following table displays the list of current languages and their corresponding keys:\nLanguage\nLanguage Key\nAlbanian (Shqip)\nsq_AL\nArabic (\u00d8\u00a7\u00d9\u0084\u00d8\u00b9\u00d8\u00b1\u00d8\u00a8\u00d9\u008a\u00d8\u00a9)\nar_SA\nBulgarian (\u00d0\u0091\u00d1\u008a\u00d0\u00bb\u00d0\u00b3\u00d0\u00b0\u00d1\u0080\u00d1\u0081\u00d0\u00ba\u00d0\u00b8)\nbg_BG\nCatalan (Catal\u00c3\u00a0)\nca_ES\nChinese (\u00e7\u00ae\u0080\u00e4\u00bd\u0093\u00e4\u00b8\u00ad\u00e6\u0096\u0087)\nzh_CN\nCroatian (Hrvatski)\nhr_HR\nCzech (\u00c4\u008cesky)\ncs_CZ\nDanish (Dansk)\nda_DK\nDutch (Nederlands)\nnl_NL\nEnglish (UK)\nen_UK\nEnglish (US)\nen_us\nEstonian (Eesti)\net_EE", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Languages/index.html"} {"id": "b7889ecccad7-1", "text": "English (US)\nen_us\nEstonian (Eesti)\net_EE\nFinnish (Suomi)\nfi_FI\nFrench (Fran\u00c3\u00a7ais)\nfr_FR\nGerman (Deutsch)\nde_DE\nGreek (\u00ce\u0095\u00ce\u00bb\u00ce\u00bb\u00ce\u00b7\u00ce\u00bd\u00ce\u00b9\u00ce\u00ba\u00ce\u00ac)\nel_EL\nHebrew (\u00d7\u00a2\u00d7\u0091\u00d7\u00a8\u00d7\u0099\u00d7\u00aa)\nhe_IL\nHungarian (Magyar)\nhu_HU\nItalian (Italiano)\nit_it\nJapanese (\u00e6\u0097\u00a5\u00e6\u009c\u00ac\u00e8\u00aa\u009e)\nja_JP\nKorean (\u00ed\u0095\u009c\u00ea\u00b5\u00ad\u00ec\u0096\u00b4)\nko_KR\nLatvian (Latvie\u00c5\u00a1u)\nlv_LV\nLithuanian (Lietuvi\u00c5\u00b3)\nlt_LT\nNorwegian (Bokm\u00c3\u00a5l)\nnb_NO\nPolish (Polski)\npl_PL\nPortuguese (Portugu\u00c3\u00aas)\npt_PT\nPortuguese Brazilian (Portugu\u00c3\u00aas Brasileiro)\npt_BR\nRomanian (Rom\u00c3\u00a2n\u00c4\u0083)\nro_RO\nRussian (\u00d0\u00a0\u00d1\u0083\u00d1\u0081\u00d1\u0081\u00d0\u00ba\u00d0\u00b8\u00d0\u00b9)\nru_RU\nSerbian (\u00d0\u00a1\u00d1\u0080\u00d0\u00bf\u00d1\u0081\u00d0\u00ba\u00d0\u00b8)\nsr_RS\nSlovak (Sloven\u00c4\u008dina)\nsk_SK\nSpanish (Espa\u00c3\u00b1ol)\nes_ES\nSpanish (Latin America) (Espa\u00c3\u00b1ol (Latinoam\u00c3\u00a9rica))\nes_LA\nSwedish (Svenska)\nsv_SE\nThai (\u00e0\u00b9\u0084\u00e0\u00b8\u0097\u00e0\u00b8\u00a2)\nth_TH", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Languages/index.html"} {"id": "b7889ecccad7-2", "text": "Thai (\u00e0\u00b9\u0084\u00e0\u00b8\u0097\u00e0\u00b8\u00a2)\nth_TH\nTraditional Chinese (\u00e7\u00b9\u0081\u00e9\u00ab\u0094\u00e4\u00b8\u00ad\u00e6\u0096\u0087)\nzh_TW\nTurkish (T\u00c3\u00bcrk\u00c3\u00a7e)\ntr_TR\nUkrainian (\u00d0\u00a3\u00d0\u00ba\u00d1\u0080\u00d0\u00b0\u00d1\u0097\u00d0\u00bd\u00d1\u0081\u00d1\u008c\u00d0\u00ba\u00d0\u00b0)\nuk_UA\n\u00c2\u00a0\nChange Log\nThe following table documents historical changes to Sugar's available languages.\nVersion\nChange\n7.8.0.0\nAdded Thai language pack.\n7.8.0.0\nAdded Croatian language pack.\n7.7.0.0\nAdded Traditional Chinese language pack.\n7.6.0.0\nAdded Ukrainian language pack.\n7.6.0.0\nAdded Arabic language pack.\n7.2.0\nAdded Finnish language pack.\n7.2.0\nAdded Spanish (Latin America) language pack.\n6.6.0\nAdded Albanian language pack.\n6.6.0\nAdded Slovak language pack.\n6.6.0\nAdded Korean language pack.\n6.6.0\nAdded Greek language pack.\n6.5.1\nAdded Latvian language pack.\n6.4.0\nAdded Serbian language pack.\n6.4.0\nAdded Portuguese Brazilian language pack.\n6.4.0\nAdded English (UK) language pack.\n6.4.0\nAdded Catalan language pack.\n6.2.0\nAdded Polish language pack.\n6.2.0\nAdded Hebrew language pack.\n6.2.0\nAdded Estonian language pack.\n6.2.0\nAdded Czech language pack.\n6.1.2\nAdded Turkish language pack.\n6.1.2", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Languages/index.html"} {"id": "b7889ecccad7-3", "text": "6.1.2\nAdded Turkish language pack.\n6.1.2\nAdded Swedish language pack.\n6.1.2\nAdded Norwegian language pack.\n6.1.2\nAdded Lithuanian language pack.\n6.1.0\nAdded Chinese language pack.\n6.1.0\nAdded Russian language pack.\n6.1.0\nAdded Romanian language pack.\n6.1.0\nAdded Portuguese language pack.\n6.1.0\nAdded Dutch language pack.\n6.1.0\nAdded Japanese language pack.\n6.1.0\nAdded Italian language pack.\n6.1.0\nAdded Hungarian language pack.\n6.1.0\nAdded French language pack.\n6.1.0\nAdded Spanish language pack.\n6.1.0\nAdded German language pack.\n6.1.0\nAdded Danish language pack.\n6.1.0\nAdded Bulgarian language pack.\nTopicsApplication Labels and ListsSugar, which is fully internationalized and localizable, differentiates languages with unique language keys. These keys prefix the files that correspond with particular languages. For example, the default language for the application is English (US), which is represented by the language key en_us. Any file that contains data specific to the English (US) language begins with the characters en_us. Language label keys that are not recognized will default to the English (US) version.Module Labelsrequire_once 'include/utils.php';Managing ListsThere are three ways to manage lists in Sugar: by using Studio in the application, by directly modifying the list's language strings, and via the code-level Dropdown Helper. This page explains all three methods.Language PacksLanguage packs are module-loadable packages that add support for new, localized languages to Sugar.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Languages/index.html"} {"id": "708d09b959f1-0", "text": "Language Packs\nOverview\nLanguage packs are module-loadable packages that add support for new, localized languages to Sugar.\nCreating a Language Pack\nTo create a language pack, choose a unique language key. This key is specific to your language definitions and should be unique from other language keys in the same instance to avoid conflicts. It is also important that your language key follows the\u00c2\u00a0xx_xx format. For demonstrative purposes, we will create a Lorem Ipsum language pack with the language key Lo_Ip.\nApplication and Module Strings\nIn the module and application language definitions, there is\u00c2\u00a0a combination of $app_list_strings, $mod_strings, and $mod_process_order_strings\u00c2\u00a0variables. Your custom language needs\u00c2\u00a0to have a definition created\u00c2\u00a0to reflect each language key in a standard definition.\u00c2\u00a0To do this, duplicate an existing language\u00c2\u00a0and simply change the language values within the document\u00c2\u00a0and\u00c2\u00a0replace the language key in the name of the file with your new key. Be\u00c2\u00a0sure\u00c2\u00a0to only change the\u00c2\u00a0array values\u00c2\u00a0and leave the array keys as they are inside of each file.\nNote:\u00c2\u00a0Should you miss an index, it will default to English.\u00c2\u00a0\nThe\u00c2\u00a0first step is to identify all of the application and module language\u00c2\u00a0files.\u00c2\u00a0While\u00c2\u00a0language files may vary from version to version due to new features, the stock language paths are generally as follows:\n./include/language/xx_xx.lang.php\n./include/SugarObjects/implements/assignable/language/xx_xx.lang.php\n./include/SugarObjects/implements/email_address/language/xx_xx.lang.php\n./include/SugarObjects/implements/team_security/language/xx_xx.lang.php\n./include/SugarObjects/templates/basic/language/xx_xx.lang.php\n./include/SugarObjects/templates/company/language/xx_xx.lang.php", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Languages/Language_Packs/index.html"} {"id": "708d09b959f1-1", "text": "./include/SugarObjects/templates/company/language/xx_xx.lang.php\n./include/SugarObjects/templates/company/language/application/xx_xx.lang.php\n./include/SugarObjects/templates/file/language/xx_xx.lang.php\n./include/SugarObjects/templates/file/language/application/xx_xx.lang.php\n./include/SugarObjects/templates/issue/language/xx_xx.lang.php\n./include/SugarObjects/templates/issue/language/application/xx_xx.lang.php\n./include/SugarObjects/templates/person/language/xx_xx.lang.php\n./include/SugarObjects/templates/sale/language/xx_xx.lang.php\n./include/SugarObjects/templates/sale/language/application/xx_xx.lang.php\n./install/language/xx_xx.lang.php\n./modules/Accounts/language/xx_xx.lang.php\n./modules/ACL/language/xx_xx.lang.php\n./modules/ACLActions/language/xx_xx.lang.php\n./modules/ACLFields/language/xx_xx.lang.php\n./modules/ACLRoles/language/xx_xx.lang.php\n./modules/Activities/language/xx_xx.lang.php\n./modules/ActivityStream/Activities/language/xx_xx.lang.php\n./modules/Administration/language/xx_xx.lang.php\n./modules/Audit/language/xx_xx.lang.php\n./modules/Bugs/language/xx_xx.lang.php\n./modules/Calendar/language/xx_xx.lang.php\n./modules/Calls/language/xx_xx.lang.php\n./modules/CampaignLog/language/xx_xx.lang.php\n./modules/Campaigns/language/xx_xx.lang.php\n./modules/CampaignTrackers/language/xx_xx.lang.php\n./modules/Cases/language/xx_xx.lang.php\n./modules/Charts/language/xx_xx.lang.php\n./modules/Configurator/language/xx_xx.lang.php\n./modules/Connectors/language/xx_xx.lang.php\n./modules/Contacts/language/xx_xx.lang.php\n./modules/Contracts/language/xx_xx.lang.php\n./modules/ContractTypes/language/xx_xx.lang.php", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Languages/Language_Packs/index.html"} {"id": "708d09b959f1-2", "text": "./modules/ContractTypes/language/xx_xx.lang.php\n./modules/Currencies/language/xx_xx.lang.php\n./modules/CustomQueries/language/xx_xx.lang.php\n./modules/DataSets/language/xx_xx.lang.php\n./modules/DocumentRevisions/language/xx_xx.lang.php\n./modules/Documents/language/xx_xx.lang.php\n./modules/DynamicFields/language/xx_xx.lang.php\n./modules/EAPM/language/xx_xx.lang.php\n./modules/EmailAddresses/language/xx_xx.lang.php\n./modules/EmailMan/language/xx_xx.lang.php\n./modules/EmailMarketing/language/xx_xx.lang.php\n./modules/Emails/language/xx_xx.lang.php\n./modules/EmailTemplates/language/xx_xx.lang.php\n./modules/Employees/language/xx_xx.lang.php\n./modules/ExpressionEngine/language/xx_xx.lang.php\n./modules/Expressions/language/xx_xx.lang.php\n./modules/Feedbacks/language/xx_xx.lang.php\n./modules/Filters/language/xx_xx.lang.php\n./modules/ForecastManagerWorksheets/language/xx_xx.lang.php\n./modules/Forecasts/language/xx_xx.lang.php\n./modules/ForecastWorksheets/language/xx_xx.lang.php\n./modules/Groups/language/xx_xx.lang.php\n./modules/Help/language/xx_xx.lang.php\n./modules/History/language/xx_xx.lang.php\n./modules/Holidays/language/xx_xx.lang.php\n./modules/Home/language/xx_xx.lang.php\n./modules/Import/language/xx_xx.lang.php\n./modules/InboundEmail/language/xx_xx.lang.php\n./modules/KBDocuments/language/xx_xx.lang.php\n./modules/KBTags/language/xx_xx.lang.php\n./modules/LabelEditor/language/xx_xx.lang.php\n./modules/Leads/language/xx_xx.lang.php\n./modules/MailMerge/language/xx_xx.lang.php", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Languages/Language_Packs/index.html"} {"id": "708d09b959f1-3", "text": "./modules/MailMerge/language/xx_xx.lang.php\n./modules/Manufacturers/language/xx_xx.lang.php\n./modules/Meetings/language/xx_xx.lang.php\n./modules/MergeRecords/language/xx_xx.lang.php\n./modules/ModuleBuilder/language/xx_xx.lang.php\n./modules/Notes/language/xx_xx.lang.php\n./modules/Notifications/language/xx_xx.lang.php\n./modules/OAuthKeys/language/xx_xx.lang.php\n./modules/OAuthTokens/language/xx_xx.lang.php\n./modules/Opportunities/language/xx_xx.lang.php\n./modules/OptimisticLock/language/xx_xx.lang.php\n./modules/PdfManager/language/xx_xx.lang.php\n./modules/pmse_Business_Rules/language/xx_xx.lang.php\n./modules/pmse_Emails_Templates/language/xx_xx.lang.php\n./modules/pmse_Inbox/language/xx_xx.lang.php\n./modules/pmse_Project/language/xx_xx.lang.php\n./modules/ProductBundleNotes/language/xx_xx.lang.php\n./modules/ProductBundles/language/xx_xx.lang.php\n./modules/ProductCategories/language/xx_xx.lang.php\n./modules/Products/language/xx_xx.lang.php\n./modules/ProductTemplates/language/xx_xx.lang.php\n./modules/ProductTypes/language/xx_xx.lang.php\n./modules/Project/language/xx_xx.lang.php\n./modules/ProjectTask/language/xx_xx.lang.php\n./modules/ProspectLists/language/xx_xx.lang.php\n./modules/Prospects/language/xx_xx.lang.php\n./modules/Quotas/language/xx_xx.lang.php\n./modules/Quotes/language/xx_xx.lang.php\n./modules/Relationships/language/xx_xx.lang.php\n./modules/Releases/language/xx_xx.lang.php\n./modules/ReportMaker/language/xx_xx.lang.php\n./modules/Reports/language/xx_xx.lang.php\n./modules/RevenueLineItems/language/xx_xx.lang.php", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Languages/Language_Packs/index.html"} {"id": "708d09b959f1-4", "text": "./modules/RevenueLineItems/language/xx_xx.lang.php\n./modules/Roles/language/xx_xx.lang.php\n./modules/SavedSearch/language/xx_xx.lang.php\n./modules/Schedulers/language/xx_xx.lang.php\n./modules/SchedulersJobs/language/xx_xx.lang.php\n./modules/Shippers/language/xx_xx.lang.php\n./modules/SNIP/language/xx_xx.lang.php\n./modules/Studio/language/xx_xx.lang.php\n./modules/Styleguide/language/xx_xx.lang.php\n./modules/SugarFavorites/language/xx_xx.lang.php\n./modules/Sync/language/xx_xx.lang.php\n./modules/Tasks/language/xx_xx.lang.php\n./modules/TaxRates/language/xx_xx.lang.php\n./modules/TeamNotices/language/xx_xx.lang.php\n./modules/Teams/language/xx_xx.lang.php\n./modules/TimePeriods/language/xx_xx.lang.php\n./modules/Trackers/language/xx_xx.lang.php\n./modules/UpgradeWizard/language/xx_xx.lang.php\n./modules/Users/language/xx_xx.lang.php\n./modules/UserSignatures/language/xx_xx.lang.php\n./modules/WebLogicHooks/language/xx_xx.lang.php\n./modules/WorkFlow/language/xx_xx.lang.php\n./modules/WorkFlowActions/language/xx_xx.lang.php\n./modules/WorkFlowActionShells/language/xx_xx.lang.php\n./modules/WorkFlowAlerts/language/xx_xx.lang.php\n./modules/WorkFlowAlertShells/language/xx_xx.lang.php\n./modules/WorkFlowTriggerShells/language/xx_xx.lang.php\nDashlet Strings", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Languages/Language_Packs/index.html"} {"id": "708d09b959f1-5", "text": "./modules/WorkFlowTriggerShells/language/xx_xx.lang.php\nDashlet Strings\nDashlet strings are mostly specific to BWC dashboards. Within each dashlet language definition\u00c2\u00a0is a\u00c2\u00a0$dashletStrings\u00c2\u00a0variable. Create a definition to mimic\u00c2\u00a0each dashlet file\u00c2\u00a0to reflect the\u00c2\u00a0new language. To do this,\u00c2\u00a0duplicate an existing language of your choice\u00c2\u00a0and change the language key in the path.\u00c2\u00a0Be sure to only change the\u00c2\u00a0array values\u00c2\u00a0and leave the array keys as they are inside of each file.\nThe dashlet paths are listed below:\n./modules/Calendar/Dashlets/CalendarDashlet/CalendarDashlet.xx_xx.lang.php\n./modules/Charts/Dashlets/CampaignROIChartDashlet/CampaignROIChartDashlet.xx_xx.lang.php\n./modules/Charts/Dashlets/MyModulesUsedChartDashlet/MyModulesUsedChartDashlet.xx_xx.lang.php\n./modules/Charts/Dashlets/MyOpportunitiesGaugeDashlet/MyOpportunitiesGaugeDashlet.xx_xx.lang.php\n./modules/Charts/Dashlets/MyPipelineBySalesStageDashlet/MyPipelineBySalesStageDashlet.xx_xx.lang.php\n./modules/Charts/Dashlets/MyTeamModulesUsedChartDashlet/MyTeamModulesUsedChartDashlet.xx_xx.lang.php\n./modules/Charts/Dashlets/OpportunitiesByLeadSourceByOutcomeDashlet/OpportunitiesByLeadSourceByOutcomeDashlet.xx_xx.lang.php\n./modules/Charts/Dashlets/OpportunitiesByLeadSourceDashlet/OpportunitiesByLeadSourceDashlet.xx_xx.lang.php\n./modules/Charts/Dashlets/OutcomeByMonthDashlet/OutcomeByMonthDashlet.xx_xx.lang.php", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Languages/Language_Packs/index.html"} {"id": "708d09b959f1-6", "text": "./modules/Charts/Dashlets/PipelineBySalesStageDashlet/PipelineBySalesStageDashlet.xx_xx.lang.php\n./modules/Home/Dashlets/ChartsDashlet/ChartsDashlet.xx_xx.lang.php\n./modules/Home/Dashlets/InvadersDashlet/InvadersDashlet.xx_xx.lang.php\n./modules/Home/Dashlets/JotPadDashlet/JotPadDashlet.xx_xx.lang.php\n./modules/Home/Dashlets/RSSDashlet/RSSDashlet.xx_xx.lang.php\n./modules/SugarFavorites/Dashlets/SugarFavoritesDashlet/SugarFavoritesDashlet.xx_xx.lang.php\n./modules/TeamNotices/Dashlets/TeamNoticesDashlet/TeamNoticesDashlet.xx_xx.lang.php\n./modules/Trackers/Dashlets/TrackerDashlet/TrackerDashlet.xx_xx.lang.php\nTemplates\nSugar also contains templates that are used when emailing users. Duplicate an existing language template\u00c2\u00a0and change the language text as needed. This time, you will need to leave the language keys exactly as they are in the file.\nThe template paths are listed below:\n./include/language/xx_xx.notify_template.html\nConfiguration\nOnce you have your language definitions ready, you will need to tell Sugar a new language should be listed for users. For development purposes, you can add\u00c2\u00a0$sugar_config['languages']['Lo_Ip'] = 'Lorem Ipsum'; to your config_override.php. It is important to note that this language configuration will automatically be set for you during the installation of a module loadable language package.\u00c2\u00a0\nModule Loadable Packages", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Languages/Language_Packs/index.html"} {"id": "708d09b959f1-7", "text": "Module Loadable Packages\nOnce you have the new\u00c2\u00a0language files ready, create an installer package so the files can be installed to a new instance. To do this, create an empty directory and move the files into it, mimicking the folder structures shown above. Once that is completed, create a manifest.php in the root of the\u00c2\u00a0new directory with a $manifest['type'] of \"langpack\". An example manifest file is shown below this section. For more information on building manifests, please visit the introduction to the manifest\u00c2\u00a0page.\nNote: Sugar Sell Essentials customers do not have the ability to upload custom file packages to Sugar using Module Loader.\nExample Manifest File\n \n array (\n 'regex_matches' => \n array (\n '13.0.*',\n ),\n ),\n 'acceptable_sugar_flavors' => \n array (\n 'PRO',\n 'ENT',\n 'ULT',\n ),\n 'readme' => '',\n 'key' => 1454474352,\n 'author' => 'SugarCRM',\n 'description' => 'Installs an example Lorem Ipsum language pack',\n 'icon' => '',\n 'is_uninstallable' => true,\n 'name' => 'Lorem Ipsum Language Pack',\n 'published_date' => '2018-02-03 00:00:00',\n 'type' => 'langpack',\n 'version' => 1454474352,\n 'remove_tables' => '',\n);\n?>", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Languages/Language_Packs/index.html"} {"id": "708d09b959f1-8", "text": "'remove_tables' => '',\n);\n?>\nOnce your manifest is completed, you\u00c2\u00a0will need to zip up the contents of your new folder. An example of a language pack installer can be downloaded\u00c2\u00a0here. When your language pack is ready, it can be installed through the module loader. The installation\u00c2\u00a0will automatically add your new language to the $sugar_config['languages'] array in your config.php. After\u00c2\u00a0installation. it is highly recommended to navigate to the Sugar Administration page, click on \"Repairs\", and execute the following repair tools:\nQuick Repair and Rebuild\nRebuild Javascript Languages\nThe new language should now be available for use in your Sugar instance. If you do not see the language listed, please clear your browser cache and refresh the page.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Languages/Language_Packs/index.html"} {"id": "87f0f710a46c-0", "text": "Application Labels and Lists\nOverview\n\u00c2\u00a0\nSugar, which is fully internationalized and localizable, differentiates languages with unique language keys. These keys prefix the files that correspond with particular languages. For example, the default language for the application is English (US), which is represented by the language key en_us. Any file that contains data specific to the English (US) language begins with the characters en_us. Language label keys that are not recognized will\u00c2\u00a0default to the English (US) version.\nFor more information on language keys, please refer to the Languages page.\nApplication Labels and Lists\n$app_list_strings and $app_strings\nThe $app_list_strings\u00c2\u00a0array contains the various dropdown lists for the system\u00c2\u00a0while $app_strings contains the system application labels. The initial set of definitions can be found in ./include/language/.lang.php. As you work within the system and deploy modules and lists through Studio, any changes to these lists\u00c2\u00a0will be reflected in the language's extension\u00c2\u00a0directory: ./custom/Extension/application/Ext/Language/..php.\nCustomizing Application Labels and Lists\nIf you are developing a customization and want to be able to create or edit existing label or list values, you will need to work within the extension application directory. To do this, create\u00c2\u00a0./custom/Extension/application/Ext/Language/..php.\nThe file should\u00c2\u00a0contain your override values with each label index set individually. An example of this is:\n Repair > Quick Rebuild & Repair. This will compile all of the Extension files from ./custom/Extension/application/Ext/Language/ to ./custom/application/Ext/Language/.lang.ext.php.\nHierarchy Diagram\nRetrieving Labels\nThere are two ways to retrieve a label. The first is to use the translate()\u00c2\u00a0function found in ./include/utils.php. This function will retrieve the label for the current user's language and can also be used to retrieve labels from $mod_strings, $app_strings, or app_list_strings.\nAn example of this is:\nrequire_once 'include/utils.php';\n$label = translate('LBL_KEY');\nAlternatively, you can also use the global variable $app_strings as follows:\nglobal $app_strings;\n$label = '';\nif (isset($app_strings['LBL_KEY']))\n{\n $label = $app_strings['LBL_KEY'];\n}\nNote: If a label key is not found for the user's preferred language, the system will default to \"en_us\" and pull the English (US) version of the label for display.\u00c2\u00a0\nRetrieving Lists\nThere are two ways to retrieve a label. The first is to use the translate() function found in include/utils.php. This function will retrieve the label for the current user's language.\nAn example of this is:\nrequire_once 'include/utils.php';\n$list = translate('LIST_NAME');\n//You can also retrieve a specific list value this way\n$displayValue = translate('LIST_NAME', '', 'Key_Value');\nAlternatively, you can also use the global variable $app_list_strings as follows:\nglobal $app_list_strings;\n$list = array();\nif (isset($app_list_strings['LIST_NAME']))\n{", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Languages/Application_Labels_and_Lists/index.html"} {"id": "87f0f710a46c-2", "text": "$list = array();\nif (isset($app_list_strings['LIST_NAME']))\n{\n $list = $app_list_strings['LIST_NAME'];\n}\nNote: If a list\u00c2\u00a0key is not found for the user's preferred language, the system will default to \"en_us\" and pull the English (US) version of the list for display.\nAccessing Application Strings in Sidecar\nAll language-pack strings are accessible within the Sidecar framework.\n$app_strings\nTo access $app_strings in Sidecar, use app.lang.getAppString:\napp.lang.getAppString('LBL_MODULE');\nTo access\u00c2\u00a0$app_strings in your browser's console, use SUGAR.App.lang.getAppString:\nSUGAR.App.lang.getAppString('LBL_MODULE');\nFor more information, please refer to the app.lang.getAppString section of the Languages page.\n$app_list_strings\nTo access $app_list_strings in Sidecar, use app.lang.getAppListStrings:\napp.lang.getAppListStrings('sales_stage_dom');\nTo access\u00c2\u00a0$app_list_strings in your browser's console, use SUGAR.App.lang.getAppListStrings:\nSUGAR.App.lang.getAppListStrings('sales_stage_dom');\nFor more information, please refer to the app.lang.getAppListStrings section of the Languages page.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Languages/Application_Labels_and_Lists/index.html"} {"id": "46dc624b708f-0", "text": "Module Labels\nrequire_once 'include/utils.php';\n$label = translate('LBL_KEY', 'Accounts');\nOverview\nSugar, which is fully internationalized and localizable, differentiates languages with unique language keys. These keys prefix the files that correspond to particular languages. For example, the default language for the application is English (US), which is represented by the language key en_us. Any file that contains data specific to the English (US) language begins with the characters en_us. Language label keys that are not recognized will\u00c2\u00a0default to the English (US) version.\nFor more information on language keys, please refer to the Languages page.\nModule Labels\n$mod_strings\nThe module language strings are stored in $mod_strings. This section explains how the $mod_strings are compiled. All modules, whether out-of-box or custom, will have an initial set of language files in ./modules//language/.lang.php.\nAs you work with the system and modify labels through Studio, changes to the labels are reflected in the corresponding module's custom extension directory: ./custom/Extension/modules//Ext/Language/.lang.php.\nCustomizing Labels\nIf you are developing a customization and want to be able to create new or override existing label values, you will need to work within the extension modules directory. To do this, create ./custom/Extension/modules//Ext/Language/..php.\nThe file should contain your override values with each label index set individually. An example of this is:\n Repair > Quick Rebuild & Repair. This will compile all of the Extension files from ./custom/Extension/modules//Ext/Language/ to ./custom/modules//Ext/Language/.lang.ext.php.\nLabel Cache\nThe file locations discussed above are compiled into the cache directory, ./cache/modules//language/.lang.php\nThe cached results of these files make up each module's $mod_strings definition.\nHierarchy Diagram\nRetrieving Labels\nThere are two ways to retrieve a label. The first is to use the translate() function found in include/utils.php. This function will retrieve the label for the current user's language and can also be used to retrieve labels from $mod_strings, $app_strings, or app_list_strings.\nAn example of this is:\nrequire_once 'include/utils.php';\n$label = translate('LBL_KEY', 'Accounts');\nAlternatively, you can use the global variable $mod_strings as follows:\nglobal $mod_strings;\n$label = '';\nif (isset($mod_strings['LBL_KEY']))\n{\n $label = $mod_strings['LBL_KEY'];\n}\nAccessing Module Strings in Sidecar\nAll language-pack strings are accessible within the Sidecar framework.\n$mod_strings\nTo access the $mod_strings in Sidecar, use app.lang.get():\napp.lang.get('LBL_NAME', 'Accounts');\nTo access the $mod_strings in your browser's console, use SUGAR.App.lang.get():\nSUGAR.App.lang.get('LBL_NAME', 'Accounts');\nFor more information, please refer to the app.lang.get section of the Languages page.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Languages/Module_Labels/index.html"} {"id": "1ee326afe021-0", "text": "Managing Lists\nOverview\nThere are three ways to manage lists in Sugar: by using Studio in the application, by directly modifying the list's language strings, and via the code-level Dropdown Helper. This page explains all three methods.\nManaging Lists With Studio\nIf you know the name of the list you would like to edit, you can access the application's dropdown editor by navigating to Admin > Dropdown Editor. Alternatively, navigate to a field that uses the list (Admin > Studio > {Module} > Fields > {field_name}) and click \"Edit\" under the Dropdown List field:\nFor information on using the dropdown editor, please refer to the Developer Tools documentation in the Administration Guide.\nDirectly Modifying Lists\nThere are two ways to directly modify the language strings. The first way is to modify the custom language file, located at ./custom/include/language/.lang.php.\nIf you are developing a customization to be distributed and you want to be able to create new or override existing list values, you will need to work within the extension application directory. To do this you will create the following file: ./custom/Extension/application/Ext/Language/..php.\nThe file will contain your override values. Please note that within this file you will set each label index individually. An example of this is:\n Repair > Quick Rebuild & Repair. This will compile all of the Extension files from ./custom/Extension/application/Ext/Language/ to ./custom/application/Ext/Language/.lang.ext.php.\nManaging Lists With Dropdown Helper\nYou can use the dropdown helper to manage lists at the code level. This example demonstrates how to add and update values for a specific dropdown list:", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Languages/Managing_Lists/index.html"} {"id": "1ee326afe021-1", "text": "require_once 'modules/Studio/DropDowns/DropDownHelper.php';\n$dropdownHelper = new DropDownHelper();\n$parameters = array();\n$parameters['dropdown_name'] = 'example_list';\n$listValues = array(\n 'Key_Value_1' => 'Display Value 1',\n 'Key_Value_2' => 'Display Value 2',\n 'Key_Value_3' => 'Display Value 3'\n);\n$count = 0;\nforeach ($listValues as $key=>$value) {\n $parameters['slot_'. $count] = $count;\n $parameters['key_'. $count] = $key;\n $parameters['value_'. $count] = $value;\n //set 'use_push' to true to update/add values while keeping old values\n $parameters['use_push'] = true;\n $count++;\n}\n$dropdownHelper->saveDropDown($parameters);\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Languages/Managing_Lists/index.html"} {"id": "5ecada6bccb5-0", "text": "Module Loader\nModule Loader is used when installing\u00c2\u00a0customizations, plugins,language\u00c2\u00a0packs, and\u00c2\u00a0hotfixes, and other customizations into a Sugar instance in the form of a Module Loadable Package. This documentation covers the basics and best practices for creating module loadable packages for a Sugar installation.\nNote: Sugar Sell Essentials customers do not have the ability to upload custom file packages to Sugar using Module Loader.\nTopicsIntroduction to the ManifestModule loadable packages rely on a manifest.php file to define the basic properties and installation steps for the package. This documentation explains the various components that make up the manifest file.Module Loader RestrictionsSugarCRM's hosting objective is to maintain the integrity of the standard Sugar functionality when we upgrade a customer instance and limit any negative impact our upgrade has on the customer's modifications. All instances hosted on Sugar's cloud service have package scanner enabled by default. This setting is not configurable and all packages must pass the package scan for installation on Sugar's cloud environment. This includes passing all health checks.Module Loader Restriction AlternativesThis article provides workarounds for commonly used functions that are denylisted by Sugar for Sugar's cloud environment.Sugar Exchange Package GuidelinesSugar Module Loadable Package development guidelines for apps listed on Sugar Exchange.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Loader/index.html"} {"id": "2b6d150c4a73-0", "text": "Introduction to the Manifest\nOverview\nModule loadable packages rely on a manifest.php file to define the basic properties and installation steps for the package. This documentation\u00c2\u00a0explains the various components that make up the manifest file.\nNote: Sugar Sell Essentials customers do not have the ability to upload custom file packages to Sugar using Module Loader.\nManifest Definitions\nInside of the manifest.php file, there is a $manifest variable that defines the basic properties of the module loadable package. The various manifest properties are outlined below:\nName\nType\nDisplayed in Module Loader\nDescription\nkey\nString\nNo\nA unique identifier for the package$manifest['key'] = '32837';\nname\nString\nYes\nThe name of the package$manifest['name'] = 'Example Package';\ndescription\nString\nYes\nThe description of the package$manifest['description'] = 'Example Package Description';\nbuilt_in_version\nString\nNo\nThe version of Sugar that the package was designed for$manifest['built_in_version'] = '13.0.0';\nNote: Some packages designed for 6.x versions of Sugar are not compatible with 13.0 and should not be installed.\nversion\nString\nYes\nThe version of the package, i.e. \"1.0.0\" $manifest['version'] = '1.0.0';\nNote:\u00c2\u00a0The version string should be formatting according to\u00c2\u00a0 the\u00c2\u00a0Semantic Versioning 2.0\u00c2\u00a0standard.\nacceptable_sugar_versions\nArray\nNo\nThe Sugar versions that a package can be installed to$manifest['acceptable_sugar_versions'] = array(\n 'exact_matches' => array(\n '13.0.0',\n ),\n //or\n 'regex_matches' => array(\n '13.0.*',\n ),\n);", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Loader/Introduction_to_the_Manifest/index.html"} {"id": "2b6d150c4a73-1", "text": "'13.0.*',\n ),\n);\nNote: You can define exact versions and/or use a regex formula to define a range. Exact versions will be specified using the exact_matches index and will contain an array of exact version strings (i.e. '13.0.0'). Regex formulas will be specified using the regex_matches index and will contain an array of regular expressions designed to match a group of versions (i.e. '13.0.*').\nacceptable_sugar_flavors\nArray\nNo\nThe Sugar products that the package can be installed to$manifest['acceptable_sugar_flavors'] = array(\n 'PRO',\n 'ENT',\n 'ULT'\n); \nauthor\nString\nNo\nThe author of the package (i.e. \"SugarCRM\")$manifest['author'] = 'SugarCRM';\nreadme\nString\nNo\nThe optional path to a readme document to be displayed to the user during installation $manifest['readme'] = 'README.txt';\nicon\nString\nNo\nThe optional path (within the package ZIP file) to an icon image to be displayed during installation (e.g. ./patch_directory/icon.gif and ./patch_directory/images/theme.gif)$manifest['icon'] = '';\nis_uninstallable\nBoolean\nNo\nWhether or not the package can be uninstalledAcceptable values:\n'true' will allow a Sugar administrator to uninstall the package\n'false' will disable the uninstall feature\n$manifest['is_uninstallable'] = true;\npublished_date\nString\nNo\nThe date the package was published$manifest['published_date'] = '2018-04-09 00:00:00';\nremove_tables\nString\nNo", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Loader/Introduction_to_the_Manifest/index.html"} {"id": "2b6d150c4a73-2", "text": "remove_tables\nString\nNo\nWhether or not tables generated by the $installdefs['beans'] index should be removed from an installed module (acceptable values: empty or 'prompt')$manifest['remove_tables'] = 'prompt';\ntype\nString\nNo\nAcceptable 'type' values:module : Use this type if you are installing a module or developing a plugin that should install via the Module Loader.\nlangpack : Use this type to install a language pack via the Module Loader. Any languages installed will automatically be added to the available languages on the Sugar login screen. For an example of a module loadable language pack, refer to the Language Framework page.\ntheme : Use this type to install a Sugar theme via the Upgrade Wizard. Themes are only supported in Sugar 6.x, and will be added to the \"Theme\" drop-down on the Sugar Login screen.\npatch : Use this type to install a patch via the Upgrade Wizard.\ndependencies\nArray\nNo\nRequired dependency packages:\n$manifest['dependencies'] = array(\n array(\n 'id_name' => 'PackageName',\n 'version' => '1.0.0'\n )\n);\nuninstall_before_upgrade\nBoolean\nNo\nThis will allow Module Loader to ensure all traces of previously installed package versions (including packages that have been upgraded multiple times) have been removed.\n$manifest['uninstall_before_upgrade'] = true;\nManifest Example\nAn example of a manifest is shown below:\n$manifest = array(\n 'key' => 1397052912,\n 'name' => 'My manifest',\n 'description' => 'My description',\n 'author' => 'SugarCRM',\n 'version' => '1.0.0',\n 'is_uninstallable' => true,", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Loader/Introduction_to_the_Manifest/index.html"} {"id": "2b6d150c4a73-3", "text": "'is_uninstallable' => true,\n 'published_date' => '04/07/2023 14:15:12',\n 'type' => 'module',\n 'acceptable_sugar_versions' => \n array(\n 'exact_matches' => array(\n '13.0.0'\n ),\n //or\n 'regex_matches' => array(\n '13.0.*' //any 13.0 release\n ),\n ),\n 'acceptable_sugar_flavors' => \n array(\n 'PRO', \n 'ENT', \n 'ULT'\n ),\n 'readme' => '',\n 'icon' => '',\n 'remove_tables' => '',\n 'uninstall_before_upgrade' => false,\n);\nInstallation Definitions\nThe following section outlines the indexes specified in the $installdefs array contained in the ./manifest.php file. The $installdefs array indexes are used by the Module Loader to determine the actual installation steps that need to be taken to install the package.\n$installdef Actions\nName\nType\nDescription\naction_file_map\nArray\u00c2\u00a0\nActionFileMap\u00c2\u00a0is part of the Extension Framework. More detail can be found in the\u00c2\u00a0Extension Framework documentation.\naction_remap\n\u00c2\u00a0Array\nActionReMap\u00c2\u00a0is part of the Extension Framework. More detail can be found in the\u00c2\u00a0Extension Framework documentation.\naction_view_map\n\u00c2\u00a0Array\nActionViewMap\u00c2\u00a0is part of the Extension Framework. More detail can be found in the\u00c2\u00a0Extension Framework documentation.\nadministration\n\u00c2\u00a0Array\nAdministration\u00c2\u00a0is part of the Extension Framework. More detail can be found in the\u00c2\u00a0Extension Framework documentation.\nappscheduledefs\n\u00c2\u00a0Array", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Loader/Introduction_to_the_Manifest/index.html"} {"id": "2b6d150c4a73-4", "text": "appscheduledefs\n\u00c2\u00a0Array\nApplication ScheduledTasks\u00c2\u00a0is part of the Extension Framework. More detail can be found in the\u00c2\u00a0Extension Framework documentation.\nbeans\n\u00c2\u00a0Array\nModules\u00c2\u00a0is part of the Extension Framework. More detail can be found in the\u00c2\u00a0Extension Framework documentation.\nconnectors\nArray\nAn array containing Connector definitions as outlined in the Connector documentation.\n$installdefs['connectors'] = array (\n array (\n 'connector' => '/example/source',\n 'formatter' => '/example/formatter',\n 'name' => 'ext_rest_example',\n ),\n);\ncopy\nArray\nAn array detailing the files and folders to be copied to SugarRequired parameters for each file in the array:\nfrom (string) : The location of the file in the module loadable package$installdefs['copy'][0]['from'] = '/Files/custom/modules/Accounts/accounts_save.php';\nto (string) : The destination directory relative to the Sugar root$installdefs['copy'][0]['to'] = 'custom/modules/Accounts/accounts_save.php';\nExample:\n$installdefs['copy'] = array(\n array(\n 'from' => '/Files/custom/modules/Accounts/accounts_save.php',\n 'to' => 'custom/modules/Accounts/accounts_save.php',\n ),\n);\ncsp\nArray\nCSP directives needed for proper operation of the package should be represented as an associative arraywhere keys are directive names and values are corresponding trusted sources.Example:\n $installdefs = array(\n ...\n 'csp' => [\n 'default-src' => '*.trusted.com example.com',\n 'img-src' => 'http: https:'\n ...\n ]\n ...\n );", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Loader/Introduction_to_the_Manifest/index.html"} {"id": "2b6d150c4a73-5", "text": "...\n ]\n ...\n );\nThis parameter takes a space-delimited string of domains - just like the admin module. Setting the value of the default-src via MLP is an append operation. The values you put into the csp parameter of your manifest will be added to the CSP list in the admin module. Note that uninstall DOES NOT remove a value.\ncustom_fields\nArray\nAn array of custom fields to be installed for the new moduleRequired sub-directives for each custom field formatted as:\n$installdefs['custom_fields'][0][''] = ;\nname (String) : The internal name of the custom fieldNote: The suffix \"_c\" is appended to all custom field names (e.g. fieldname_c).\nlabel (String) : The display label for the custom field\ntype (String) : The type of custom field (e.g. varchar, text, textarea, double, float, int, date, bool, enum, relate)\nmax_size (Integer) : The custom field's maximum character storage size\nrequire_option (String) : Defines whether fields are 'required' or 'optional'\ndefault_value (String) : The default value for the custom field\next1 (String) : Used to specify a drop-down name for enum and multienum type fields\next2 (String) : Not used\next3 (String) : Not used\naudited (Boolean) : Denotes whether or not the custom field should be audited\nmodule (String) : The module where the custom field will be added\nExample:\n$installdefs['custom_fields'] = array((\n array((\n 'name' => 'text_c',\n 'label' => 'LBL_TEXT_C',\n 'type' => 'varchar',\n 'max_size' => 255,\n 'require_option' => 'optional',", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Loader/Introduction_to_the_Manifest/index.html"} {"id": "2b6d150c4a73-6", "text": "'max_size' => 255,\n 'require_option' => 'optional',\n 'default_value' => '',\n 'ext1' => '',\n 'ext2' => '',\n 'ext3' => '',\n 'audited' => true,\n 'module' => 'Accounts',\n ),\n);\nconsole\nArray\nConsole\u00c2\u00a0is part of the Extension Framework. More detail can be found in the\u00c2\u00a0Extension Framework documentation.\ndashlets\nArray\nAn array containing the Dashlet definition.\nRequired parameters for each file in the array:\nname\u00c2\u00a0(string) : The name of the dashlet. Used for the folder name where the Dashlet files will be stored in Sugar file system.\nfrom\u00c2\u00a0(string) : The location of the dashlet files in the module loadable package.\n$installdefs['dashlets'] = array(\n\tarray( \n\t\t'name' => 'MyDashlet',\n\t\t'from' => '/MyDashlet'\n\t)\n);\ndependencies\n\u00c2\u00a0Array\nDependencies\u00c2\u00a0is part of the Extension Framework. More detail can be found in the\u00c2\u00a0Extension Framework documentation.\nentrypoints\n\u00c2\u00a0Array\nEntryPointRegistry\u00c2\u00a0is part of the Extension Framework. More detail can be found in the\u00c2\u00a0Extension Framework documentation.\nextensions\n\u00c2\u00a0Array\nExtensions\u00c2\u00a0is part of the Extension Framework. More detail can be found in the\u00c2\u00a0Extension Framework documentation.\nfile_access\n\u00c2\u00a0Array\nFileAccessControlMap\u00c2\u00a0is part of the Extension Framework. More detail can be found in the\u00c2\u00a0Extension Framework documentation.\nhookdefs\n\u00c2\u00a0Array\nLogicHooks\u00c2\u00a0is part of the Extension Framework. More detail can be found in the\u00c2\u00a0Extension Framework documentation.\nid\nString", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Loader/Introduction_to_the_Manifest/index.html"} {"id": "2b6d150c4a73-7", "text": "id\nString\nA unique id for the installdef definition$installdefs['id'] = 'unique_name';\nimage_dir\nString\nThe directory that contains the icons for the module$installdefs['image_dir'] = '/icons';\njsgroups\n\u00c2\u00a0Array\nJSGroupings\u00c2\u00a0is part of the Extension Framework. More detail can be found in the\u00c2\u00a0Extension Framework documentation.\nlanguage\n\u00c2\u00a0Array\nLanguage\u00c2\u00a0is part of the Extension Framework. More detail can be found in the\u00c2\u00a0Extension Framework documentation.\nlayoutdefs\n\u00c2\u00a0Array\nLayoutdefs\u00c2\u00a0is part of the Extension Framework. More detail can be found in the\u00c2\u00a0Extension Framework documentation.\nlayoutfields\nArray\nAn array of custom fields to be added to the edit and detail views of the target modules' existing layouts\nlogic_hooks\n\u00c2\u00a0Array\n\u00c2\u00a0An array containing full logic Hook definitions, as outlined in the LogicHook documentation.\n$installdefs['logic_hooks'] = array(\n array(\n 'module' => 'Accounts',\n 'hook' => 'before_save',\n 'order' => 99,\n 'description' => 'Example Logic Hook - Logs account name',\n 'file' => 'custom/modules/Accounts/accounts_save.php',\n 'class' => 'Accounts_Save',\n 'function' => 'before_save',\n ),\n);\nLogicHooks defined for install using the $installdefs['logic_hooks'] index, will be added to the module or application folder in the custom directory, in the logic_hooks.php file. Examples:\n./custom/modules/Accounts/logic_hooks.php\n./custom/application/logic_hooks.php\nNote: You will still need to utilize a $installdefs['copy'] index\u00c2\u00a0to move the LogicHook class file into the system.\nplatforms\nArray", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Loader/Introduction_to_the_Manifest/index.html"} {"id": "2b6d150c4a73-8", "text": "platforms\nArray\nPlatforms is part of the Extension Framework. More detail can be found in the\u00c2\u00a0Extension Framework documentation.\npre_execute\nArray\nExecutes logic from a file (or set of files) before a package is installedExample:$installdefs['pre_execute'] = array( \n '/pre_execute.php',\n);\nWhere the content of /pre_execute.php is:\n';\npost_execute\nArray\nExecutes logic from a file (or set of files) after a package is installedExample:$installdefs['post_execute'] = array(\n '/post_execute.php',\n);\nWhere the content of /post_execute.php is:';\npre_uninstall\nArray\nExecutes logic from a file (or set of files) before a package is uninstalledExample:$installdefs['pre_uninstall'] = array(\n '/pre_uninstall.php',\n);\nWhere the content of /pre_uninstall.php is:';\npost_uninstall\nArray\nExecutes logic from a file (or set of files) after a package is uninstalled Example:$installdefs['post_uninstall'] = array(\n '/post_uninstall.php'\n);\nWhere the content of /post_uninstall.php is:'; \nrelationships\nArray\nAn array of relationship files used to link the new modules to existing modulesNote: A metadata path must be defined using meta_data (string):\n$installdefs['relationships'][0]['meta_data'] =", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Loader/Introduction_to_the_Manifest/index.html"} {"id": "2b6d150c4a73-9", "text": "$installdefs['relationships'][0]['meta_data'] = \n'/SugarModules/relationships/relationships/my_module_accountsMetaData.php';\nWhere the content of my_module_accountsMetaData.php is: 'many-to-many',\n 'relationships' =>\n array((\n 'my_module_accounts' =>\n array((\n 'lhs_module' => 'my_Module',\n 'lhs_table' => 'my_module',\n 'lhs_key' => 'id',\n 'rhs_module' => 'Accounts',\n 'rhs_table' => 'accounts',\n 'rhs_key' => 'id',\n 'relationship_type' => 'many-to-many',\n 'join_table' => 'my_module_accounts_c',\n 'join_key_lhs' => 'my_module_accountsmy_module_ida',\n 'join_key_rhs' => 'my_module_accountsaccounts_idb',\n ),\n ),\n 'table' => 'my_module_accounts_c',\n 'fields' =>\n array((\n 0 =>\n array((\n 'name' => 'id',\n 'type' => 'varchar',\n 'len' => 36,\n ),\n 1 =>\n array((\n 'name' => 'date_modified',\n 'type' => 'datetime',\n ),\n 2 =>\n array((\n 'name' => 'deleted',\n 'type' => 'bool',\n 'len' => '1',\n 'default' => '0',\n 'required' => true,\n ),\n 3 =>\n array((\n 'name' => 'my_module_accountsmy_module_ida',\n 'type' => 'varchar',", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Loader/Introduction_to_the_Manifest/index.html"} {"id": "2b6d150c4a73-10", "text": "'type' => 'varchar',\n 'len' => 36,\n ),\n 4 =>\n array((\n 'name' => 'my_module_accountsaccounts_idb',\n 'type' => 'varchar',\n 'len' => 36,\n ),\n ),\n 'indices' =>\n array((\n 0 =>\n array((\n 'name' => 'my_module_accountsspk',\n 'type' => 'primary',\n 'fields' =>\n array((\n 0 => 'id',\n ),\n ),\n 1 =>\n array((\n 'name' => 'my_module_accounts_alt',\n 'type' => 'alternate_key',\n 'fields' =>\n array((\n 0 => 'my_module_accountsmy_module_ida',\n 1 => 'my_module_accountsaccounts_idb',\n ),\n ),\n ),\n);\nscheduledefs\n\u00c2\u00a0Array\nScheduledTasks\u00c2\u00a0is part of the Extension Framework. More detail can be found in the\u00c2\u00a0Extension Framework documentation.\nsidecar\n\u00c2\u00a0Array\nSidecar\u00c2\u00a0is part of the Extension Framework. More detail can be found in the\u00c2\u00a0Extension Framework documentation.\ntinymce\n\u00c2\u00a0Array\nTinyMCE\u00c2\u00a0is part of the Extension Framework. More detail can be found in the\u00c2\u00a0Extension Framework documentation.\nuser_page\n\u00c2\u00a0Array\nUserPage\u00c2\u00a0is part of the Extension Framework. More detail can be found in the\u00c2\u00a0Extension Framework documentation.\nutils\n\u00c2\u00a0Array\nUtils\u00c2\u00a0is part of the Extension Framework. More detail can be found in the\u00c2\u00a0Extension Framework documentation.\nvardefs\n\u00c2\u00a0Array", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Loader/Introduction_to_the_Manifest/index.html"} {"id": "2b6d150c4a73-11", "text": "vardefs\n\u00c2\u00a0Array\nVardefs\u00c2\u00a0is part of the Extension Framework. More detail can be found in the\u00c2\u00a0Extension Framework documentation.\nwireless_modules\n\u00c2\u00a0Array\nWirelessModuleRegistery\u00c2\u00a0is part of the Extension Framework. More detail can be found in the\u00c2\u00a0Extension Framework documentation.\nwireless_subpanels\n\u00c2\u00a0Array\nWirelessLayoutDefs\u00c2\u00a0is part of the Extension Framework. More detail can be found in the\u00c2\u00a0Extension Framework documentation.\nNote: Anything printed to the screen in the pre_execute, post_execute, pre_uninstall, or post_uninstall scripts will be displayed when clicking on the Display Log link.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Loader/Introduction_to_the_Manifest/index.html"} {"id": "dd08eb070943-0", "text": "Module Loader Restrictions\nOverview\nSugarCRM's hosting objective is to maintain the integrity of the standard Sugar functionality when we upgrade a customer instance\u00c2\u00a0and limit any negative impact our upgrade has on the customer's modifications. All instances hosted on Sugar's cloud service have package scanner enabled by default. This setting is not configurable and all packages must pass the package scan for installation on Sugar's cloud environment. This includes passing all health checks.\nNote: Sugar Sell Essentials customers do not have the ability to upload custom file packages to Sugar using Module Loader.\nAccess Controls\nThe Module Loader includes a Module Scanner, which grants system administrators the control they need to determine the precise set of actions that they are willing to offer in their hosting environment. This feature is available in all Sugar products. Anyone who is hosting Sugar products can take advantage of this feature, as well.\nEnabling Package Scan\nScanning is disabled in default installations of Sugar\u00c2\u00a0and can be enabled through a configuration setting. This setting is added to ./config.php or ./config_override.php, and is not available to Administrator users to modify through the Sugar interface. Please note that this setting can only be managed on an on-site deployment and cannot be disabled for Sugar's cloud environment.\nTo enable Package Scan and its associated scans, add this setting to ./config_override.php:\n$sugar_config['moduleInstaller']['packageScan'] = true;\nThere are two categories of access control in the Package Scan:\nFile Scan\nModule Loader Actions\nEnabling File Scan\nBy enabling Package Scan, File Scan will be performed on all files in the package uploaded through Module Loader. File Scan will be performed when a Sugar administrator attempts to install the package. Please note that these settings can only be managed on an on-site deployment. These settings are not permitted to be modified when hosted on Sugar's cloud service.\nFile Scan performs three checks:\nFile extensions must be in the approved list of valid extension types.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Loader/Module_Loader_Restrictions/index.html"} {"id": "dd08eb070943-1", "text": "File extensions must be in the approved list of valid extension types.\nFiles must\u00c2\u00a0not contain any\u00c2\u00a0suspicious classes.\nFiles must not contain any suspicious function calls.\nPlease refer to the next three sections which outline the default requirements for the File Scan checks.\u00c2\u00a0\nValid Extension Types\nFile extensions must be in the approved list of valid extension types. The following extension types are valid by default:\ncss\ngif\nhbs\nhtm\nhtml\njpg\njs\nmd5\npdf\nphp\npng\ntpl\ntxt\nxml\nDenylisted Classes\nFiles must not contain any of the following classes that are considered suspicious by File Scan.\u00c2\u00a0\nAll variable classes (i.e., $class())\u00c2\u00a0are prohibited by default.\nThe following classes are denylisted by default:\nlua\npclzip\nreflection\nreflectionclass\nreflectionexception\nreflectionextension\nreflectionfunction\nreflectionfunctionabstract\nreflectionmethod\nreflectionobject\nreflectionparameter\nreflectionproperty\nreflectionzendextension\nreflector\nsplfileinfo\nsplfileobject\nziparchive\nDenylisted Function Calls\nFiles must\u00c2\u00a0not contain any of the following function calls that are considered suspicious by File Scan.\nVariable functions (i.e., $func()) are prohibited by default.\nBackticks (`) are prohibited by File Scan.\nThe following PHP functions are denylisted by default:\naddfunction\naddserver\narray_diff_uassoc\narray_diff_ukey\narray_filter\narray_intersect_uassoc\narray_intersect_ukey\narray_map\narray_reduce\narray_udiff\narray_udiff_assoc\narray_udiff_uassoc\narray_uintersect\narray_uintersect_assoc\narray_uintersect_uassoc\narray_walk\narray_walk_recursive\ncall_user_func\ncall_user_func\ncall_user_func_array\ncall_user_func_array\nchdir\nchgrp\nchmod\nchroot\nchwown\nclearstatcache\nconstruct\nconsume", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Loader/Module_Loader_Restrictions/index.html"} {"id": "dd08eb070943-2", "text": "chgrp\nchmod\nchroot\nchwown\nclearstatcache\nconstruct\nconsume\nconsumerhandler\ncopy\ncopy_recursive\ncreate_cache_directory\ncreate_custom_directory\ncreate_function\ncurl_copy_handle\ncurl_exec\ncurl_file_create\ncurl_init\ncurl_multi_add_handle\ncurl_multi_exec\ncurl_multi_getcontent\ncurl_multi_info_read\ncurl_multi_init\ncurl_multi_remove_handle\ncurl_multi_select\ncurl_multi_setopt\ncurl_setopt_array\ncurl_setopt\ncurl_share_init\ncurl_share_setopt\ncurl_share_strerror\ndir\ndisk_free_space\ndisk_total_space\ndiskfreespace\neio_busy\neio_chmod\neio_chown\neio_close\neio_custom\neio_dup2\neio_fallocate\neio_fchmod\neio_fchown\neio_fdatasync\neio_fstat\neio_fstatvfs\neio_fsync\neio_ftruncate\neio_futime\neio_grp\neio_link\neio_lstat\neio_mkdir\neio_mknod\neio_nop\neio_open\neio_read\neio_readahead\neio_readdir\neio_readlink\neio_realpath\neio_rename\neio_rmdir\neio_sendfile\neio_stat\neio_statvfs\neio_symlink\neio_sync\neio_sync_file_range\neio_syncfs\neio_truncate\neio_unlink\neio_utime\neio_write\nerror_log\nescapeshellarg\nescapeshellcmd\neval\nexec\nfclose\nfdf_enum_values\nfeof\nfflush\nfgetc\nfgetcsv\nfgets\nfgetss\nfile\nfile_exists\nfile_get_contents\nfile_put_contents\nfileatime\nfilectime\nfilegroup\nfileinode\nfilemtime\nfileowner\nfileperms\nfilesize\nfiletype", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Loader/Module_Loader_Restrictions/index.html"} {"id": "dd08eb070943-3", "text": "filegroup\nfileinode\nfilemtime\nfileowner\nfileperms\nfilesize\nfiletype\nflock\nfnmatch\nfopen\nforward_static_call\nforward_static_call_array\nfpassthru\nfputcsv\nfputs\nfread\nfscanf\nfseek\nfstat\nftell\nftruncate\nfwrite\nget\ngetbykey\ngetdelayed\ngetdelayedbykey\ngetfunctionvalue\ngetimagesize\nglob\nheader_register_callback\nibase_set_event_handler\nini_set\nis_callable\nis_dir\nis_executable\nis_file\nis_link\nis_readable\nis_uploaded_file\nis_writable\nis_writeable\niterator_apply\nlchgrp\nlchown\nldap_set_rebind_proc\nlibxml_set_external_entity_loader\nlink\nlinkinfo\nlstat\nmailparse_msg_extract_part\nmailparse_msg_extract_part_file\nmailparse_msg_extract_whole_part_file\nmk_temp_dir\nmkdir\nmkdir_recursive\nmove_uploaded_file\nnewt_entry_set_filter\nnewt_set_suspend_callback\nob_start\nopen\nopendir\nparse_ini_file\nparse_ini_string\npassthru\npassthru\npathinfo\npclose\npcntl_signal\npopen\npreg_replace_callback\nproc_close\nproc_get_status\nproc_nice\nproc_open\nreaddir\nreadfile\nreadline_callback_handler_install\nreadline_completion_function\nreadlink\nrealpath\nrealpath_cache_get\nrealpath_cache_size\nregister_shutdown_function\nregister_tick_function\nrename\nrewind\nrmdir\nrmdir_recursive\nsession_set_save_handler\nset_error_handler\nset_exception_handler\nset_file_buffer\nset_local_infile_handler\nset_time_limit\nsetclientcallback\nsetcompletecallback\nsetdatacallback\nsetexceptioncallback\nsetfailcallback\nsetserverparams\nsetstatuscallback\nsetwarningcallback\nsetworkloadcallback\nshell_exec\nsimplexml_load_file", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Loader/Module_Loader_Restrictions/index.html"} {"id": "dd08eb070943-4", "text": "setwarningcallback\nsetworkloadcallback\nshell_exec\nsimplexml_load_file\nsimplexml_load_string\nsocket_accept\nsocket_addrinfo_bind\nsocket_addrinfo_connect\nsocket_addrinfo_explain\nsocket_addrinfo_lookup\nsocket_bind\nsocket_clear_error\nsocket_close\nsocket_cmsg_space\nsocket_connect\nsocket_create_listen\nsocket_create_pair\nsocket_create\nsocket_export_stream\nsocket_get_option\nsocket_getopt\nsocket_getpeername\nsocket_getsockname\nsocket_import_stream\nsocket_last_error\nsocket_listen\nsocket_read\nsocket_recv\nsocket_recvfrom\nsocket_recvmsg\nsocket_select\nsocket_send\nsocket_sendmsg\nsocket_sendto\nsocket_set_block\nsocket_set_nonblock\nsocket_set_option\nsocket_setopt\nsocket_shutdown\nsocket_write\nfsockopen\nspl_autoload_register\nsqlite_create_aggregate\nsqlite_create_function\nsqlitecreateaggregate\nsqlitecreatefunction\nstat\nstream_bucket_append\nstream_bucket_make_writeable\nstream_bucket_new\nstream_bucket_prepend\nstream_context_create\nstream_context_get_default\nstream_context_get_options\nstream_context_get_params\nstream_context_set_default\nstream_context_set_option\nstream_context_set_params\nstream_copy_to_stream\nstream_filter_append\nstream_filter_prepend\nstream_filter_register\nstream_filter_remove\nstream_get_contents\nstream_get_filters\nstream_get_line\nstream_get_meta_data\nstream_get_transports\nstream_get_wrappers\nstream_is_local\nstream_isatty\nstream_notification_callback\nstream_register_wrapper\nstream_resolve_include_path\nstream_select\nstream_set_blocking\nstream_set_chunk_size\nstream_set_read_buffer\nstream_set_timeout\nstream_set_write_buffer\nstream_socket_accept\nstream_socket_client\nstream_socket_enable_crypto\nstream_socket_get_name\nstream_socket_pair\nstream_socket_recvfrom\nstream_socket_sendto\nstream_socket_server\nstream_socket_shutdown\nstream_supports_lock\nstream_wrapper_register\nstream_wrapper_restore\nstream_wrapper_unregister\nsugar_chgrp", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Loader/Module_Loader_Restrictions/index.html"} {"id": "dd08eb070943-5", "text": "stream_wrapper_register\nstream_wrapper_restore\nstream_wrapper_unregister\nsugar_chgrp\nsugar_chmod\nsugar_chown\nsugar_file_put_contents\nsugar_file_put_contents_atomic\nsugar_fopen\nsugar_mkdir\nsugar_rename\nsugar_touch\nsybase_set_message_handler\nsymlink\nsystem\ntempnam\ntimestampnoncehandler\ntmpfile\ntokenhandler\ntouch\nuasort\nuksort\numask\nunlink\nunzip\nunzip_file\nusort\nwrite_array_to_file\nwrite_array_to_file_as_key_value_pair\nwrite_encoded_file\nxml_set_character_data_handler\nxml_set_default_handler\nxml_set_element_handler\nxml_set_end_namespace_decl_handler\nxml_set_external_entity_ref_handler\nxml_set_notation_decl_handler\nxml_set_processing_instruction_handler\nxml_set_start_namespace_decl_handler\nxml_set_unparsed_entity_decl_handler\nThe following class functions are denylisted by default:\nAll variable functions (i.e., $func()) are prohibited by default.\u00c2\u00a0\nSugarLogger::setLevel\nSugarAutoLoader::put\nSugarAutoLoader::unlink\nHealth Check\nPackages must pass all health checks in order to pass through the package scanner. For more information on troubleshooting Health Check output, see the collection of help articles in\u00c2\u00a0Troubleshooting Health Check Output.\nDisabling File Scan\nNote: Disabling File Scan is prohibited\u00c2\u00a0for instances on Sugar's cloud service.\nTo disable File Scan, add the following configuration setting to config_override.php:\n$sugar_config['moduleInstaller']['disableFileScan'] = false;\nExtending the List of Valid Extension Types\nNote: Modifying the valid extensions list\u00c2\u00a0is prohibited\u00c2\u00a0for instances on Sugar's cloud service.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Loader/Module_Loader_Restrictions/index.html"} {"id": "dd08eb070943-6", "text": "To add more file extensions to the approved list of valid extension types, add the file extensions to the validExt array. The example below adds a .log file extension and .htaccess to the valid extension type list in config_override.php:\n$sugar_config['moduleInstaller']['validExt'] = array(\n 'log', \n 'htaccess'\n);\nDenylisting Additional Function Calls\nNote: Denylist modifications are prohibited\u00c2\u00a0for instances on Sugar's cloud service.\nTo add additional function calls to the denylist, add the function calls to the blackList array. The example below blocks the strlen() and strtolower() functions from being included in the package:\n$sugar_config['moduleInstaller']['blackList'] = array(\n 'strlen', \n 'strtolower'\n);\nOverriding Denylisted Function Calls\nNote: Denylist modifications are prohibited\u00c2\u00a0for instances on Sugar's cloud service.\nTo override the denylist and allow a specific function to be included in packages, add the function call to the blackListExempt array. The example below removes the restriction for the file_put_contents() function, allowing it to be included in the package:\n$sugar_config['moduleInstaller']['blackListExempt'] = array(\n 'file_put_contents'\n);\nDisabling Restricted Copy\nTo ensure upgrade-safe customizations, System Administrators must\u00c2\u00a0restrict the copy action to prevent modifying the existing Sugar source code files. New files may be added anywhere (to allow new modules to be added), but core Sugar source code files must not be overwritten. This is enabled by default when you enable Package Scan.\nNote: Disabling Restricted Copy is prohibited for instances on Sugar's cloud service.\nTo disable Restricted Copy, use this configuration setting:\n$sugar_config['moduleInstaller']['disableRestrictedCopy'] = true;\nModule Loader Actions", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Loader/Module_Loader_Restrictions/index.html"} {"id": "dd08eb070943-7", "text": "$sugar_config['moduleInstaller']['disableRestrictedCopy'] = true;\nModule Loader Actions\nModule loader actions, defined in ./ModuleInstall/ModuleScanner.php, are identifiers that map to the installation definitions used in the $installdefs of a manifest.\nAction\n$installdef\u00c2\u00a0Actions\nDescription\ninstall_administration\nadministration\nInstalls an administration section into the Admin page\ninstall_connectors\nconnectors\nInstalls SugarCloud Connectors\ninstall_copy\ncopy\nInstalls\u00c2\u00a0files or directories\ninstall_dashlets\ndashlets\nInstalls dashlets into the Sugar application\ninstall_images\nimage_dir\nInstall images into the custom directory\ninstall_languages\nlanguage\nInstalls language files\ninstall_layoutdefs\nlayoutdefs\nInstalls\u00c2\u00a0layouts\ninstall_layoutfields\nlayoutfields\nInstalls custom fields\ninstall_logichooks\nlogic_hooks\nInstalls logic hooks\ninstall_relationships\nrelationships\nInstalls relationships\ninstall_userpage\nuser_page\nInstalls\u00c2\u00a0a section to the User record page\ninstall_vardefs\nvardefs\nInstalls\u00c2\u00a0vardefs\npost_execute\npost_execute\nCalled after a package is installed\npre_execute\npre_execute\nCalled before a package is installed\nDisabling Module Loader Actions\nCertain Module Loader actions may be considered less desirable than others by a System Administrator. A System Administrator may want to allow some Module Loader actions, but disable specific actions that could impact the upgrade-safe integrity of the Sugar instance.\nNote: Disabling Module Loader actions\u00c2\u00a0is prohibited\u00c2\u00a0for instances on Sugar's cloud service.\nBy default, all Module Loader actions are allowed. Enabling Package Scan does not affect the Module Loader actions. To disable specific Module Loader actions, add the action to the disableActions array. The example below restricts the pre_execute and post_execute actions:\n$sugar_config['moduleInstaller']['disableActions'] = array(\n 'pre_execute',", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Loader/Module_Loader_Restrictions/index.html"} {"id": "dd08eb070943-8", "text": "'pre_execute', \n 'post_execute'\n);\nDisabling Upgrade Wizard\nIf you are hosting Sugar and wish to lock down the upgrade wizard, you can set disable_uw_upload to 'true' in the config_override. This is intended for hosting providers to prevent unwanted upgrades.\n$sugar_config['disable_uw_upload'] = true;\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Loader/Module_Loader_Restrictions/index.html"} {"id": "0a316758f61e-0", "text": "Module Loader Restriction Alternatives\nOverview\nThis article provides workarounds for commonly used functions that are denylisted by Sugar for\u00c2\u00a0Sugar's cloud environment.\nDenylisted Functions\n$variable()\nVariable functions are\u00c2\u00a0sometimes used when trying to dynamically call a function. This is commonly used to retrieve a new bean object.\nRestricted use:\n$module = \"Account\";\n$id = \"6468238c-da75-fd9a-406b-50199fe6b5f8\";\n//creating a new bean\n$focus = new $module()\n//retrieving a specific record\n$focus->retrieve($id);\nAs of 6.3.0, we have implemented newBean and getBean which can be found in the BeanFactory. Below is the recommended approach to create or fetch a bean:\n$module = \"Accounts\";\n$id = \"6468238c-da75-fd9a-406b-50199fe6b5f8\";\n//creating a new bean\n$focus = BeanFactory::newBean($module);\n//or creating a new bean and retrieving a specific record\n$focus = BeanFactory::getBean($module, $id);\narray_filter()\nThe array_filter filters elements of an array using a callback function. It\u00c2\u00a0is restricted from use on Sugar's cloud service due to its ability to call other\u00c2\u00a0restricted functions.\nRestricted use:\n/**\n * Returns whether the input integer is odd\n * @param $var\n * @return int\n */\nfunction odd($var) {\n return($var & 1);\n}\n$myArray = array(\n \"a\"=>1,\n \"b\"=>2,\n \"c\"=>3,\n \"d\"=>4,\n \"e\"=>5\n);\n$filteredArray = array_filter($myArray, \"odd\");", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Loader/Module_Loader_Restriction_Alternatives/index.html"} {"id": "0a316758f61e-1", "text": ");\n$filteredArray = array_filter($myArray, \"odd\");\nAn alternative to using array_filter\u00c2\u00a0is to use a foreach loop.\n$filteredArray = array();\n$myArray = array(\n \"a\"=>1,\n \"b\"=>2,\n \"c\"=>3,\n \"d\"=>4,\n \"e\"=>5\n);\nforeach ($myArray as $key => $value) {\n // check whether the input integer is odd\n if($value & 1) {\n $filteredArray[$key] = $value; \n }\n}\ncopy()\nThe copy\u00c2\u00a0method is sometimes used by developers when duplicating files in the uploads directory.\nRestricted use:\n$result = copy($oldFile, $newFile);\n\u00c2\u00a0An alternative to using copy\u00c2\u00a0is the\u00c2\u00a0duplicate_file\u00c2\u00a0method found in the\u00c2\u00a0UploadFile\u00c2\u00a0class.\nrequire_once 'include/upload_file.php';\n$uploadFile = new UploadFile();\n$result = $uploadFile->duplicate_file($oldFileId, $newFileId);\nfile_exists()\nThe file_exists method is used by developers to determine if a file exists.\nRestricted use:\nif(file_exists($file_path)) {\n require_once($file);\n}\nAn alternative to using file_exists is the\u00c2\u00a0fileExists\u00c2\u00a0method found in the SugarAutoLoader\u00c2\u00a0class.\n$file = 'include/utils.php';\nif (SugarAutoloader::fileExists($file)) {\n require_once($file);\n}\nfile_get_contents()\nThe file_get_contents method is used to retrieve the contents of a file.\nRestricted use:\n$file_contents = file_get_contents('file.txt');", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Loader/Module_Loader_Restriction_Alternatives/index.html"} {"id": "0a316758f61e-2", "text": "Restricted use:\n$file_contents = file_get_contents('file.txt');\nAn alternative to using file_get_contents and sugar_file_get_contents is the\u00c2\u00a0get_file_contents\u00c2\u00a0method found in the UploadFile class.\nrequire_once('include/upload_file.php');\n$uploadFile = new UploadFile();\n//get the file location\n$uploadFile->temp_file_location = UploadFile::get_upload_path($file_id);\n$file_contents = $uploadFile->get_file_contents();\nfwrite()\nThe fwrite method is a function used to write content to a file. As there isn't currently a direct alternative for this function, you may find one of the following a good solution to what you are trying to achieve.\nAdding/Removing Logic Hooks\nWhen working with logic hooks, it is very common for a developer to need to modify\u00c2\u00a0./custom/modules//logic_hooks.php. When creating module loadable packages, developers will sometimes use\u00c2\u00a0fwrite to modify this file upon installation to include their additional hooks. As of Sugar 6.3,\u00c2\u00a0Logic Hook Extensions\u00c2\u00a0were implemented to allow a developer to append custom hooks.\u00c2\u00a0If you would prefer to edit the logic_hooks.php file, you will need to\u00c2\u00a0use the\u00c2\u00a0check_logic_hook_file\u00c2\u00a0method as described below:\n//Adding a logic hook\nrequire_once(\"include/utils.php\");\n$my_hook = Array(\n 999,\n 'Example Logic Hook',\n 'custom/modules//my_hook.php',\n 'my_hook_class',\n 'my_hook_function'\n);\ncheck_logic_hook_file(\"Accounts\", \"before_save\", $my_hook);\nRemoving a logic hook can be done by using remove_logic_hook:\n//Removing a logic hook\nrequire_once(\"include/utils.php\");\n$my_hook = Array(\n 999,\n 'Example Logic Hook',", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Loader/Module_Loader_Restriction_Alternatives/index.html"} {"id": "0a316758f61e-3", "text": "$my_hook = Array(\n 999,\n 'Example Logic Hook',\n 'custom/modules//my_hook.php',\n 'my_hook_class',\n 'my_hook_function'\n);\nremove_logic_hook(\"Accounts\", \"before_save\", $my_hook);\ngetimagesize()\nThe getimagesize\u00c2\u00a0method is\u00c2\u00a0used to retrieve information about an image file.\nRestricted use:\n$img_size = getimagesize($path);\nIf you are looking to verify an image is .png or .jpeg, you can use the\u00c2\u00a0verify_uploaded_image\u00c2\u00a0method:\nrequire_once('include/utils.php');\nif (verify_uploaded_image($path)) {\n //logic\n}\nIf you are looking to get the mime type of an image, you can use the\u00c2\u00a0get_file_mime_type\u00c2\u00a0method:\n$mime_type = get_file_mime_type($path);\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Loader/Module_Loader_Restriction_Alternatives/index.html"} {"id": "5d909ea5236d-0", "text": "Sugar Exchange Package Guidelines\nOverview\nThe Sugar\u00c2\u00ae platform is open and flexible. Developers can customize any feature or integrate any system with Sugar using a Sugar Module Loadable Package. This flexibility requires guidelines so that SugarExchange customers can rest assured\u00c2\u00a0that all package offerings adhere to consistent quality standards and will not interfere with existing customizations or prevent software upgrades.\nThis guide outlines the minimum standards we expect from any Sugar Developer writing code for the Sugar platform. From the development of Sugar packages to security, user interface, encapsulation, and performance considerations, SugarCRM takes the safety and integrity of the Sugar application and its community very seriously. Compliance with these guidelines is a requirement for any package installed into Sugar's cloud service. Failure to follow these guidelines is grounds for having your package removed from Sugar's cloud service and de-listed from SugarExchange.\nSugarCRM reserves the right to change these guidelines at any time. Please send any questions or feedback on these guidelines to developers@sugarcrm.com.\nBest Practices\nThese best practice guidelines have been curated\u00c2\u00a0based on years of collective experience working with Sugar Packages that get used by Sugar customers every day.\nUse a consistent coding style\nFor all PHP code, the style standard that SugarCRM uses is PSR-2. For JavaScript code, we use the applicable PSR-2 conventions as well. For JavaScript code, we emphasize readability which means we make use of utilities like Underscore.js and avoid nested callbacks. All functions, methods, classes in our code are required to have PHPDoc and JSDoc. While not all the code in the Sugar code base currently complies with these standards, we do enforce it as the standard on new code. Using a consistent code style increases the readability and maintainability of application code for those that come after you.\nInvest in unit testing during development", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Loader/Sugar_Exchange_Package_Guidelines/index.html"} {"id": "5d909ea5236d-1", "text": "Invest in unit testing during development\nFor all JavaScript and PHP code, we strongly recommend the creation of unit tests. For PHP, we use PHPUnit and have developed a framework (to be shared) for testing Sugar server-side code using this framework. For JavaScript code, we use Jasmine and have also developed a framework (to be shared) there to bootstrap Sidecar metadata so that Jasmine tests can run without dependency on a Sugar server.\nWe recommend running unit tests frequently during the development process. We suggest developers run tests before each commit and as part of an automated continuous integration process. Running tests often means you catch failures sooner which makes them easier and cheaper to fix.\nUse Sugar REST APIs\nThe easiest way to integrate with a Sugar instance is not to install anything into Sugar at all. For Sugar 7, we have a full client REST API that is used to drive our web interface, our mobile client, and our plug-ins. If you can do it from our user interface, you can use our REST API separately to do it as well. If the REST API doesn't do everything you need it to do, it is very easily extensible. You can easily write code that adds your custom API endpoints in a minimally invasive way.\nUse Module Builder when possible\nMany integrations can be accomplished with the help of Module Builder and the Sugar REST API. Module Builder allows you to\u00c2\u00a0quickly\u00c2\u00a0design new modules for Sugar that match concepts that you want to add to a Sugar instance. These custom modules can then be installed and populated via the REST API, making it a powerful integration mechanism that doesn't require writing a line of Sugar code. Using custom modules will prevent conflicts with other customizations, as well. For more information, please refer to the Module Builder documentation.\nUse Extension framework and Dashlets for Sugar code customizations", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Loader/Sugar_Exchange_Package_Guidelines/index.html"} {"id": "5d909ea5236d-2", "text": "Use Extension framework and Dashlets for Sugar code customizations\nThe Extension framework is the way to add server-side changes to a Sugar instance in a loosely coupled way. Dashlets are the best way to add new, custom user interface components to a Sugar instance that gives users maximum flexibility in how they use your app. These mechanisms also avoid conflicts with other customizations since Extensions are additive and do not replace core files.\nSecurity Guidelines\nProtecting and controlling access to CRM data is of paramount importance. It is important that Sugar Packages are good stewards of CRM data and access control.\nUse TLS/SSL for web services calls\nJust as we don't recommend running Sugar in production without TLS/SSL, all web-services calls that are initiated from a Sugar Package should also use SSL. The concern is the exposure of user credentials, OAuth/session tokens, or sensitive CRM data via plaintext transmission that would otherwise be handled\u00c2\u00a0securely.\nDo not hardcode sensitive information\nYou also should not hardcode any credentials, API keys, tokens, etc, within a Sugar Package. Sugar Packages and Sugar application code is never encrypted so there is always a risk that an attacker could discover these things and abuse them. Usernames and passwords, OAuth tokens, and similar credentials for accessing 3rd party systems should be stored in the database (for example, on the config table). The Sugar platform also provides encryption utilities that allow\u00c2\u00a0information to be stored in an encrypted form. These settings could then be changeable by the Administrator via the Administration panel or some other end-user input.\nUser Interface Guidelines\nSugar packages can be used to add new user interface components or front-end customizations to Sugar. It is important to consider the impact that these changes have on the user experience and the look and feel of the Sugar application.\nUse the Sugar 7 Styleguide", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Loader/Sugar_Exchange_Package_Guidelines/index.html"} {"id": "5d909ea5236d-3", "text": "Use the Sugar 7 Styleguide\nIn Sugar 7, we have doubled down on our emphasis on creating the best possible user experience. While other applications may use different usage patterns than the ones used in Sugar 7, it is important to think about how new functionality or integrations that you build in Sugar 7 fits within the overall Sugar 7 user experience. Users do not tolerate an inconsistent experience within a given tool - it makes it harder to learn to use, which lowers adoption of Sugar as well as your application.\nWe want to make it easier for you to build applications within Sugar that use a consistent theme and user experience patterns, so we have included a styleguide for the Sugar application. You can find a link to the styleguide\u00c2\u00a0from the Sugar Administration page. There you can find all the information you need to leverage Sugar 7's styling including our CSS framework.\nDon't use incompatible UI frameworks or external CSS libraries\nMixing outside user interface frameworks into the Sugar application via a Sugar Package can easily break many different parts of the application. Please only include as much CSS as you need and make sure that it is properly formed so that it doesn't affect other parts of the Sugar application. At the very least, using different frameworks or themes within your application will create a disjointed experience for the end user. While your package may be installed into Sugar, the user experience will not be seamless.\nEncapsulation Guidelines\nAn important aspect of the quality of a Sugar Package is how well encapsulated and loosely coupled it is. A well encapsulated and loosely coupled package will encounter the fewest issues during upgrades, fewer breakages due to core code changes or due to interactions with other installed packages, as well minimizing bugs or problems that end users encounter.\nUse Extensions framework and Custom Modules as much as possible", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Loader/Sugar_Exchange_Package_Guidelines/index.html"} {"id": "5d909ea5236d-4", "text": "Use Extensions framework and Custom Modules as much as possible\nA well-encapsulated package prefers the use of Custom Modules over customizing and repurposing existing Sugar Modules. A loosely coupled package uses Extensions framework for customizing and connecting with the core Sugar application. Only override the behavior of core Sugar application files as a last resort.\nAvoid customizations to core Sugar application files\nDevelopers are strongly discouraged from overriding core Sugar Modules or Sugar framework code. In many cases, a cleaner approach for accomplishing the same goal exists. For example, using a logic hook to extend the behavior of a SugarBean instead of overriding the SugarBean itself. Every core customization is a barrier to successful upgrades that creates recurring development costs over time. This is exacerbated in heavily customized Sugar instances as other customizations may exist on these files. Anytime there is a conflict then manual intervention by a Sugar Developer is required which is not only inconvenient but costly for everyone involved. If you do make core Sugar customizations then keeping track of such changes is very important to get in front of potential conflicts with other packages and upgrades.\nUse Package Scanner to ensure your Sugar Package is ready for SugarCloud\nSugar Packages should be designed with Sugar's cloud service in mind, as many Sugar customers choose this hosting option over hosting on-site or through a Sugar partner. Code that gets loaded into Sugar's cloud service must pass the Package Scanner utility and must not adversely impact the SugarCRM infrastructure. This stipulation is outlined in the\u00c2\u00a0SugarCloud Policy Guide. Package Scanner can be enabled on any Sugar instance via the Sugar Administration panel which allows this to be tested easily. You should also educate yourself in some alternatives to\u00c2\u00a0denylisted functions.\nPerformance Guidelines", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Loader/Sugar_Exchange_Package_Guidelines/index.html"} {"id": "5d909ea5236d-5", "text": "Performance Guidelines\nSugar is primarily a database application however with the introduction of Sugar 7, more and more business logic is executed within the user's web browser. It is best to avoid pre-optimization and use tools to properly identify the root causes of performance issues that users could encounter.\nSugar 7 has instrumentation built into it for New Relic APM,\u00c2\u00a0which can monitor browser and server performance simultaneously, as well as XHprof for Sugar PHP profiling. Slow query logging can also be enabled via the Sugar Administration panel under System Settings. For more information, refer to the System documentation. The Sugar Engineering team typically uses Chrome DevTools for JavaScript profiling.\nIndex for large frequently used queries\nThe most common performance bottleneck for Sugar is the database. Using slow query logging makes it possible to identify bottlenecks and correct them. One way to address query bottlenecks is to extend vardefs to add indices during package install to improve the performance of those queries.\nAdd scheduled jobs to prune large database tables\nIf your Package adds database tables that can tend to grow very large over time, it is a best practice to include scheduled jobs in your package that can be used to prune the size of this database over time. For Sugar, these background tasks can be created and managed using the Job Queue framework. At the very least, you'll want to create a Custom Job that Sugar Administrators can then run as needed. This will allow the package to remain in tip-top shape for your users over time. Especially if they are running on Sugar's cloud service because direct access to the underlying SQL database to do manual tuning and cleanup is not permitted.\nEnsure your application does not block user interface during long running processes", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Loader/Sugar_Exchange_Package_Guidelines/index.html"} {"id": "5d909ea5236d-6", "text": "Ensure your application does not block user interface during long running processes\nIf your application prevents the user from getting feedback or using the interface while it is running a long process, this will impact the perceived performance of the application. Users typically expect some UI feedback within half a second. If you have transactions that will take longer than that, it is best to use the Job Queue framework to defer them for later or move them into a scheduled Custom Job.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Module_Loader/Sugar_Exchange_Package_Guidelines/index.html"} {"id": "8a9c81cd568f-0", "text": "TinyMCE\nOverview\nThis article demonstrates how to work with the TinyMCE rich-editor field and customize its settings.\u00c2\u00a0\nTinyMCE Field Type (htmleditable_tinymce)\nSugar provides a rich-text editor field using TinyMCE. This editor is used available when customizing templates and composing emails. As Sugar does not provide a way to create and use these field in Studio, we will demonstrate how to convert a text area field into a TinyMCE editor in the following sections.\nConverting a Text Area to a TinyMCE Editor\nAs an example, we will use the Accounts' description field. The description fields type is by default text area. First of all, you will need to change the type of the field to htmleditable_tinymce using the\u00c2\u00a0displayParams\u00c2\u00a0vardef\u00c2\u00a0key.\n$dictionary['Account']['fields']['description']['displayParams']['type'] = 'htmleditable_tinymce';\nAdditionally, having a rich-text editor will require you to have a longer database field to store the HTML content. You will need to change the dbType to longtext and its length to 4294967295.\n$dictionary['Account']['fields']['description']['dbType'] = 'longtext';\n$dictionary['Account']['fields']['description']['len'] = '4294967295';\nAfter making these changes, the vardef definition will look as follows:\n./custom/Extension/modules/Accounts/Ext/Vardefs/tinymce_description.php\n Repairs and Perform Quick Repair and Rebuild.\u00c2", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/TinyMCE/index.html"} {"id": "8a9c81cd568f-1", "text": "Configuring the TinyMCE Editor\nConfiguring the TinyMCE editors can be done using the\u00c2\u00a0tinyConfig vardef key. The\u00c2\u00a0tinyConfig key maps to the TinyMCE configuration options. For example, if you would add a plugin into TinyMCE editor, you would modify the\u00c2\u00a0tinyConfig.plugins\u00c2\u00a0vardef key. An example of a vardef definition that will change the accounts description field to a custom TinyMCE Editor and modify its default TinyMCE settings is shown below.\n./custom/Extension/modules/Accounts/Ext/Vardefs/tinymce_description.php\n 'paste,autoresize,visualblocks,textcolor,table,emoticons,autolink',\n 'table_default_attributes' => array(\n 'border' => '1',\n ),\n 'target_list' => array(\n array(\n 'title' => 'New page',\n 'value' => '_blank',\n ),\n ),\n 'default_link_target' => '_blank',\n 'extended_valid_elements' => \"a[href|target|data-mce-href]\",\n 'codesample_languages' => array(\n array('text' => 'HTML/XML', 'value' => 'markup'),\n array('text' => 'JavaScript', 'value' => 'javascript'),\n array('text' => 'CSS', 'value' => 'css'),", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/TinyMCE/index.html"} {"id": "8a9c81cd568f-2", "text": "array('text' => 'CSS', 'value' => 'css'),\n array('text' => 'PHP', 'value' => 'php'),\n ),\n 'toolbar1' => 'formatselect | bold italic underline strikethrough | bullist numlist | forecolor backcolor ',\n 'toolbar2' => 'table tabledelete emoticons codesample | tableprops tablerowprops tablecellprops | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol | visualblocks removeformat',\n);\nSince you are making changes in the vardef, you will need to navigate Admin > Repairs and run Quick Repair and Rebuild. Once you perform Quick Repair and Rebuild, the description of the Account records will have TinyMCE Editor that allows you to write rich-text content.\nPlugins\nSugar is using TinyMCE v4. Most of the settings that you can define in tinyConfig are exist in TinyMCE documentation. However, it is important to know that plugins are limited with plugins that are provided by Sugar. These plugins can be found in ./include/javascript/tinymce4/plugins.\nConfiguring the TinyMCE Editors used in BWC Modules\nIf you are looking for a solution with older TinyMCE that Sugar uses. You can try to create an override file and modify default settings. There are two different overrides that can be applied to buttons and default settings.\nOverriding Buttons\nThe first override file is for the toolbar buttons. To do this, you must create ./custom/include/tinyButtonConfig.php. Within this file, you will be able to override the button layout for the TinyMCE editor.\nThere are 3 different layouts you can change:\ndefault : Used when creating an email template\nemail_compose : Used when composing an email from the full form under the Emails module", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/TinyMCE/index.html"} {"id": "8a9c81cd568f-3", "text": "email_compose : Used when composing an email from the full form under the Emails module\nemail_compose_light : Used when doing a quick compose from a listview or subpanel\nExample File\n./custom/include/tinyButtonConfig.php\n \"code,help,separator,bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,forecolor,backcolor,separator,styleselect,formatselect,fontselect,fontsizeselect,\",\n 'buttonConfig2' => \"cut,copy,paste,pastetext,pasteword,selectall,separator,search,replace,separator,bullist,numlist,separator,outdent,indent,separator,ltr,rtl,separator,undo,redo,separator, link,unlink,anchor,image,separator,sub,sup,separator,charmap,visualaid\",\n 'buttonConfig3' => \"tablecontrols,separator,advhr,hr,removeformat,separator,insertdate,inserttime,separator,preview\"\n );\n //Standard email compose\n $buttonConfigs['email_compose'] = array(\n 'buttonConfig' => \"code,help,separator,bold,italic,underline,strikethrough,separator,bullist,numlist,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,forecolor,backcolor,separator,styleselect,formatselect,fontselect,fontsizeselect,\",\n 'buttonConfig2' => \"\", //empty\n 'buttonConfig3' => \"\" //empty\n );\n //Quick email compose\n $buttonConfigs['email_compose_light'] = array(", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/TinyMCE/index.html"} {"id": "8a9c81cd568f-4", "text": "//Quick email compose\n $buttonConfigs['email_compose_light'] = array(\n 'buttonConfig' => \"code,help,separator,bold,italic,underline,strikethrough,separator,bullist,numlist,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,forecolor,backcolor,separator,styleselect,formatselect,fontselect,fontsizeselect,\",\n 'buttonConfig2' => \"\", //empty\n 'buttonConfig3' => \"\" //empty\n );\nOverriding Default Settings\nThe second override file is for basic TinyMCE functionality. To do this, you must create ./custom/include/tinyMCEDefaultConfig.php. TinyMCE has quite a few settings that can be altered, so the best reference for configuration settings can be found in the TinyMCE Configuration Documentation.\nExample File\n./custom/include/tinyMCEDefaultConfig.php\n false,\n 'valid_children' => '+body[style]',\n 'height' => 300,\n 'width' => '100%',\n 'theme' => 'advanced',\n 'theme_advanced_toolbar_align' => \"left\",\n 'theme_advanced_toolbar_location' => \"top\",\n 'theme_advanced_buttons1' => \"\",\n 'theme_advanced_buttons2' => \"\",\n 'theme_advanced_buttons3' => \"\",\n 'strict_loading_mode' => true,\n 'mode' => 'exact',\n 'language' => 'en',\n 'plugins' => 'advhr,insertdatetime,table,preview,paste,searchreplace,directionality',\n 'elements' => '',", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/TinyMCE/index.html"} {"id": "8a9c81cd568f-5", "text": "'elements' => '',\n 'extended_valid_elements' => 'style[dir|lang|media|title|type],hr[class|width|size|noshade],@[class|style]',\n 'content_css' => 'include/javascript/tiny_mce/themes/advanced/skins/default/content.css',\n );\nCreating Plugins\nAnother alternative to customizing the TinyMCE is to create a plugin. Your plugins will be stored in ./include/javascript/tiny_mce/plugins/. You can find more information on creating plugins on the\u00c2\u00a0TinyMCE website.\nthe use and customization of TinyMCE.\nTopicsModifying the TinyMCE EditorThis article is a brief overview on how to modify the default settings for the TinyMCE editor by creating an override file. There are two different overrides that can be applied to buttons and default settings.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/TinyMCE/index.html"} {"id": "e77a1c55f0b0-0", "text": "Modifying the TinyMCE Editor\nOverview\nThis article is a brief overview on how to modify the default settings for the TinyMCE editor\u00c2\u00a0by creating an override file. There are two different overrides that can be applied to buttons and default settings.\nOverriding Buttons\nThe first override file is for the toolbar buttons. To do this, you must create ./custom/include/tinyButtonConfig.php. Within this file, you will be able to override the button layout for the TinyMCE editor.\nThere are 3 different layouts you can change:\ndefault : Used when creating an email template\nemail_compose : Used when composing an email from the full form under the Emails module\nemail_compose_light : Used when doing a quick compose from a listview or subpanel\nExample File\n./custom/include/tinyButtonConfig.php\n \"code,help,separator,bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,forecolor,backcolor,separator,styleselect,formatselect,fontselect,fontsizeselect,\",\n 'buttonConfig2' => \"cut,copy,paste,pastetext,pasteword,selectall,separator,search,replace,separator,bullist,numlist,separator,outdent,indent,separator,ltr,rtl,separator,undo,redo,separator, link,unlink,anchor,image,separator,sub,sup,separator,charmap,visualaid\",\n 'buttonConfig3' => \"tablecontrols,separator,advhr,hr,removeformat,separator,insertdate,inserttime,separator,preview\"\n );\n //Standard email compose\n $buttonConfigs['email_compose'] = array(", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/TinyMCE/Modifying_the_TinyMCE_Editor/index.html"} {"id": "e77a1c55f0b0-1", "text": "//Standard email compose\n $buttonConfigs['email_compose'] = array(\n 'buttonConfig' => \"code,help,separator,bold,italic,underline,strikethrough,separator,bullist,numlist,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,forecolor,backcolor,separator,styleselect,formatselect,fontselect,fontsizeselect,\",\n 'buttonConfig2' => \"\", //empty\n 'buttonConfig3' => \"\" //empty\n );\n //Quick email compose\n $buttonConfigs['email_compose_light'] = array(\n 'buttonConfig' => \"code,help,separator,bold,italic,underline,strikethrough,separator,bullist,numlist,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,forecolor,backcolor,separator,styleselect,formatselect,fontselect,fontsizeselect,\",\n 'buttonConfig2' => \"\", //empty\n 'buttonConfig3' => \"\" //empty\n );\nOverriding Default Settings\nThe second override file is for basic TinyMCE functionality. To do this, you must create ./custom/include/tinyMCEDefaultConfig.php. TinyMCE has quite a few settings that can be altered, so the best reference for configuration settings can be found in the TinyMCE Configuration Documentation.\nExample File\n./custom/include/tinyMCEDefaultConfig.php\n false,\n 'valid_children' => '+body[style]',\n 'height' => 300,\n 'width' => '100%',\n 'theme' => 'advanced',\n 'theme_advanced_toolbar_align' => \"left\",\n 'theme_advanced_toolbar_location' => \"top\",", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/TinyMCE/Modifying_the_TinyMCE_Editor/index.html"} {"id": "e77a1c55f0b0-2", "text": "'theme_advanced_toolbar_location' => \"top\",\n 'theme_advanced_buttons1' => \"\",\n 'theme_advanced_buttons2' => \"\",\n 'theme_advanced_buttons3' => \"\",\n 'strict_loading_mode' => true,\n 'mode' => 'exact',\n 'language' => 'en',\n 'plugins' => 'advhr,insertdatetime,table,preview,paste,searchreplace,directionality',\n 'elements' => '',\n 'extended_valid_elements' => 'style[dir|lang|media|title|type],hr[class|width|size|noshade],@[class|style]',\n 'content_css' => 'include/javascript/tiny_mce/themes/advanced/skins/default/content.css',\n );\nCreating Plugins\nAnother alternative to customizing the TinyMCE is to create a plugin. Your plugins will be stored in ./include/javascript/tiny_mce/plugins/. You can find more information on creating plugins on the\u00c2\u00a0TinyMCE website.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/TinyMCE/Modifying_the_TinyMCE_Editor/index.html"} {"id": "482d8aa23692-0", "text": "Logic Hooks\nOverview\nThe Logic Hook framework allows you to\u00c2\u00a0append actions to system\u00c2\u00a0events such as when creating, editing, and deleting records.\nHook Definitions\nA logic hook definition file defines the various actions to execute when an event is triggered. It is important to note that there are various ways to implement a logic hook. The following sections describe the different ways to implement a logic hook and when to use each.\nMethodologies\nLogic hook definitions can\u00c2\u00a0pertain\u00c2\u00a0to\u00c2\u00a0a\u00c2\u00a0specific module or to the entire application. Either way, you must decide if the logic hook definition will be implemented as an extension of or directly to the module or application. The following sections explain the difference between these methodologies.\nModule Extension Hooks\nModule extension hooks are located in ./custom/Extension/modules//Ext/LogicHooks/\u00c2\u00a0and allow a developer\u00c2\u00a0to define\u00c2\u00a0hook actions that will be executed for the specified\u00c2\u00a0events in a given module.\u00c2\u00a0Extensions are best used when creating customizations that may be installed in various environments. They help prevent conflicting edits that occur when\u00c2\u00a0modifying ./custom/modules//logic_hooks.php. More information can be found in the\u00c2\u00a0Logic Hooks\u00c2\u00a0extension section.\nModule Hooks\nModule hooks are located in\u00c2\u00a0./custom/modules//logic_hooks.php\u00c2\u00a0and allow a developer\u00c2\u00a0to define\u00c2\u00a0hook actions that will be executed for the specified events in a given module. This path can be used for private development, however, it is not recommended for use\u00c2\u00a0with\u00c2\u00a0distributed modules and plugins. For distributed code, please refer to using module extensions.\nApplication Extension Hooks", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/index.html"} {"id": "482d8aa23692-1", "text": "Application Extension Hooks\nApplication extension hooks are located in ./custom/Extension/application/Ext/LogicHooks/\u00c2\u00a0and allow a developer to define\u00c2\u00a0hook actions that will be executed for all specified application-level events\u00c2\u00a0using the extension framework. More information can be found in the\u00c2\u00a0Logic Hooks\u00c2\u00a0extension section.\nApplication Hooks\nApplication\u00c2\u00a0hooks are located in\u00c2\u00a0./custom/modules/logic_hooks.php\u00c2\u00a0and allow a developer\u00c2\u00a0to define\u00c2\u00a0hook actions that will be executed for the specified\u00c2\u00a0events in all modules. This path can be used for private development, however, it is not recommended for use\u00c2\u00a0with\u00c2\u00a0distributed modules and plugins. For distributed code, please refer to using\u00c2\u00a0application extensions.\nDefinition Properties\nAll logic hooks must have a\u00c2\u00a0$hook_version and $hook_array\u00c2\u00a0variable defined. The following sections cover each required variable.\nhook_version\nAll logic hook definitions will define a $hook_version. This determines the version of the logic hook framework. Currently, the only supported hook version is 1.\n$hook_version = 1;\nhook_array\nThe logic hook definition will also contain a $hook_array. This defines the specific action to execute. The hook array will be defined as follows:\nName\nType\nDescription\nevent_name\nString\nThe name of the event to append the action to\nprocess_index\nInteger\nThe order of action execution\ndescription\nString\nA short description of\u00c2\u00a0the hook action\nfile_path\nString\nThe path to the logic hook file\u00c2\u00a0in the ./custom/ directory, or null if using namespaces\nclass_name\nString\nThe name of the logic hook action class including any namespaces\nmethod_name\nString\nThe name of the logic hook action method\nYour definition should resemble the code block below:\n'][] = array(\n , //Integer\n '', //String\n '', //String or null if using namespaces\n '', //String\n '', //String\n );\nHook Method\nThe hook action class can be located anywhere you choose. We\u00c2\u00a0recommended grouping the hooks with the module they are associated with in the ./custom/ directory. You can create a hook action method either with a namespace or without.\nNamespaced Hooks\nAs of 7.7, developers can create namespaced logic hooks. When using namespaces, the file path in ./custom/\u00c2\u00a0will be automatically built out when using the corresponding namespace. The filename defining the class must match the class name exactly to allow the autoloader to find the class definition.\nNamespace\nFile Path\nSugarcrm\\Sugarcrm\\custom\n./custom/\nSugarcrm\\Sugarcrm\\custom\n./custom/src/\nSugarcrm\\Sugarcrm\\custom\\any\\path\n./custom/any/path/\nSugarcrm\\Sugarcrm\\custom\\any\\path\n./custom/src/any/path/\n./custom/Extension/modules/Accounts/Ext/LogicHooks/.php\n\n./custom/modules/Accounts/className.php\n", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/index.html"} {"id": "482d8aa23692-3", "text": "{\n //logic\n }\n }\n?>\nThe logic hook method signature may contain different arguments depending on the hook event you have selected.\nHooks without Namespaces\n./custom/Extension/modules/Accounts/Ext/LogicHooks/.php\n\n./custom/modules/Accounts/customLogicHook.php\n\nThe logic hook method signature may contain different arguments depending on the hook event you have selected.\nConsiderations\nWhen using logic hooks, keep in mind the following best practices:\nAs of PHP 5.3, objects are automatically passed by reference. When creating logic hook signatures, do not\u00c2\u00a0append the ampersand (&) to the $bean variable. Doing this will cause unexpected behavior.\nThere is no hook that fires specifically for the ListView, DetailView or EditView events. Instead,\u00c2\u00a0use either the process_record\u00c2\u00a0or after_retrieve logic hooks.\nIn order to compare new values with previous values, use fetched_row to determine whether a change has occurred: if ($bean->fetched_row['{field}'] != $bean->{field})\n{\n //logic\n}", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/index.html"} {"id": "482d8aa23692-4", "text": "{\n //logic\n}\nMake sure that the permissions on the\u00c2\u00a0logic_hooks.php file and the class file that it references are readable by the web server. Otherwise, Sugar will not read the files and your business logic extensions will not work. For example, *nix developers who are extending the Tasks logic should use the following command for the logic_hooks file and the same command for the class file that will be called:\nchmod +r ./custom/modules/Tasks/logic_hooks.php\nMake sure that the entire ./custom/ directory is writable by the web server or else the logic hooks code will not work properly.\nTopicsApplication HooksApplication hooks execute logic when working with the global application.Module HooksModule hooks execute logic when working with Sugar modules (e.g. Accounts, Cases, etc.).User HooksUser hooks execute logic around user actions such as logging in and logging out.Job Queue HooksJob Queue hooks execute logic when working with the Job Queue module.SNIP HooksSNIP hooks execute logic when working with the SNIP email-archiving service.API HooksAPI hooks execute logic when working with the REST API and routing.Web Logic HooksWeb logic hooks let administrators post record and event information to a specified URL when certain sugar events take place.Logic Hook Release NotesThis page documents historical changes to Sugar's logic hook libraries.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/index.html"} {"id": "9072833d365d-0", "text": "Logic Hook Release Notes\nThis page documents\u00c2\u00a0historical changes to Sugar's logic hook libraries.\n10.2.0\nThe following parameter was added in the 10.2.0 release:\nafter_save arguments.stateChanges\n7.0.0RC1\nWeb Logic Hooks were introduced in this release.\nThe following hooks were also added in the 7.0.0RC1 release:\nafter_routing\nbefore_api_call\nbefore_filter\nbefore_respond\nbefore_routing\nThe following parameters were added in the 7.0.0RC1 release:\nafter_save arguments.isUpdate\nafter_save arguments.dataChanges\nbefore_save arguments.isUpdate\n6.6.0\nThe after_load_user hook was added in the 6.6.0 release.\n6.5.0RC1\nThe following hooks were added in the 6.5.0RC1 release:\nafter_email_import\nbefore_email_import\njob_failure\njob_failure_retry\n6.4.5\nThe following hooks were added in the 6.4.5 release:\nbefore_relationship_add\nbefore_relationship_delete\n6.4.4\nThe handle_exception hook was added in the 6.4.4 release.\n6.4.3\nThe after_entry_point hook was added in the 6.4.3 release.\n6.0.0RC1\nThe following hooks were added in the 6.0.0RC1 release:\nafter_relationship_add\nafter_relationship_delete\n5.0.0a\nThe following hooks were added in the 5.0.0a release:\nafter_login\nafter_logout\nafter_ui_footer\nafter_ui_frame\nbefore_logout\nlogin_failed\nprocess_record\nserver_round_trip\n4.5.0c\nThe after_save hook was added in the 4.5.0c release.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Logic_Hook_Release_Notes/index.html"} {"id": "9072833d365d-1", "text": "The after_save hook was added in the 4.5.0c release.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Logic_Hook_Release_Notes/index.html"} {"id": "b0380b913f29-0", "text": "SNIP Hooks\nSNIP hooks execute logic when working with\u00c2\u00a0the SNIP email-archiving service.\nTopicsafter_email_importThe after_email_import hook executes after a SNIP email has been imported.before_email_importThe before_email_import hook executes before a SNIP email has been imported.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/SNIP_Hooks/index.html"} {"id": "cd98285b2ef0-0", "text": "before_email_import\nOverview\nThe before_email_import hook executes before a SNIP email has been imported.\nDefinition\nfunction before_email_import($bean, $event, $arguments){}\nArguments\nName\nType\nDescription\nbean\nObject\nThe Email object\nevent\nString\nThe current event\narguments\nArray\nAdditional information related to the event (typically empty)\nConsiderations\nThis is a global logic hook where the logic hook reference must be placed in ./custom/modules/logic_hooks.php.\nChange Log\nVersion\nNote\n6.5.0RC1\nAdded before_email_import hook\nExample\n./custom/modules/logic_hooks.php\n\n./custom/modules/SNIP/logic_hooks_class.php\n\n\u00c2\u00a0\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/SNIP_Hooks/before_email_import/index.html"} {"id": "3476f30e105c-0", "text": "after_email_import\nOverview\nThe after_email_import hook executes after a SNIP email has been imported.\nDefinition\nfunction after_email_import($bean, $event, $arguments){}\nArguments\nName\nType\nDescription\nbean\nObject\nThe Email object\nevent\nString\nThe current event\narguments\nArray\nAdditional information related to the event (typically empty)\nConsiderations\nThis is a global logic hook where the logic hook reference must be placed in ./custom/modules/logic_hooks.php.\nChange Log\nVersion\nNote\n6.5.0RC1\nAdded after_email_import hook\nExample\n./custom/modules/logic_hooks.php\n\n./custom/modules/SNIP/logic_hooks_class.php\n\n\u00c2\u00a0\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/SNIP_Hooks/after_email_import/index.html"} {"id": "558f1151461b-0", "text": "Job Queue Hooks\nJob Queue hooks execute logic when working with the Job Queue module.\nTopicsjob_failureThe job_failure hook executes when a job's final failure occurs.job_failure_retryThe job_failure_retry hook executes each time a job fails before its final failure. If you only want action on the final failure, use the job_failure logic hook.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Job_Queue_Hooks/index.html"} {"id": "924e093af85e-0", "text": "job_failure_retry\nOverview\nThe job_failure_retry hook executes each time a job fails before its final failure. If you only want action on the final failure, use the\u00c2\u00a0job_failure logic hook.\nDefinition\nfunction job_failure_retry($bean, $event, $arguments){}\nArguments\nName\nType\nDescription\nbean\nObject\nThe SchedulersJob object\nevent\nString\nThe current event\narguments\nArray\nAdditional information related to the event (typically empty)\nChange Log\nVersion\nNote\n6.5.0RC1\nAdded job_failure_retry hook\nExample\n./custom/modules/SchedulersJobs/logic_hooks.php\n\n./custom/modules/SchedulersJobs/logic_hooks_class.php\n\n\u00c2\u00a0\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Job_Queue_Hooks/job_failure_retry/index.html"} {"id": "9b551dc178e7-0", "text": "job_failure\nOverview\nThe job_failure hook executes when a job's final failure occurs.\nDefinition\nfunction job_failure($bean, $event, $arguments){}\nArguments\nName\nType\nDescription\nbean\nObject\nThe SchedulersJob object\nevent\nString\nThe current event\narguments\nArray\nAdditional information related to the event (typically empty)\nChange Log\nVersion\nNote\n6.5.0RC1\nAdded job_failure hook\nExample\n./custom/modules/SchedulersJobs/logic_hooks.php\n\n./custom/modules/SchedulersJobs/logic_hooks_class.php\n\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Job_Queue_Hooks/job_failure/index.html"} {"id": "b5037fb1c991-0", "text": "Web Logic Hooks\nOverview\nWeb logic hooks let administrators post record and event information to a specified URL when certain sugar events take place.\nThe administration panel for web logic hooks can be found by navigating to Admin > Web Logic Hooks in the Sugar application. When a web logic hook is triggered, Sugar creates a record in the job queue.\nNote: You must have the cron set up and running in order to process the job queue for web logic hooks. The POST of the information to the external URL will happen when the cron runs and not when the actual event occurs.\nArguments\nName\nDescription\nURL\nThe URL to post JSON-encoded information\nModule Name\nThe name of the module to which the web logic hook will apply\nTrigger Event\nThe event that will trigger the web logic hookThe following events are applicable to a web logic hook:\nafter_save\nafter_delete\nafter_relationship_add\nafter_relationship_delete\nafter_login\nafter_logout\nafter_login_failed\nRequest Method\nThe request method to use when sending the informationThe following methods may\u00c2\u00a0be used:\nPOST\nGET\nPUT\nDELETE\nExample\nThe following\u00c2\u00a0example shows how to receive the information posted to the web logic hook URL parameter.\nhttp://{url}/receive.php\n\nResult\nreceivedData-1380158171.txt\nstdClass Object\n(\n [isUpdate] => 1\n [dataChanges] => Array\n (\n )\n [bean] => Account\n [data] => stdClass Object\n (", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Web_Logic_Hooks/index.html"} {"id": "b5037fb1c991-1", "text": "[bean] => Account\n [data] => stdClass Object\n (\n [id] => e0623cdb-ac4b-e7ff-f681-5242e9116892\n [name] => Super Star Holdings Inc\n [date_modified] => 2013-09-25T21:16:06-04:00\n [modified_user_id] => 1\n [modified_by_name] => admin\n [created_by] => 1\n [created_by_name] => Administrator\n [description] =>\n [deleted] =>\n [assigned_user_id] => seed_will_id\n [assigned_user_name] => Will Westin\n [team_count] =>\n [team_name] => Array\n (\n [0] => stdClass Object\n (\n [id] => East\n [name] => East\n [name_2] =>\n [primary] => 1\n )\n [1] => stdClass Object\n (\n [id] => West\n [name] => West\n [name_2] =>\n [primary] =>\n )\n )\n [linkedin] =>\n [facebook] =>\n [twitter] =>\n [googleplus] =>\n [account_type] => Customer\n [industry] => Energy\n [annual_revenue] =>\n [phone_fax] =>\n [billing_address_street] => 111 Silicon Valley Road\n [billing_address_city] => Los Angeles\n [billing_address_state] => NY\n [billing_address_postalcode] => 84028\n [billing_address_country] => USA\n [rating] =>\n [phone_office] => (374) 791-2199\n [phone_alternate] =>", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Web_Logic_Hooks/index.html"} {"id": "b5037fb1c991-2", "text": "[phone_alternate] =>\n [website] =>\n [ownership] =>\n [employees] =>\n [ticker_symbol] =>\n [shipping_address_street] => 111 Silicon Valley Road\n [shipping_address_city] => Los Angeles\n [shipping_address_state] => NY\n [shipping_address_postalcode] => 84028\n [shipping_address_country] => USA\n [email] => Array\n (\n [0] => stdClass Object\n (\n [email_address] => example@example.tw\n [invalid_email] =>\n [opt_out] =>\n [primary_address] => 1\n [reply_to_address] =>\n )\n [1] => stdClass Object\n (\n [email_address] => the.example@example.name\n [invalid_email] =>\n [opt_out] =>\n [primary_address] =>\n [reply_to_address] =>\n )\n )\n [email1] => example@example.tw\n [parent_id] =>\n [sic_code] =>\n [parent_name] =>\n [email_opt_out] =>\n [invalid_email] =>\n [campaign_id] =>\n [campaign_name] =>\n )\n [event] => after_save\n)\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Web_Logic_Hooks/index.html"} {"id": "853bb94cc11c-0", "text": "User Hooks\nUser hooks execute logic around\u00c2\u00a0user actions such as logging in and logging out.\nTopicsafter_loginThe after_login hook executes after a user logs into the system.after_logoutThe after_logout hook executes after a user logs out of the system.before_logoutThe before_logout hook executes before a user logs out of the system.login_failedThe login_failed hook executes on a failed login attempt.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/User_Hooks/index.html"} {"id": "01d350b4e328-0", "text": "after_login\nOverview\nThe after_login hook executes after a user logs into the system.\nDefinition\nfunction after_login($bean, $event, $arguments){}\nArguments\nName\nType\nDescription\nbean\nObject\nThe bean object\nevent\nString\nThe current event\narguments\nArray\nAdditional information related to the event (typically empty)\nChange Log\nVersion\nNote\n5.0.0a\nAdded after_login hook\nExample\n./custom/modules/Users/logic_hooks.php\n\n./custom/modules/Users/logic_hooks_class.php\n\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/User_Hooks/after_login/index.html"} {"id": "b8a5a31eb23c-0", "text": "after_logout\nOverview\nThe after_logout\u00c2\u00a0hook executes after a user logs out of the system.\nDefinition\nfunction after_logout($bean, $event, $arguments){}\nArguments\nName\nType\nDescription\nbean\nObject\nThe bean object\nevent\nString\nThe current event\narguments\nArray\nAdditional information related to the event (typically empty)\nChange Log\nVersion\nNote\n5.0.0a\nAdded after_logout\u00c2\u00a0hook\nExample\n./custom/modules/Users/logic_hooks.php\n\n./custom/modules/Users/logic_hooks_class.php\n\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/User_Hooks/after_logout/index.html"} {"id": "746dfacb58a9-0", "text": "login_failed\nOverview\nThe login_failed hook executes on a failed login attempt.\nDefinition\nfunction login_failed($bean, $event, $arguments){}\nArguments\nName\nType\nDescription\nbean\nObject\nThe bean object\nevent\nString\nThe current event\narguments\nArray\nAdditional information related to the event (typically empty)\nChange Log\nVersion\nNote\n5.0.0a\nAdded login_failed hook\nExample\n./custom/modules/Users/logic_hooks.php\n\n./custom/modules/Users/logic_hooks_class.php\n\n\u00c2\u00a0\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/User_Hooks/login_failed/index.html"} {"id": "55a185decdb9-0", "text": "before_logout\nOverview\nThe before_logout\u00c2\u00a0hook executes before a user logs out of\u00c2\u00a0the system.\nDefinition\nfunction before_logout($bean, $event, $arguments){}\nArguments\nName\nType\nDescription\nbean\nObject\nThe bean object\nevent\nString\nThe current event\narguments\nArray\nAdditional information related to the event (typically empty)\nChange Log\nVersion\nNote\n5.0.0a\nAdded before_logout\u00c2\u00a0hook\nExample\n./custom/modules/Users/logic_hooks.php\n\n./custom/modules/Users/logic_hooks_class.php\n\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/User_Hooks/before_logout/index.html"} {"id": "5bc3ae9eb5d4-0", "text": "API Hooks\nAPI\u00c2\u00a0hooks execute logic when working with the REST API and routing.\nTopicsafter_routingThe after_routing hook executes when the v10+ REST Service has found the route for the request.before_api_callThe before_api_call hook executes when the v10+ REST Service is about to call the API implementation.before_filterThe before_filter hook executes when the v10+ REST Service is about to route the request.before_respondThe before_respond hook executes before the v10+ REST Service call returns data to the user.before_routingThe before_routing hook executes when the v10+ REST Service is about to route the request.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/API_Hooks/index.html"} {"id": "327f51891971-0", "text": "before_respond\nOverview\nThe before_respond hook executes before the v10+ REST Service call returns data to the user.\nDefinition\nfunction before_respond($event, $response){}\nArguments\nName\nType\nDescription\nevent\nString\nThe name of the logic hook event\nresponse\nObject\nThe RestResponse Object\nConsiderations\nThis is a global logic hook where the logic hook reference must be placed in ./custom/modules/logic_hooks.php.\nIt is not advised to remove or unset any data. Sugar may be using this data and it can adversely affect your instance.\nThis hook should not be used for any type of display output.\nThis hook should be used when you want to add data to all API responses. If you are looking to modify data received from one specific endpoint, It is a much better approach to override that specific endpoint rather than to use this logic hook.\nChange Log\nVersion\nNote\n7.0.0RC1\nAdded before_respond hook\nExample\n./custom/modules/logic_hooks.php\n\n./custom/modules/logic_hooks_class.php\n\n\u00c2\u00a0\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/API_Hooks/before_respond/index.html"} {"id": "402672a00221-0", "text": "before_api_call\nOverview\nThe before_api_call hook executes when the v10+ REST Service is about to call the API implementation.\nDefinition\nfunction before_api_call($event, $arguments){}\nArguments\nName\nType\nDescription\nevent\nString\nThe name of the logic hook event\narguments\nArray\nAdditional information related to the event\narguments.api\nObject\nThe RestService Object\narguments.request\nObject\nThe RestResponse Object\nConsiderations\nThis is a global logic hook where the logic hook reference must be placed in ./custom/modules/logic_hooks.php.\nThis hook can change the method being called and the parameters.\nThis hook should not be used for any type of display output.\nChange Log\nVersion\nNote\n7.0.0RC1\nAdded before_api_call hook\nExample\n./custom/modules/logic_hooks.php\n\n./custom/modules/logic_hooks_class.php\n", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/API_Hooks/before_api_call/index.html"} {"id": "402672a00221-1", "text": "{\n //logic\n }\n }\n?>\n\u00c2\u00a0\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/API_Hooks/before_api_call/index.html"} {"id": "9b10657648f2-0", "text": "after_routing\nOverview\nThe after_routing hook executes when the v10+ REST Service has found the route for the request.\nDefinition\nfunction after_routing($event, $arguments){}\nArguments\nName\nType\nDescription\nevent\nString\nThe name of the logic hook event\narguments\nArray\nAdditional information related to the event\narguments.api\nObject\nThe RestService Object\narguments.request\nObject\nThe RestResponse Object\nConsiderations\nThis is a global logic hook where the logic hook reference must be placed in ./custom/modules/logic_hooks.php.\nThis hook can change request object parameters that influence routing.\nThis hook should not be used for any type of display output.\nChange Log\nVersion\nNote\n7.0.0RC1\nAdded after_routing hook\nExample\n./custom/modules/logic_hooks.php\n\n./custom/modules/logic_hooks_class.php\n\u00c2", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/API_Hooks/after_routing/index.html"} {"id": "9b10657648f2-1", "text": "{\n //logic\n }\n }\n?>\u00c2\u00a0\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/API_Hooks/after_routing/index.html"} {"id": "5110ef9d1958-0", "text": "before_routing\nOverview\nThe before_routing hook executes when the v10+ REST Service is about to route the request.\nDefinition\nfunction before_routing($event, $arguments){}\nArguments\nName\nType\nDescription\nevent\nString\nThe name of the logic hook event\narguments\nArray\nAdditional information related to the event\narguments.api\nObject\nThe RestService Object\narguments.request\nObject\nThe RestResponse Object\nConsiderations\nThis is a global logic hook where the logic hook reference must be placed in ./custom/modules/logic_hooks.php.\nThis hook can change request object parameters that influence routing.\nThis hook should not be used for any type of display output.\nChange Log\nVersion\nNote\n7.0.0RC1\nAdded before_routing hook\nExample\n./custom/modules/logic_hooks.php\n\n./custom/modules/logic_hooks_class.php\n", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/API_Hooks/before_routing/index.html"} {"id": "5110ef9d1958-1", "text": "{\n //logic\n }\n }\n?>\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/API_Hooks/before_routing/index.html"} {"id": "f68f7c59f286-0", "text": "before_filter\nOverview\nThe before_filter hook executes when the v10+ REST Service is about to route the request.\nDefinition\nfunction before_filter($bean, $event, $arguments){}\nArguments\nName\nType\nDescription\nbean\nObject\nAn empty bean object of the module being queried.\nevent\nString\nThe name of the logic hook event.\narguments\nArray\nAdditional information related to the event.\narguments[0]\nObject\nThe SugarQuery Object\narguments[1]\nArray\nThe query options\nConsiderations\nThis hook can be executed for a specific module in ./custom/modules//logic_hooks.php or globally in ./custom/modules/logic_hooks.php.\nThis hook can change request object parameters that influence routing.\nThis hook should not be used for any type of display output.\nChange Log\nVersion\nNote\n7.0.0RC1\nAdded before_filter hook\nExample\n./custom/modules/{module}/logic_hooks.php\n\n./custom/modules/{module}/logic_hooks_class.php\n\n\u00c2\u00a0\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/API_Hooks/before_filter/index.html"} {"id": "3cfbb4d0fb0a-0", "text": "Module Hooks\nModule hooks execute logic when working with Sugar modules (e.g. Accounts, Cases, etc.).\nTopicsafter_deleteThe after_delete hook executes after a record is deleted.after_fetch_queryThe after_fetch_query logic hook executes after a sugar query has been executed.after_relationship_addThe after_relationship_add hook executes after a relationship has been added between two records.after_relationship_deleteThe after_relationship_delete hook executes after a relationship between two records has been deleted.after_restoreThe after_restore hook executes after a record gets undeleted (i.e. the deleted field's value changes from 1 to 0).after_retrieveThe after_retrieve hook executes after a record has been retrieved from the database.after_saveThe after_save hook executes after a record is saved.before_deleteThe before_delete logic hook executes before a record is deleted.before_fetch_queryThe before_fetch_query logic hook executes before a sugar query has been executed.before_relationship_addThe before_relationship_add logic hook executes before a relationship has been added between two records.before_relationship_deleteThe before_relationship_delete logic hook executes before a relationship between two records is deleted.before_restoreThe before_restore logic hook executes before a record gets undeleted (i.e. the deleted field's value changes from 1 to 0).before_saveThe before_save logic hook executes before a record is saved.process_recordThe process_record logic hook executes when the record is being processed as a part of the ListView or subpanel list.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Module_Hooks/index.html"} {"id": "3a444bbad6e4-0", "text": "after_retrieve\nOverview\nThe after_retrieve hook executes after a record has been retrieved from the database.\nDefinition\nfunction after_retrieve($bean, $event, $arguments){}\nArguments\nName\nType\nDescription\nbean\nObject\nThe bean object\nevent\nString\nThe current event\narguments\nArray\nAdditional information related to the event\narguments.id\nString\nID of the record\narguments.encode\nBoolean\nWhether or not to encode\nConsiderations\nThe after_retrieve hook does not fire when a new record is being created.\nCalling save on the bean in this hook can cause adverse side effects if not handled correctly and should be avoided. (i.e. $bean->save())\nExamples\nCreating a Logic Hook using the Extension Framework\n./custom/Extension/modules//Ext/LogicHooks/.php\n/after_retrieve_class.php',\n //The class the method is in.\n 'after_retrieve_class',\n //The method to call.\n 'after_retrieve_method'\n );\n?>\n./custom/modules/{module}/{module}_hook.php\n\nCreating a Core Logic Hook", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Module_Hooks/after_retrieve/index.html"} {"id": "3a444bbad6e4-1", "text": "//logic\n }\n }\n?>\nCreating a Core Logic Hook\nPrior to Sugar 6.3.x, logic hooks could only be created using the following method. Please note that this approach is still valid but is not recommended when building plugins as it may conflict with existing customizations.\n./custom/modules//logic_hooks.php\n/after_retrieve_class.php', \n //The class the method is in.\n 'after_retrieve_class', \n //The method to call.\n 'after_retrieve_method' \n );\n?>\n./custom/modules//after_retrieve_class.php\n\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Module_Hooks/after_retrieve/index.html"} {"id": "ebf804abb51d-0", "text": "process_record\nOverview\nThe process_record logic hook executes when the record is being processed as a part of the ListView or subpanel list.\nDefinition\nfunction process_record($bean, $event, $arguments){}\nArguments\nName\nType\nDescription\nbean\nObject\nThe bean object\nevent\nString\nThe current event\narguments\nArray\nAdditional information related to the event (typically empty)\nConsiderations\nThis can be used to set values in a record's fields prior to display in the ListView or in the subpanel of a DetailView.\nThis event is not fired in the EditView.\nYou should not call save on the referenced bean. The bean is only populated for list fields and will result in a loss of information.\nChange Log\nVersion\nNote\n5.0.0a\nAdded process_record hook\nExamples\nCreating a Logic Hook using the Extension Framework\n./custom/Extension/modules//Ext/LogicHooks/.php\n/process_record_class.php',\n //The class the method is in.\n 'process_record_class',\n //The method to call.\n 'process_record_method'\n );\n?>\n./custom/modules//process_record_class.php\n\nCreating a Core Logic Hook", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Module_Hooks/process_record/index.html"} {"id": "ebf804abb51d-1", "text": "//logic\n }\n }\n?>\nCreating a Core Logic Hook\nPrior to Sugar 6.3.x, logic hooks could only be created using the following method. Please note that this approach is still valid but is not recommended when building plugins as it may conflict with existing customizations.\n./custom/modules//logic_hooks.php\n/process_record_class.php', \n //The class the method is in.\n 'process_record_class', \n //The method to call.\n 'process_record_method' \n );\n?>\n./custom/modules//process_record_class.php\n\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Module_Hooks/process_record/index.html"} {"id": "e7e0a808cd36-0", "text": "after_fetch_query\nOverview\nThe after_fetch_query\u00c2\u00a0logic hook executes after\u00c2\u00a0a sugar query\u00c2\u00a0has been executed.\nDefinition\nfunction after_fetch_query($bean, $event, $arguments){}\nArguments\nName\nType\nDescription\nbean\nObject\nThe bean object\nevent\nString\nThe current event\narguments\nArray\nAdditional information related to the event\narguments.beans\nArray\nAn array of bean objects resulting from the query\narguments.fields\nArray\nAn array\u00c2\u00a0of selected fields\narguments.rows\nArray\nAn array representation of the selected beans\u00c2\u00a0\nChange Log\nVersion\nNote\n7.7.0.0\nAdded after_fetch_query\u00c2\u00a0logic hook\nExamples\nCreating a Logic Hook using Extension Framework\n./custom/Extension/modules//Ext/LogicHooks/.php\n/after_fetch_query_class.php',\n //The class the method is in.\n 'after_fetch_query_class',\n //The method to call.\n 'after_fetch_query_method'\n );\n?>\n./custom/modules//after_fetch_query_class.php\n\nCreating a Core Logic Hook", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Module_Hooks/after_fetch_query/index.html"} {"id": "e7e0a808cd36-1", "text": "//logic\n }\n }\n?>\nCreating a Core Logic Hook\nPrior to Sugar 6.3.x, logic hooks could only be created using the following method. Please note that this approach is still valid but is not recommended when building plugins as it may conflict with existing customizations.\n./custom/modules//logic_hooks.php\n/after_fetch_query_class.php', \n //The class the method is in.\n 'logic_hooks_class', \n //The method to call.\n 'after_fetch_query_method' \n );\n?>\n./custom/modules//after_fetch_query_class.php\n\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Module_Hooks/after_fetch_query/index.html"} {"id": "08747081b932-0", "text": "after_save\nOverview\nThe after_save hook executes after a record is saved.\nDefinition\nfunction after_save($bean, $event, $arguments){}\nArguments\nName\nType\nDescription\nbean\nObject\nThe bean object\nevent\nString\nThe current event\narguments\nArray\nAdditional information related to the event (typically empty)\narguments.isUpdate\nBoolean\nWhether or not the record is newly created or not. True is an existing record being saved. False is a new record being created\narguments.dataChanges\nArray\nA list of the fields in the auditable fields on the bean, including the ones that changed and the ones that did not.Note: This argument is deprecated and it is recommended to use arguments.stateChanges instead.\narguments.stateChanges\nArray\nA\u00c2\u00a0list of only the fields in the auditable fields on the bean that changed\nConsiderations\nCalling save on the bean in this hook will cause an infinite loop if not handled correctly. (i.e: $bean->save())\nExamples\nCreating a Logic Hook using the Extension Framework\n./custom/Extension/modules//Ext/LogicHooks/.php\n/after_save_class.php',\n //The class the method is in.\n 'after_save_class',\n //The method to call.\n 'after_save_method'\n );\n?>\n./custom/modules//after_save_class.php\n\nCreating a Core Logic Hook\nPrior to Sugar 6.3.x, logic hooks could only be created using the following method. Please note that this approach is still valid but is not recommended when building plugins as it may conflict with existing customizations.\n./custom/modules//logic_hooks.php\n/after_save_class.php', \n //The class the method is in.\n 'after_save_class', \n //The method to call.\n 'after_save_method' \n );\n?>\n./custom/modules//after_save_class.php\n\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Module_Hooks/after_save/index.html"} {"id": "f6e44fda226d-0", "text": "after_delete\nOverview\nThe after_delete hook executes after a record is deleted.\nDefinition\nfunction after_delete($bean, $event, $arguments){}\nArguments\nName\nType\nDescription\nbean\nObject\nThe bean object\nevent\nString\nThe current event\narguments\nArray\nAdditional information related to the event\narguments.id\nString\nID of the deleted record\nExamples\nCreating a Logic Hook using the Extension Framework\n./custom/Extension/modules//Ext/LogicHooks/.php\n/logic_hooks_class.php', \n //The class the method is in.\n 'logic_hooks_class', \n //The method to call.\n 'after_delete_method' \n );\n?>\n./custom/modules//logic_hooks_class.php\n\nCreating a Core Logic Hook\nPrior to Sugar 6.3.x, logic hooks could only be created using the following method. Please note that this approach is still valid but is not recommended when building plugins as it may conflict with existing customizations.\n./custom/modules//logic_hooks.php\n/after_delete_class.php', \n //The class the method is in.\n 'after_delete_class', \n //The method to call.\n 'after_delete_method' \n );\n?>\n./custom/modules//after_delete_class.php\n\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Module_Hooks/after_delete/index.html"} {"id": "6f8310bec170-0", "text": "after_restore\nOverview\nThe after_restore hook executes after a record gets undeleted (i.e. the deleted field's value changes from 1 to 0).\nDefinition\nfunction after_restore($bean, $event, $arguments){}\nArguments\nName\nType\nDescription\nbean\nObject\nThe bean object\nevent\nString\nThe current event\narguments\nArray\nAdditional information related to the event (typically empty)\nExamples\nCreating a Logic Hook using the Extension Framework\n./custom/Extension/modules//Ext/LogicHooks/.php\n/after_restore_class.php',\n //The class the method is in.\n 'after_restore_class',\n //The method to call.\n 'after_restore_method'\n );\n?>\n./custom/modules//after_restore_class.php\n\nCreating a Core Logic Hook\nPrior to Sugar 6.3.x, logic hooks could only be created using the following method. Please note that this approach is still valid but is not recommended when building plugins as it may conflict with existing customizations.\n./custom/modules//logic_hooks.php\n/after_restore_class.php', \n //The class the method is in.\n 'after_restore_class', \n //The method to call.\n 'after_restore_method' \n );\n?>\n./custom/modules//after_restore_class.php\n\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Module_Hooks/after_restore/index.html"} {"id": "77be405585d4-0", "text": "before_delete\nOverview\nThe before_delete logic hook executes before a record is deleted.\nDefinition\nfunction before_delete($bean, $event, $arguments){}\nArguments\nName\nType\nDescription\nbean\nObject\nThe bean object\nevent\nString\nThe current event\narguments\nArray\nAdditional information related to the event\narguments.id\nString\nID of the record to delete\nExamples\nCreating a Logic Hook using the Extension Framework\n./custom/Extension/modules//Ext/LogicHooks/.php\n/before_delete_class.php',\n //The class the method is in.\n 'before_delete_class',\n //The method to call.\n 'before_delete_method'\n );\n?>\n./custom/modules//before_delete_class.php\n\nCreating a Core Logic Hook\nPrior to Sugar 6.3.x, logic hooks could only be created using the following method. Please note that this approach is still valid but is not recommended when building plugins as it may conflict with existing customizations.\n./custom/modules//logic_hooks.php\n/before_delete_class.php', \n //The class the method is in.\n 'before_delete_class', \n //The method to call.\n 'before_delete_method' \n );\n?>\n./custom/modules//before_delete_class.php\n\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Module_Hooks/before_delete/index.html"} {"id": "af25ba96f8af-0", "text": "after_relationship_add\nOverview\nThe after_relationship_add hook executes after a relationship has been added between two records.\nDefinition\nfunction after_relationship_add($bean, $event, $arguments){}\nArguments\nName\nType\nDescription\nbean\nObject\nThe bean object\nevent\nString\nThe current event\narguments\nArray\nAdditional information related to the event\narguments.id\nString\nModule ID\narguments.module\nString\nModule name\narguments.related_id\nString\nRelated module ID\narguments.related_module\nString\nRelated module name\narguments.link\nString\nLink field name\narguments.relationship\nString\nRelationship name\nConsiderations\nThis hook will be executed for each side of the relationship. An example is that if you add an association between an Account and Contact, the hook will be run for both.\nThe arguments parameter will have additional information regarding the records being modified. The $bean variable will not contain this information.\nChange Log\nVersion\nNote\n6.0.0\nAdded after_relationship_add hook.\nExamples\nCreating a Logic Hook using the Extension Framework\n./custom/Extension/modules//Ext/LogicHooks/.php\n\n./custom/modules//after_relationship_add_class.php\n\nCreating a Core Logic Hook\nPrior to Sugar 6.3.x, logic hooks could only be created using the following method. Please note that this approach is still valid but is not recommended when building plugins as it may conflict with existing customizations.\n./custom/modules//logic_hooks.php\n/after_relationship_add_class.php', \n //The class the method is in.\n 'after_relationship_add_class', \n //The method to call.\n 'after_relationship_add_method' \n );\n?>\n./custom/modules//after_relationship_add_class.php\n\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Module_Hooks/after_relationship_add/index.html"} {"id": "636c1aebed35-0", "text": "before_save\nOverview\nThe before_save logic hook executes before a record is saved.\nDefinition\nfunction before_save($bean, $event, $arguments){}\nArguments\nName\nType\nDescription\nbean\nObject\nThe bean object\nevent\nString\nThe current event\narguments\nArray\nAdditional information related to the event\narguments.check_notify\nBoolean\nWhether or not to send notifications\narguments.isUpdate\nBoolean\nWhether or not the record is newly created\ntrue = this is an update to an existing record\nfalse = a newly created record\nConsiderations\nFor modules that contain a user-friendly record ID (e.g. the case_number field for the Cases module), the value of that field is not available for a before_save call. This is because this business logic has yet to be executed.\nCalling save on the bean in this hook will cause an infinite loop if not handled correctly. (i.e: $bean->save())\nExamples\nCreating a Logic Hook using Extension Framework\n./custom/Extension/modules//Ext/LogicHooks/.php\n/before_save_class.php',\n //The class the method is in.\n 'before_save_class',\n //The method to call.\n 'before_save_method'\n );\n?>\n./custom/modules//before_save_class.php\n\nCreating a Core Logic Hook\nPrior to Sugar 6.3.x, logic hooks could only be created using the following method. Please note that this approach is still valid but is not recommended when building plugins as it may conflict with existing customizations.\n./custom/modules//logic_hooks.php\n/before_save_class.php', \n //The class the method is in.\n 'before_save_class', \n //The method to call.\n 'before_save_method' \n );\n?>\n./custom/modules//before_save_class.php\n\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Module_Hooks/before_save/index.html"} {"id": "b3761eb392ae-0", "text": "before_relationship_delete\nOverview\nThe before_relationship_delete logic hook executes before a relationship between two records is\u00c2\u00a0deleted.\nDefinition\nfunction before_relationship_delete($bean, $event, $arguments){}\nArguments\nName\nType\nDescription\nbean\nObject\nThe bean object\nevent\nString\nThe current event\narguments\nArray\nAdditional information related to the event\narguments.id\nString\nModule id\narguments.module\nString\nModule name\narguments.related_id\nString\nRelated module id\narguments.related_module\nString\nRelated module name\narguments.link\nString\nLink field name\narguments.relationship\nString\nRelationship name\nConsiderations\nThis hook will be executed for each side of the relationship. For example, if you delete an association between an account and a contact, the hook will run for both records.\nThe arguments parameter will have additional information regarding the records being modified. The $bean variable will not contain this information.\nChange Log\nVersion\nNote\n6.4.5\nAdded before_relationship_delete hook.\nExamples\nCreating a Logic Hook using the Extension Framework\n./custom/Extension/modules//Ext/LogicHooks/.php\n/before_relationship_delete_class.php',\n //The class the method is in.\n 'before_relationship_delete_class',\n //The method to call.\n 'before_relationship_delete_method'\n );\n?>\n./custom/modules//before_relationship_delete_class.php\n\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Module_Hooks/before_relationship_delete/index.html"} {"id": "0cc34231f65e-0", "text": "before_restore\nOverview\nThe before_restore logic hook executes before a record gets undeleted (i.e. the deleted field's value changes from 1 to 0).\nDefinition\nfunction before_restore($bean, $event, $arguments){}\nArguments\nName\nType\nDescription\nbean\nObject\nThe bean object\nevent\nString\nThe current event\narguments\nArray\nAdditional information related to the event (typically empty)\nExamples\nCreating a Logic Hook using the Extension Framework\n./custom/Extension/modules//Ext/LogicHooks/.php\n/before_restore_class.php',\n //The class the method is in.\n 'before_restore_class',\n //The method to call.\n 'before_restore_method'\n );\n?>\n./custom/modules//before_restore_class.php\n\nCreating a Core Logic Hook\nPrior to Sugar 6.3.x, logic hooks could only be created using the following method. Please note that this approach is still valid but is not recommended when building plugins as it may conflict with existing customizations.\n./custom/modules//logic_hooks.php\n/before_restore_class.php', \n//The class the method is in.\n'before_restore_class', \n//The method to call.\n'before_restore_method' \n);\n?>\n./custom/modules//before_restore_class.php\n\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Module_Hooks/before_restore/index.html"} {"id": "3e7b8180786c-0", "text": "after_relationship_delete\nOverview\nThe after_relationship_delete hook executes after a relationship between two records has been deleted.\nDefinition\nfunction after_relationship_delete($bean, $event, $arguments){}\nArguments\nName\nType\nDescription\nbean\nObject\nThe bean object\nevent\nString\nThe current event\narguments\nArray\nAdditional information related to the event\narguments.id\nString\nModule ID\narguments.module\nString\nModule name\narguments.related_id\nString\nRelated module ID\narguments.related_module\nString\nRelated module name\narguments.link\nString\nLink field name\narguments.relationship\nString\nRelationship name\nConsiderations\nThis hook will be executed for each side of the relationship. For example, if you delete an association between an account and contact, the hook will run for both.\nThe 'arguments' parameter will have additional information regarding the records being modified. The $bean variable will not contain this information.\nChange Log\nVersion\nNote\n6.0.0\nAdded after_relationship_delete hook\nExamples\nCreating a Logic Hook using the Extension Framework\n./custom/Extension/modules//Ext/LogicHooks/.php\n/after_relationship_delete_class.php',\n //The class the method is in.\n 'after_relationship_delete_class',\n //The method to call.\n 'after_relationship_delete_method'\n );\n?>\n./custom/modules//after_relationship_delete_class.php\n\nCreating a Core Logic Hook\nPrior to Sugar 6.3.x, logic hooks could only be created using the following method. Please note that this approach is still valid but is not recommended when building plugins as it may conflict with existing customizations.\n./custom/modules//logic_hooks.php\n/after_relationship_delete_class.php', \n //The class the method is in.\n 'after_relationship_delete_class', \n //The method to call.\n 'after_relationship_delete_method' \n );\n?>\n./custom/modules//after_relationship_delete_class.php\n\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Module_Hooks/after_relationship_delete/index.html"} {"id": "47d574635897-0", "text": "before_fetch_query\nOverview\nThe before_fetch_query\u00c2\u00a0logic hook executes\u00c2\u00a0before\u00c2\u00a0a sugar query\u00c2\u00a0has been executed.\nDefinition\nfunction before_fetch_query($bean, $event, $arguments){}\nArguments\nName\nType\nDescription\nbean\nObject\nThe bean object\nevent\nString\nThe current event\narguments\nArray\nAdditional information related to the event\narguments.query\nObject\nThe query to be executed\narguments.fields\nArray\nAn array\u00c2\u00a0of selected fields\nChange Log\nVersion\nNote\n7.7.0.0\nAdded before_fetch_query\u00c2\u00a0logic hook\nExamples\nCreating a Logic Hook using Extension Framework\n./custom/Extension/modules//Ext/LogicHooks/.php\n/before_fetch_query_class.php',\n //The class the method is in.\n 'before_fetch_query_class',\n //The method to call.\n 'before_fetch_query_method'\n );\n?>\n./custom/modules//before_fetch_query_class.php\n\nCreating a Core Logic Hook", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Module_Hooks/before_fetch_query/index.html"} {"id": "47d574635897-1", "text": "//logic\n }\n }\n?>\nCreating a Core Logic Hook\nPrior to Sugar 6.3.x, logic hooks could only be created using the following method. Please note that this approach is still valid but is not recommended when building plugins as it may conflict with existing customizations.\n./custom/modules//logic_hooks.php\n/before_fetch_query_class.php', \n //The class the method is in.\n 'logic_hooks_class', \n //The method to call.\n 'before_fetch_query_method' \n );\n?>\n./custom/modules//before_fetch_query_class.php\n\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Module_Hooks/before_fetch_query/index.html"} {"id": "88822cf2fb69-0", "text": "before_relationship_add\nOverview\nThe before_relationship_add logic hook executes before a relationship has been added between two records.\nDefinition\nfunction before_relationship_add($bean, $event, $arguments){}\nArguments\nName\nType\nDescription\nbean\nObject\nThe bean object\nevent\nString\nThe current event\narguments\nArray\nAdditional information related to the event\narguments.id\nString\nModule ID\narguments.module\nString\nModule name\narguments.related_id\nString\nRelated module ID\narguments.related_module\nString\nRelated module name\narguments.link\nString\nLink field name\narguments.relationship\nString\nRelationship name\nConsiderations\nThis hook will be executed for each side of the relationship. For example, if you add an association between an account and a contact, the hook will run for both records.\nThe arguments parameter will have additional information regarding the records being modified. The $bean variable will not contain this information.\nChange Log\nVersion\nNote\n6.4.5\nAdded before_relationship_add hook\nExamples\nCreating a Logic Hook using the Extension Framework\n./custom/Extension/modules//Ext/LogicHooks/.php\n/before_relationship_add_class.php',\n //The class the method is in.\n 'before_relationship_add_class',\n //The method to call.\n 'before_relationship_add_method'\n );\n?>\n./custom/modules//before_relationship_add_class.php\n\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Module_Hooks/before_relationship_add/index.html"} {"id": "bf0a7cd058ac-0", "text": "Application Hooks\nApplication hooks execute logic when working with the global application.\nTopicsafter_entry_pointThe after_entry_point application hook executes at the start of every request.after_load_userThe after_load_user hook executes after the current user is set for the current request. It handles actions that are dependent on the current user, such as setting ACLs or configuring user-dependent parameters.after_session_startThe after_session_start hook executes before the user's session starts, but after the user's visibility rules have been set up and the after_load_user logic hook has executed.after_ui_footerafter_ui_frameThe after_ui_frame hook executes after the frame has been invoked and before the footer has been invoked for modules in backward compatibility mode. This logic hook has been deprecated and will be removed in a future release.entry_point_variables_settingThe entry_point_variables_setting application hook executes at the start of every entry point.handle_exceptionThe handle_exception logic hook executes when an exception is thrown.server_round_tripExecutes at the end of every page.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Application_Hooks/index.html"} {"id": "a7a67f7565d6-0", "text": "after_load_user\nOverview\nThe after_load_user\u00c2\u00a0hook executes after the current user is set for the current request. It handles actions that are dependent on the current user, such as setting ACLs or configuring user-dependent parameters.\nDefinition\nfunction after_load_user($event, $arguments){}\nArguments\nName\nType\nDescription\nevent\nString\nThe current event\narguments\nArray\nAdditional information related to the event (typically empty)\nChange Log\nVersion\nNote\n6.6.0\nAdded after_load_user hook\nExample\n./custom/modules/logic_hooks.php\n\n./custom/modules/application_hooks_class.php\n\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Application_Hooks/after_load_user/index.html"} {"id": "d3db6be8bf64-0", "text": "after_ui_frame\nOverview\nThe after_ui_frame hook executes after the frame has been invoked and before the footer has been invoked for modules in backward compatibility mode.\u00c2\u00a0This logic hook has been deprecated and will be removed in a future\u00c2\u00a0release.\u00c2\u00a0\nDefinition\nfunction after_ui_frame($event, $arguments){}\nArguments\nName\nType\nDescription\nevent\nString\nThe current event\narguments\nArray\nAdditional information related to the event (typically empty)\nConsiderations\nThis hook is only applicable for modules in backward compatibility mode.\nThis hook is executed on most views such as the DetailView, EditView, and Listview.\nApplication hooks do not make use of the $bean argument.\nThis is logic hook can be used as a global reference (./custom/modules/logic_hooks.php) or as a module reference (./custom/modules//logic_hooks.php).\nChange Log\nVersion\nNote\n7.10.0.0\nDeprecated after_ui_frame hook\n5.0.0a\nAdded after_ui_frame hook\nExample\nModule-Specific Hook\nThis hook can be used at the application level for all modules or limited to specific modules. An example limiting the hook for specific modules is shown below:\n./custom/modules//logic_hooks.php\n\n./custom/modules//logic_hooks_class.php\n\nApplication Hook\nThis hook can be used at the application level for all modules or limited to specific modules. An example of executing the hook for all modules is shown below:\n./custom/modules/logic_hooks.php\n\n./custom/modules/application_hooks_class.php\n\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Application_Hooks/after_ui_frame/index.html"} {"id": "e38a379160ba-0", "text": "server_round_trip\nOverview\nExecutes at the end of every page.\nDefinition\nfunction server_round_trip($event, $arguments){}\nArguments\nName\nType\nDescription\nevent\nString\nThe current event\narguments\nArray\nAdditional information related to the event (typically empty)\nConsiderations\nThis is a global logic hook where the logic hook reference must be placed in ./custom/modules/logic_hooks.php.\nIf you are intending to write display logic to the screen, you must first wrap the display logic in an if condition to prevent breaking the Ajax page loads:if (!isset($_REQUEST[\"to_pdf\"]) || $_REQUEST[\"to_pdf\"] == false)\n{\n //display logic\n}\nThis hook is executed on all page loads.\nApplication hooks do not make use of the $bean argument.\nChange Log\nVersion\nNote\n5.0.0a\nAdded server_round_trip hook.\nExample\n./custom/modules/logic_hooks.php\n\n./custom/modules/application_hooks_class.php\n\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Application_Hooks/server_round_trip/index.html"} {"id": "8d72fbd4b300-0", "text": "after_session_start\nOverview\nThe after_session_start\u00c2\u00a0hook executes before the user's session starts, but after the user's visibility rules have been set up and the after_load_user logic hook has executed.\nDefinition\nfunction after_session_start($event, $arguments){}\nArguments\nName\nType\nDescription\nevent\nString\nThe current event\narguments\nArray\nAdditional information related to the event (typically empty)\nChange Log\nVersion\nNote\n6.4.3\nAdded after_session_start hook\nExample\n./custom/modules/logic_hooks.php\n\n./custom/modules/application_hooks_class.php\n\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Application_Hooks/after_session_start/index.html"} {"id": "e90be05c3e7e-0", "text": "handle_exception\nOverview\nThe handle_exception logic hook executes when an exception is thrown.\nDefinition\nfunction handle_exception($event, $exception){}\nArguments\nName\nType\nDescription\nevent\nString\nThe current event\nexception\nObject\nThe exception object\nConsiderations\nThis hook should not be used for any type of display output.\nYou can retrieve the exception message by using $exception->getMessage(). All exception classes extend the PHP Exceptions class.\nChange Log\nVersion\nNote\n6.4.4\nAdded handle_exception hook\nExample\n./custom/modules/logic_hooks.php\n\n./custom/modules/handle_exception_class.php\ngetMessage()\n }\n }\n?>\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Application_Hooks/handle_exception/index.html"} {"id": "0ca11f4cf755-0", "text": "after_ui_footer\n \tLast modified:", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Application_Hooks/after_ui_footer/index.html"} {"id": "4883f67075dd-0", "text": "entry_point_variables_setting\nOverview\nThe entry_point_variables_setting\u00c2\u00a0application hook executes at the start of every entry\u00c2\u00a0point.\nDefinition\nfunction entry_point_variables_setting($event, $arguments){}\nArguments\nName\nType\nDescription\nevent\nString\nThe current event\narguments\nArray\nAdditional information related to the event\u00c2\u00a0(typically\u00c2\u00a0empty)\nConsiderations\nThe entry_point_variables_setting\u00c2\u00a0hook is a global logic hook where the logic hook reference must be placed in ./custom/modules/logic_hooks.php.\nThis hook is executed at the start of every request at the end of ./include/entryPoint.php.\nThis hook\u00c2\u00a0does\u00c2\u00a0not make use of the $bean argument.\nChange Log\nVersion\nNote\n6.4.3\nAdded entry_point_variables_setting hook\nExample\n./custom/modules/logic_hooks.php\n\n./custom/modules/application_hooks_class.php\n\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Application_Hooks/entry_point_variables_setting/index.html"} {"id": "ea00b1069d6c-0", "text": "after_entry_point\nOverview\nThe after_entry_point\u00c2\u00a0application hook executes at the start of every request.\nDefinition\nfunction after_entry_point($event, $arguments){}\nArguments\nName\nType\nDescription\nevent\nString\nThe current event\narguments\nArray\nAdditional information related to the event\u00c2\u00a0(typically\u00c2\u00a0empty)\nConsiderations\nThe after_entry_point\u00c2\u00a0hook is a global logic hook where the logic hook reference must be placed in ./custom/modules/logic_hooks.php.\nThis hook is executed at the start of every request at the end of ./include/entryPoint.php.\nThis hook should not be used for any type of display output.\nThe after_entry_point\u00c2\u00a0hook is ideally used for logging or loading libraries.\nApplication hooks do not make use of the $bean argument.\nChange Log\nVersion\nNote\n6.4.3\nAdded after_entry_point hook\nExample\n./custom/modules/logic_hooks.php\n\n./custom/modules/application_hooks_class.php\n\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Logic_Hooks/Application_Hooks/after_entry_point/index.html"} {"id": "3584aebc8ef8-0", "text": "Entry Points\nOverview\nEntry points, defined in ./include/MVC/Controller/entry_point_registry.php, were\u00c2\u00a0used to ensure that proper security and authentication steps are applied consistently across the entire application. While they are still used in some areas of Sugar, any developers using custom entry points should adjust their customizations to use the latest\u00c2\u00a0REST API endpoints\u00c2\u00a0instead.\nAccessing Entry Points\nAvailable custom entry points can be accessed using a URL pattern as follows:\nhttp://{sugar url}/index.php?entryPoint={entry point name}\nThe entry point name will be the specified index in the $entry_point_registry array. Access to this entry point outside of sugar will be dependent on the auth parameter defined in the $entry_point_registry array as well.\u00c2\u00a0For more information, refer to the Creating Custom Entry Points page.\nTopicsCreating Custom Entry PointsAs of 6.3.x, entry points can be created using the extension framework. The entry point extension directory, located at ./custom/Extension/application/Ext/EntryPointRegistry/, is compiled into ./custom/application/Ext/EntryPointRegistry/entry_point_registry.ext.php after a Quick Repair and Rebuild. Additional information can be found in the extensions EntryPointRegistry section.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Entry_Points/index.html"} {"id": "7f273e415c85-0", "text": "Creating Custom Entry Points\nOverview\nAs of 6.3.x, entry points can be created using the extension framework. The entry point extension directory, located at ./custom/Extension/application/Ext/EntryPointRegistry/,\u00c2\u00a0is compiled into ./custom/application/Ext/EntryPointRegistry/entry_point_registry.ext.php after a Quick Repair and Rebuild. Additional information can be found in the extensions EntryPointRegistry section.\nCustom Entry Points\nPrior to 6.3.x, an entry point\u00c2\u00a0could be added\u00c2\u00a0by creating the file ./custom/include/MVC/Controller/entry_point_registry.php. This method of creating entry points is still compatible but is not recommended from a best practices standpoint as duplicating ./include/MVC/Controller/entry_point_registry.php to ./custom/include/MVC/Controller/entry_point_registry.php\u00c2\u00a0will prevent any upgrader updates to\u00c2\u00a0./include/MVC/Controller/entry_point_registry.php from being reflected in the system. Entry point registries contain two properties:\nfile - The path to the entry point.\nauth - A Boolean value that determines whether or not the user must be authenticated in order to access the entry point.\n$entry_point_registry['customEntryPoint'] = array(\n 'file' => 'path/to/customEntryPoint.php',\n 'auth' => true\n);\nExample\nThe first step is to create the actual entry point. This is where all of the logic for your entry point will be located. This file can be located anywhere you choose. For my example, I will create:\n./custom/customEntryPoint.php\n 'custom/customEntryPoint.php',\n 'auth' => true\n);\nFinally, navigate to Admin > Repair > Quick Repair and Rebuild. The system will then generate the file ./custom/application/Ext/EntryPointRegistry/entry_point_registry.ext.php containing your registry entry. We are now able to access our entry point by navigating to:\nhttp://{sugar url}/index.php?entryPoint=customEntryPoint\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Entry_Points/Creating_Custom_Entry_Points/index.html"} {"id": "0fec96e0fe0f-0", "text": "Shortcuts\nOverview\nShortcuts is\u00c2\u00a0a framework to add shortcut keys to the application. When shortcut keys are registered, they are registered to a particular shortcut session. Shortcut sessions group shortcut keys, and they can be activated, deactivated, saved, and restored. Global shortcut keys can be registered, but they are not tied to a particular shortcut session. They are rather applied everywhere in the application and can only be applied once.\nThe Shortcut framework is implemented on top of Mousetrap library.\nShortcut Sessions\nIn order to register a shortcut in Sugar, a shortcut session must first be created by adding ShortcutSession plugin to the top-level layout JavaScript controller.\nplugins: ['ShortcutSession']\nThen, the top-level layout needs to list which shortcuts are allowed in the shortcut session. Shortcuts\u00c2\u00a0can be listed in the top-level layout JavaScript controller :\n./custom/clients/layout/my-layout/my-layout.js\nshortcuts: [\n 'Sidebar:Toggle',\n 'Record:Save',\n 'Record:Cancel',\n 'Record:Action:More'\n]\nShortcuts can also be listed in the metadata :\n./custom/clients/layout/my-layout/my-layout.php\n'shortcuts' => array(\n 'Sidebar:Toggle',\n 'Record:Save',\n 'Record:Cancel',\n 'Record:Action:More'\n),\nRegister\nOnce a shortcut session is created, shortcut keys can be registered by adding the following in your JavaScript code :\napp.shortcuts.register('', '', , , );\nSince shortcut keys should only be registered once in your component, they should be registered inside initialize() or someplace where re-rendering the component would not register more than once.\nShortcut IDs", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Shortcuts/index.html"} {"id": "0fec96e0fe0f-1", "text": "Shortcut IDs\nShortcut IDs should be unique across the application. They should be namespaced by convention, for example Record:Next, Sidebar:Toggle, List:Edit. If the namespace starts with Global:, it assumes that the shortcut is global.\nGlobal shortcuts\nGlobal shortcuts are shortcut keys that are applied once and are available everywhere in the application.\napp.shortcuts.register(app.shortcuts.GLOBAL + 'Footer:Help', '?', function() {}, this, false);\nShortcut Keys\nThere are only certain keys that are\u00c2\u00a0supported under the Shortcut framework. The following keyboard keys can be used :\u00c2\u00a0\nAll alphanumeric characters and symbols\nshift, ctrl, alt, option, meta, command\nbackspace, tab, enter, return, capslock, esc, escape, space, pageup, pagedown, end, home, ins, del\nleft, up, right, down\nAdditional Features\nIn addition to standard keys, the Shortcut framework also supports some additional features :\nKey combinations\u00c2\u00a0: 'ctrl+s'\nMultiple keys\u00c2\u00a0: ['ctrl+a', 'command+a']\nKey sequences\u00c2\u00a0: 'f a'\nInput Focus\nThe fifth parameter in the register method specifies whether or not the shortcut key should be fired when the user is focused in an input field. It is false by default.\napp.shortcuts.register('Record:Save', ['ctrl+s','command+s'], function() {}, this, true);\nLimitations\nShortcut keys do not work on side panels, like dashboards and previews.\nShortcuts Help\nAnytime a new shortcut is created, a help text should be provided in ./clients/base/layouts/shortcuts/shortcuts.php with a shortcut ID and a language string.\n'List:Favorite' => 'LBL_SHORTCUT_FAVORITE_RECORD',\nShortcuts help is displayed when Shortcuts button is clicked.\nAdvanced Features\nEnable/disable dynamically", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Shortcuts/index.html"} {"id": "0fec96e0fe0f-2", "text": "Shortcuts help is displayed when Shortcuts button is clicked.\nAdvanced Features\nEnable/disable dynamically\nShortcuts feature can be enabled and disabled dynamically via code by calling app.shortcuts.enable() and app.shortcuts.disable().\nDynamically saving, creating new, and restoring sessions\nA new shortcut session is created when a user visits a top-level layout with ShortcutSession plugin. A new session can be created dynamically:\napp.shortcuts.createSession(, );\nBut before creating a new session, the current session should be saved first.\napp.shortcuts.saveSession();\napp.shortcuts.createSession(, );\nOnce a new session is created, shortcut keys can be registered to it. When the need for the session is done, the previous shortcut session can be restored.\napp.shortcuts.restoreSession();\nExample\nThe following example will be\u00c2\u00a0to add some custom shortcuts onto a custom layout. For more information on how to create a custom layout, please refer to the Creating Layouts documentation.\nFirst, on our custom JavaScript controller for our layout, we must enable the ShortcutSession plugin as well as list the shortcuts we will be enabling :\n./custom/clients/base/layouts/my-layout/my-layout.js\n({\n plugins: ['ShortcutSession'],\n shortcuts: [\n 'Global:MyLayout:MyCallback',\n ],\n})\nNext, on the custom view being rendered on our layout, we will register the new shortcuts as well as define a callback method :\u00c2\u00a0\n./custom/clients/base/views/my-view/my-view.js\n...\ninitialize: function(options){\n this._super('initialize', [options]);\n // call myCallback method when command + a is pressed\n app.shortcuts.register(app.shortcuts.GLOBAL + 'MyLayout:MyCallback', 'command+a', this.myCallback, this, false);", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Shortcuts/index.html"} {"id": "0fec96e0fe0f-3", "text": "app.shortcuts.saveSession();\n app.shortcuts.createSession([\n 'MyLayout:InlineCall'\n ], this);\n // call inline code when control + m or command + m is pressed\n app.shortcuts.register('MyLayout:InlineCall', ['ctrl+m','command+m'], function() {\n\t\tconsole.log(\"Ctrl or Command m has been pressed\");\n }, this, false);\n},\nmyCallback: function(){\n console.log(\"MyCallback called from Command a\");\n},\n...\nThe last step will be to create a new label for our shortcut help text and register the help so it displays when \"Shortcuts\" is click in the footer of the page :\n./custom/Extension/application/Ext/Language/en_us.LBL_MYLAYOUT_SHORTCUT_HELP.php\n Repair > Quick Repair and Rebuild. The system will then rebuild the extensions and add the new shortcut to the custom layout.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Shortcuts/index.html"} {"id": "3d98ccab8432-0", "text": "Autoloader\nOverview\nThe autoloader is an API that allows the unified handling of customizations and customizable metadata while reducing the number of filesystem accesses and improving performance.\nSugarAutoLoader\nThe SugarAutoLoader class, located in ./include/utils/autoloader.php, keeps a map of files within the Sugar directory that may be loaded.\nIncluded File Extensions\nThe autoloader will only map files with the following extensions:\nbmp\ncss\ngif\nhbs\nhtml\nico\njpg\njs\nless\noverride\nphp\npng\ntif\ntpl\nxml\n*All other file extensions are excluded from the mapping.\nClass Loading Directories\nThe autoloader will scan and autoload classes in the following directories:\n./clients/base/api/\n./data/duplicatecheck/\n./data/Relationships/\n./data/visibility/\n./include/\n./include/api/\n./include/CalendarEvents/\n./include/SugarSearchEngine/\n./modules/Calendar/\n./modules/Mailer/\nIgnored Directories\nThe following directories in Sugar are ignored by the autoloader mapping:\n./.idea/\n./cache/\n./custom/backup/\n./custom/blowfish/\n./custom/Extension/\n./custom/history/\n./custom/modulebuilder/\n./docs/\n./examples/\n./portal/\n./tests/\n./upload/\n./vendor/bin/\n./vendor/HTMLPurifier/\n./vendor/log4php/\n./vendor/nusoap/\n./vendor/pclzip/\n./vendor/reCaptcha/\n./vendor/ytree/\n\u00c2", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Autoloader/index.html"} {"id": "3d98ccab8432-1", "text": "./vendor/reCaptcha/\n./vendor/ytree/\n\u00c2\u00a0\nTopicsConfiguration APIMethods to configure loading paths for the AutoLoader API.File Check APIFile check methods for use with the AutoLoader API.File Map Modification APIMethods to modify files in the AutoLoader API. All the functions below return true on success and false on failure.Metadata APIMethods to load metadata for the AutoLoader API.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Autoloader/index.html"} {"id": "1a87c4d45a0c-0", "text": "File Check API\nOverview\nFile check methods for use with the AutoLoader API.\nexisting(...)\nReturns an array of filenames that exist in the file map. Accepts any number of arguments of which can be filename or array of filenames. If no files exist, empty array is returned. \n$files = SugarAutoloader::existing('include/utils.php', 'include/TimeDate.php');\nexistingCustom(...)\nThis method accepts any number of arguments, each of which can be filename or array of filenames. It will return an array of filenames that exist in the file map, adding also files that exist when custom/ is prepended to them. If the original\n filename already had custom/ prefix, it is not prepended again. custom/ files are added to the list after the root directory files so that if included in order, they will override the data of the root file. If no files exist, empty array is\n returned. \n$files = SugarAutoloader::existingCustom('include/utils.php', 'include/TimeDate.php');\nexistingCustomOne(...)\nReturns the last file of the result returned by existingCustom(), or null if none exist. Accepts any number of arguments of which can be filename or array of filenames. Since customized files are placed after the root files, it will return customized file if exists, otherwise root file.\n \n$files = SugarAutoloader::existingCustomOne('include/utils.php');\nYou should note that the existingCustomOne() method can be used for loading inline PHP files. An example is shown below: \nforeach(SugarAutoLoader::existingCustomOne('custom/myFile.php') as $file)\n{\n include $file;\n}\nAlternative to including inline PHP files, loading class files should be done using requireWithCustom() .\nfileExists($filename)", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Autoloader/File_Check_API/index.html"} {"id": "1a87c4d45a0c-1", "text": "fileExists($filename)\nChecks if a file exists in the file map. You should note that \"..\" is not supported by this function and any paths including \"..\" will return false. The path components should be separated by /.\n You should also note that multiple slashes are compressed and treated as single slash.\n$file = 'include/utils.php';\nif (SugarAutoloader::fileExists($file))\n{\n require_once($file);\n}\ngetDirFiles($dir, $get_dirs = false, $extension = null)\nRetrieves the list of files existing in the file map under the specified directory. If no files are found, the method will return an empty array. By default, the method will return file paths, however, If $get_dirs is set to true, the method will\n return only directories. If $extension is set, it would return only files having that specific extension.\n \n$files = SugarAutoloader::getDirFiles('include');\ngetFilesCustom($dir, $get_dirs = false, $extension = null)\nRetrieves the list of files existing in the file map under the specified directory and under it's custom/ path. If no files are found it will return empty array. By default, the method will return file paths, however, If $get_dirs is set to true,\n the method will return only directories. If $extension is set, it would return only files having that specific extension.\n \n$files = SugarAutoloader::getFilesCustom('include');\nlookupFile($paths, $file)\nLooks up a file in the list of given paths, including with and without custom/ prefix, and return the first match found. The custom/ directory is checked before root files. If no file is found, the method will return false. \n$paths = array(\n 'include',", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Autoloader/File_Check_API/index.html"} {"id": "1a87c4d45a0c-2", "text": "$paths = array(\n 'include',\n 'modules',\n);\n$files = SugarAutoloader::lookupFile($paths, 'utils.php');\nrequireWithCustom($file, $both = false)\nIf a custom/ override of the file or the file exist, require_once it and return true, otherwise return false. If $both is set to true, both files are required with the root file being first and custom/ file being second. Unlike other functions,\n this function will actually include the file. \n$file = SugarAutoloader::requireWithCustom('include/utils.php');\nYou should note that the requireWithCustom() method should be used for loading class files and not inline PHP files. Inline PHP files should be loaded using the existingCustomOne() \n method.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Autoloader/File_Check_API/index.html"} {"id": "52b0f92c887f-0", "text": "File Map Modification API\nOverview\nMethods to modify files in the AutoLoader API. All the functions below return true on success and false on failure.\naddToMap($filename, $save = true)\nAdds an existing file to the file map. If $save is true, the new map will be saved to the disk file map, otherwise, it will persist only until the end of the request. This method does not create the file on the filesystem.\nSugarAutoloader::addToMap('custom/myFile.php');\ndelFromMap($filename, $save = true)\nRemoves a file from the file map. If $filename points to a directory, this directory and all files under it are removed from the map. If $save is true, the new map will be saved to the disk file map, otherwise, it will persist only until the end of the request. This method does not delete the file from the filesystem.\nSugarAutoloader::delFromMap('custom/myFile.php');\nput($filename, $data, $save = false)\nSaves data to a file on the filesystem and adds it to the file map. If $save is true, the new map will be saved to the disk file map, otherwise, it will persist only until the end of the request.\n$file = 'custom/myFile.php';\nSugarAutoloader::touch($file, true);\nSugarAutoloader::put($file, '', true);\ntouch($filename, $save = false)\nCreates the specified file on the filesystem and adds it to the file map. If $save is true, the new map will be saved to the disk file map, otherwise, it will persist only until the end of the request.\nSugarAutoloader::touch('custom/myFile.php', true);\nunlink($filename, $save = false)", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Autoloader/File_Map_Modification_API/index.html"} {"id": "52b0f92c887f-1", "text": "unlink($filename, $save = false)\nRemoves the specified file from the filesystem and from the\u00c2\u00a0current file map. If $save is true, the new map will be saved to the disk file map, otherwise, it will persist only until the end of the request.\nSugarAutoloader::unlink('custom/myFile.php', true);\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Autoloader/File_Map_Modification_API/index.html"} {"id": "13a51e6a8435-0", "text": "Metadata API\nOverview\nMethods to load metadata for the AutoLoader API.\nMetadata Loading\nFor the specific sets of metadata, such as detailviewdefs, editviewefs, listviewdefs, searchdefs, popupdefs, and searchfields, a special process is used to load the correct metadata file. You should note that the variable name for the defs, e.g. \"detailviewdefs\", is usually the same as variable name, except in the case of \"searchfields\" where it is \"SearchFields\".\nThe process is described below:\nIf ./custom/modules/{$module}/metadata/{$varname}.php exists, it is used as the data file.\nIf ./modules/{$module}/metadata/metafiles.php or ./custom/modules/{$module}/metadata/metafiles.php exists, it is loaded with the custom file being preferred. If the variable name exists in the data specified by the metafile, the corresponding filename is assumed to be the defs file name.\nIf the defs file name or its custom/ override exists, it is used as the data file (custom one is preferred).\nIf no file has been found yet, ./modules/{$module}/metadata/{$varname}.php is checked and if existing, it is used as the data file.\nOtherwise, no metadata file is used.\nloadWithMetafiles($module, $varname)\nReturns the specified metadata file for a specific module. You should note that due to the scope nature of include(), this function does not load the actual metadata file but will return the file name that should be loaded by the caller.\n$metadataPath = SugarAutoloader::loadWithMetafiles('Accounts', 'editviewdefs');\nloadPopupMeta($module, $metadata = null)\nLoads popup metadata for either specified $metadata variable or \"popupdefs\" variable via loadWithMetafiles() and returns it. If no metadata found returns empty array.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Autoloader/Metadata_API/index.html"} {"id": "13a51e6a8435-1", "text": "$popupMetadata = SugarAutoloader::loadPopupMeta('Accounts');\nloadExtension($extname, $module = \"application\")\nReturns the extension path given the extension name and module. For global extensions, the module should be \"application\" and may be omitted. If the extension has its own module, such as schedulers, it will be used instead of the $module parameter. You should note that due to the scope nature of include(), this function does not load the actual metadata file but return the file name that should be loaded by the caller. If no extension file exists it will return false.\n//The list of extensions can be found in ./ModuleInstall/extensions.php\n$extensionPath = SugarAutoloader::loadExtension('logichooks');\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Autoloader/Metadata_API/index.html"} {"id": "37ff79c29ad8-0", "text": "Configuration API\nOverview\nMethods to configure loading paths for the AutoLoader API.\naddDirectory($dir)\nAdds a directory to the directory map for loading classes. Directories added should include a trailing \"/\".\nSugarAutoloader::addDirectory('relative/file/path/');\naddPrefixDirectory($prefix, $dir)\nAdds a prefix and directory to the $prefixMap for loading classes by prefix.\nSugarAutoloader::addPrefixDirectory('myPrefix', 'relative/file/path/');\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Autoloader/Configuration_API/index.html"} {"id": "2bed4a683c7b-0", "text": "Email Addresses\nOverview\nRecommended approaches when working with email addresses in Sugar.\nClient Side\nRecommended approaches when accessing email addresses in Sugar from a client.\nSidecar\nSidecar is the JavaScript UI framework that users interact within their browsers.\nFetching Email Addresses in Sidecar\nIn Sidecar, the email field will return an array of email addresses and their properties for the record. Given the model, you can fetch it using:\nvar emailAddresses = model.get('email');\nNote:\u00c2\u00a0In the past, developers could use\u00c2\u00a0model.get(\"email1\") to fetch the primary email address. While this currently does work,\u00c2\u00a0these legacy email fields are\u00c2\u00a0deprecated\u00c2\u00a0and may be subject to removal in an upcoming Sugar release.\nFetching a Primary Email Address in Sidecar\nTo fetch the primary email address for a bean, you can use app.utils.getPrimaryEmailAddress():\nvar primaryEmailAddress = app.utils.getPrimaryEmailAddress(model);\nFetching an Email Address by Properties in Sidecar\nTo fetch an email address based on properties such as invalid_email, you can use app.utils.getEmailAddress(). This function will return the first email address that matches the options or an empty string if not found. An example is shown below:\nvar emailAddress = app.utils.getEmailAddress(model, {invalid_email: true});\nIf you have complex filtering rules, you can use _.find() to fetch an email address:\nvar emailAddress = _.find(model.get('email'), function(emailAddress){ \n if (emailAddress.invalid_email == true) {\n return emailAddress;\n }\n});\nValidating Email Addresses in Sidecar\nTo validate an email address, you can use app.utils.isValidEmailAddress():\nvar isValid = app.utils.isValidEmailAddress(emailAddress);", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Email_Addresses/index.html"} {"id": "2bed4a683c7b-1", "text": "var isValid = app.utils.isValidEmailAddress(emailAddress);\nNote: This function is more permissive and does not conform exactly to the RFC standards used on the server. As such, the\u00c2\u00a0email address\u00c2\u00a0will be validated again on the\u00c2\u00a0server\u00c2\u00a0when the\u00c2\u00a0record is saved, which could still fail validation.\u00c2\u00a0More information can be found in the email address validation section.\nIterating Email Address in Sidecar\nTo iterate through email addresses on a model, you can use _.each():\n_.each(model.get('email'), function(emailAddress) {\n console.log(emailAddress.email_address);\n});\nUpdating Email Addresses in Sidecar\nThis section covers how to manipulate the email addresses for a model.\nAdding Email Addresses in Sidecar\nIn Sidecar, you can add email addresses to a model using the custom function below:\nfunction addAddress(model, email) {\n var existingAddresses = model.get('email') ? app.utils.deepCopy(model.get('email')) : [],\n dupeAddress = _.find(existingAddresses, function(address){\n return (address.email_address === email);\n }),\n success = false;\n if (_.isUndefined(dupeAddress)) {\n existingAddresses.push({\n email_address: email,\n primary_address: (existingAddresses.length === 0),\n opt_out: app.config.newEmailAddressesOptedOut || false\n });\n model.set('email', existingAddresses);\n success = true;\n }\n return success;\n}\nRemoving Email Addresses in Sidecar\nIn Sidecar, you can remove email addresses from a model using the custom function below:\nfunction removeAddress(model, email) {\n var existingAddresses = app.utils.deepCopy(model.get('email'));\n var index = false;\n _.find(existingAddresses, function(emailAddress, idx){", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Email_Addresses/index.html"} {"id": "2bed4a683c7b-2", "text": "_.find(existingAddresses, function(emailAddress, idx){ \n if (emailAddress.email_address === email) {\n index = idx;\n return true;\n }\n });\n var primaryAddressRemoved = false;\n if (index !== false) {\n primaryAddressRemoved = !!existingAddresses[index]['primary_address'];\n }\n //Reject this index from existing addresses\n existingAddresses = _.reject(existingAddresses, function (emailInfo, i) { return i == index; });\n // If a removed address was the primary email, we still need at least one address to be set as the primary email\n if (primaryAddressRemoved) {\n //Let's pick the first one\n var address = _.first(existingAddresses);\n if (address) {\n address.primary_address = true;\n }\n }\n model.set('email', existingAddresses);\n return primaryAddressRemoved;\n}\nServer Side\nRecommended approaches when accessing email addresses in Sugar from the server.\nSugarBean\nThe SugarBean is Sugars PHP core object model.\nFetching Email Addresses Using the SugarBean\nUsing the SugarBean, the $bean->emailAddress->addresses\u00c2\u00a0property will return an array of email addresses and its properties. The\u00c2\u00a0$bean->emailAddress\u00c2\u00a0property makes use of the EmailAddress class which is located in\u00c2\u00a0./modules/EmailAddresses/EmailAddress.php. An example is shown below:\n$emailAddresses = $bean->emailAddress->addresses;\nFetching a Primary Email Address Using the SugarBean\nTo fetch the primary email address for a bean, you can use $bean->emailAddress->getPrimaryAddress():\n$primaryEmailAddress = $bean->emailAddress->getPrimaryAddress($bean);\nAnother alternative is to use the\u00c2\u00a0email_addresses_primary relationship:\n$primaryEmailAddress = false;", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Email_Addresses/index.html"} {"id": "2bed4a683c7b-3", "text": "$primaryEmailAddress = false;\nif ($this->load_relationship('email_addresses_primary')) {\n $relatedBeans = $this->email_addresses_primary->getBeans();\n if (!empty($relatedBeans)) {\n $primaryEmailAddress = current($relatedBeans);\n }\n}\nYou may also choose to iterate the email address list with a foreach(). An example function is shown below:\nfunction getPrimaryEmailAddress($bean)\n{\n foreach ($bean->emailAddress->addresses as $emailAddress) {\n if ($emailAddress['primary_address'] == true) {\n return $emailAddress;\n }\n }\n return false;\n}\nFetching an Email Address by Properties Using the SugarBean\nTo fetch an email address based on properties such as invalid_email, you can use a foreach():\n$result = false;\nforeach ($bean->emailAddress->addresses as $emailAddress) {\n if ($emailAddress['invalid_email']) {\n $result = $emailAddress;\n break;\n }\n}\nValidating Email Addresses Using the SugarBean\nTo validate an email address, you can use $bean->emailAddress->isValidEmail():\n$isValid = $bean->emailAddress->isValidEmail($emailAddress);\nNote: The\u00c2\u00a0EmailAddress::isValidEmail method leverages the PHPMailer library bundled with Sugar, specifically the PHPMailer::validateAddress method, which validates the address\u00c2\u00a0according to the\u00c2\u00a0RFC 5321\u00c2\u00a0and RFC 5322 standards. More information can be found in the email address validation section.\nIterating Email Addresses Using the SugarBean\nTo iterate through email addresses on a bean, you can use foreach():\nforeach ($bean->emailAddress->addresses as $emailAddress) {\n $GLOBALS['log']->info($emailAddress['email_address']);\n}\nFetching Beans by Email Address Using the SugarBean", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Email_Addresses/index.html"} {"id": "2bed4a683c7b-4", "text": "}\nFetching Beans by Email Address Using the SugarBean\nTo fetch all beans related to an email address you can use\u00c2\u00a0getBeansByEmailAddress():\n$beans = $bean->emailAddress->getBeansByEmailAddress($emailAddress);\nIf you don't have a bean available, you may choose to create a new EmailAddress object:\n$sea = BeanFactory::newBean('EmailAddresses');\n$sea->getBeansByEmailAddress($emailAddress);\nUpdating Email Addresses Using the SugarBean\nThis section covers how to manipulate the email addresses for a bean.\nAdding Email Addresses Using the SugarBean\nTo add an email address to the bean, you can use\u00c2\u00a0$bean->emailAddress->addAddress():\n$bean->emailAddress->addAddress('address@sugar.crm');\nNote: The addAddress() function has additional parameters that are defaulted for determining if the email address is a primary, reply to, invalid, or opted out email address. You can also specify an id for the email address and whether or not the email address should be validated.\nfunction addAddress($addr, $primary=false, $replyTo=false, $invalid=false, $optOut=false, $email_id = null, $validate = true)\nRemoving Email Addresses Using the SugarBean\nTo remove an email address you can use $bean->emailAddress->removeAddress():\n$bean->emailAddress->removeAddress('address@sugar.crm');\nPDF Templates\nUsing the Sugar PDF templates, you can reference the primary email address of the bean using:\n{$fields.email_addresses_primary.email_address}\nREST API\nSugar comes out of the box with an API that can be called from custom applications utilizing the REST interface. The API can be used to mass create and update records in Sugar with external data. For more information on the REST API in Sugar, please refer to the Web Services documentation.\nCreating Email Addresses Using the REST API", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Email_Addresses/index.html"} {"id": "2bed4a683c7b-5", "text": "Creating Email Addresses Using the REST API\nWhen creating records in Sugar through the API, modules with relationships to email addresses can utilize the email link field to specify email addresses for a record. Using the email link field, you can specify multiple email addresses to assign to the record. You may specify the following additional information regarding each email address being added:\nProperty\nDescription\ninvalid_email\nSpecify this email address as being invalid\nopt_out\nSpecify this email address as being opted out. More information on opt-outs can be found in the Emails documentation.\nprimary_address\nSpecify this email address as the primary\nUsing the /\u00c2\u00a0POST endpoint, you can send the following JSON payload to create a contact record with multiple email addresses using the email link field: POST URL: http:///rest/v/Contacts\n{\n \"first_name\":\"Rob\",\n \"last_name\":\"Robertson\",\n \"email\":[\n {\n \"email_address\":\"rob.robertson@sugar.crm\",\n \"primary_address\":\"1\",\n \"invalid_email\":\"0\",\n \"opt_out\":\"0\"\n },\n {\n \"email_address\":\"rob@sugar.crm\",\n \"primary_address\":\"0\",\n \"invalid_email\":\"0\",\n \"opt_out\":\"1\"\n }\n ]\n}\nFor more information on the //:record POST endpoint, you can refer to your instance's help documentation found at:\nhttp:///rest/v/help\nOr you can reference the POST PHP example.\nUpdating Email Addresses Using the REST API", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Email_Addresses/index.html"} {"id": "2bed4a683c7b-6", "text": "Updating Email Addresses Using the REST API\nWhen updating existing records in Sugar through the API, modules with relationships to email addresses can use the email link field to specify email addresses for a record. Using the email link field, you can specify multiple email addresses to update the record with. You may specify the following additional information regarding each email address being added:\ninvalid_email : Specify this email address as being invalid\nopt_out : Specify this email address as being opted out\nprimary_address : Specify this email address as the primary\nUsing the //:record PUT endpoint, you can send the following JSON payload to update a contact record with multiple email addresses: PUT URL: http:///rest/v/Contacts/\n{\n \"email\":[\n {\n \"email_address\":\"rob.robertson@sugar.crm\",\n \"primary_address\":\"1\",\n \"invalid_email\":\"0\",\n \"opt_out\":\"0\"\n },\n {\n \"email_address\":\"rob@sugar.crm\",\n \"primary_address\":\"0\",\n \"invalid_email\":\"0\",\n \"opt_out\":\"1\"\n }\n ]\n}\nFor more information on the //:record PUT endpoint, you can refer to your instance's help documentation found at:\nhttp:///rest/v/help\nYou want to reference the /:record PUT PHP example.\nLegacy Email Fields\nThe legacy email fields in Sugar\u00c2\u00a0are\u00c2\u00a0deprecated\u00c2\u00a0and may be subject to removal in an upcoming Sugar release. When using the email1 field, the default functionality is to import the email address specified as the primary address.\nLegacy Email Field\nDescription\nemail1\nThe text value of primary email address. Does not indicate if the email address is valid or opted-out.\nemail2", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Email_Addresses/index.html"} {"id": "2bed4a683c7b-7", "text": "email2\nThe text value of first non-primary email address. Does not indicate if the email address is valid or opted-out.\nNote: For importing multiple email addresses with properties, you will need to use the email link field.\nCreating Email Addresses Using Direct SQL\nWhen importing records into Sugar directly via the database, it is important that you understand the data structure involved before loading data. Email addresses are not stored directly on the table for the module being imported in but are related via the email_addr_bean_rel table.\nThe table structure for email addresses can be seen from the database via the following SQL statement:\nSELECT\n email_addr_bean_rel.bean_id,\n email_addr_bean_rel.bean_module,\n email_addresses.email_address\nFROM email_addr_bean_rel\nINNER JOIN email_addresses\n ON email_addresses.id = email_addr_bean_rel.email_address_id\n AND email_addr_bean_rel.deleted = 0\nWHERE email_addresses.deleted = 0;\nChecking for Duplicates\nEmail addresses can become duplicated in Sugar from a variety of sources including API calls, imports, and from data entry. There are a few ways to have the system check for duplicate contact records, but not many of those methods work for checking email addresses for duplicates. The following section will demonstrate how to find and clean up duplicate email addresses using SQL.\nThe following SQL query can be used to locate if any email addresses are being used against more than one bean record within Sugar:\nSELECT\n email_addresses.email_address,\n COUNT(*) AS email_address_count\nFROM email_addr_bean_rel\nINNER JOIN email_addresses\n ON email_addresses.id = email_addr_bean_rel.email_address_id\n AND email_addr_bean_rel.deleted = 0\nWHERE email_addresses.deleted = 0\nGROUP BY email_addresses.email_address\nHAVING COUNT(*) > 1;", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Email_Addresses/index.html"} {"id": "2bed4a683c7b-8", "text": "GROUP BY email_addresses.email_address\nHAVING COUNT(*) > 1;\nNote: If you convert a Lead record to a Contact record, both the Lead and the Contact will be related to the same Email Address and will return as having duplicates in this query. You can add the following line to the WHERE clause to filter the duplicate check down to only one bean type:\nAND email_addr_bean_rel.bean_module = 'Contacts'\nEmail addresses can not only be\u00c2\u00a0duplicated in the system but can occasionally be missing critical data. Each bean record with an email address assigned to it\u00c2\u00a0should have an email address designated the primary. The following query will locate any bean records that have at least one email address, where there is not an email address designated as the primary:\nSELECT\n email_addr_bean_rel.bean_module,\n email_addr_bean_rel.bean_id,\n COUNT(*) AS email_count,\n COUNT(primary_email_addr_bean_rel.id) AS primary_email_count\nFROM email_addr_bean_rel\nLEFT JOIN email_addr_bean_rel primary_email_addr_bean_rel\n ON primary_email_addr_bean_rel.bean_module = email_addr_bean_rel.bean_module\n AND primary_email_addr_bean_rel.bean_id = email_addr_bean_rel.bean_id\n AND primary_email_addr_bean_rel.primary_address = '1'\n AND primary_email_addr_bean_rel.deleted = '0'\nWHERE email_addr_bean_rel.deleted = '0'\nGROUP BY email_addr_bean_rel.bean_module,\n email_addr_bean_rel.bean_id\nHAVING primary_email_count < 1;\nNote: If you are a SugarCloud customer, you can open up a case with Sugar Support to have this query run for you.\nRemoving Duplicates\nIf it is determined you have duplicate email addresses being used in your system, you can use the following query to clean up the records:\nSTART TRANSACTION;\nCREATE", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Email_Addresses/index.html"} {"id": "2bed4a683c7b-9", "text": "START TRANSACTION;\nCREATE \n TABLE email_addr_bean_rel_tmp\nSELECT\n *\nFROM email_addr_bean_rel\nWHERE deleted = '0'\nGROUP BY email_address_id,\n bean_module,\n bean_id\nORDER BY primary_address DESC;\nTRUNCATE TABLE email_addr_bean_rel;\nINSERT INTO email_addr_bean_rel\n SELECT\n *\n FROM email_addr_bean_rel_tmp;\nSELECT\n COUNT(*) AS repetitions,\n date_modified,\n bean_id,\n bean_module\nFROM email_addr_bean_rel\nWHERE deleted = '0'\nGROUP BY bean_id,\n bean_module,\n email_address_id\nHAVING repetitions > 1;\nCOMMIT;\nNote: If you are a SugarCloud customer, you can open up a case with Sugar Support to have this query run for you.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Email_Addresses/index.html"} {"id": "032ec26b25b8-0", "text": "Tags\nOverview\nThe tagging feature allows a user to apply as many \"tags\" as they choose on any record they want to categorize. This allows the user to effectively group records together from any source within the application and relate them together. Please note that the tag field and Tags module do not support customization at this time.\nThe Tags Module\nThe Tags module is a very simple module based on the Basic SugarObject template. It is not studio editable, is part of the default module list, and is available to the application upon installation. By default, the Tags module is set up such that only an Administrator can perform any administrative tasks with the Tags module. In other words, a regular user will have a very restrictive set of permissions inside the Tags module, namely: create, export, view, and share. All other actions within the Tags modules must be carried out by an Administrative user.\nThe \"tag\" Field Type\nThe back end utilizes two new field types: the relatecollection field and the tag field. The tag field is a relatecollection type field with a few added enhancements specific to the tagging implementation:\nEnforces uniqueness of a tag when created\nEstablishes the necessary relationship between the Tags module and the module record being tagged\nCollects and formats a tag collection in a way the client understands\nFormat the tag field for consumption by and from the import process\nHandles proper query setting for a search that is filtered by tags\nThe Taggable Implementation\nThe taggable implementation is applied to all SugarObject templates so that it is available on all custom modules created and is also applied to all sidecar enabled modules. Any module that implements a SugarObject template\u00c2\u00a0will be taggable by default. Any module that doesn't implement a SugarObject template can easily apply it using the uses property of the module vardefs:\n$dictionary[$module] = array(\n ...\n 'uses' => array(\n 'taggable',\n ),", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Tags/index.html"} {"id": "032ec26b25b8-1", "text": "...\n 'uses' => array(\n 'taggable',\n ),\n ...\n);\nThere may be instances where a module should not implement tagging yet implements\u00c2\u00a0the SugarObject template. To remove tagging from a module you can use the module vardefs ignore_templates property:\n$dictionary[$module] = array(\n ...\n 'ignore_templates' => array(\n 'taggable',\n ),\n ...\n);\nThe Tagging Relationship Structure\nThe tagging relationship schema is similar in nature to the email_addresses relationship schema in that it is used to represent a collection of 0-N Tags module records related to a module:\nColumn\nDescription\nid\nThe GUID for the relationship between the tag record and the module record\ntag_id\nThe id of the tag record used in this relationship\nbean_id\nThe id of the module record used in this relationship\nbean_module\nThe module for the record being tagged\ndate_modified\nThe date the relationship was created/modified\ndeleted\nA tinyint(1) boolean value that indicates whether this relationship is deleted\nTagging in Action\nFor adding tags from the UI, please refer to the Tags documentation.\nTagging Records from the API\nTagging a record via the API\u00c2\u00a0is done by sending a\u00c2\u00a0PUT request to the //\u00c2\u00a0API endpoint with a tag property set to an array of key/value pairs that include a tag id (optional) and a tag name:\n{\n \"name\": \"Record Name\",\n \"tag\": [\n {\"id\": \"Test Tag\", \"name\": \"Test Tag\"},\n {\"name\": \"Test Tag 2\"},\n {\"id\": \"1234-56-7890\", \"name\": \"Test Tag 3\"}\n ]\n}", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Tags/index.html"} {"id": "032ec26b25b8-2", "text": "]\n}\nAfter the record is created/modified and the tag values are applied, the response will contain the returned collection of tags for that record complete with their ids:\n{\n \"name\": \"Record Name\",\n \"tag\": [\n {\"id\": \"9876-54-3210\", \"name\": \"Test Tag\"},\n {\"id\": \"4321-56-0987\", \"name\": \"Test Tag 2\"},\n {\"id\": \"1234-56-7890\", \"name\": \"Test Tag 3\"}\n ]\n}\nYou can visit\u00c2\u00a0How to Manipulate Tags (CRUD)\u00c2\u00a0for a full example demonstrating\u00c2\u00a0CRUD actions for tags.\nMass Updating Tags on Records Via the API\nMass updating records with tags are as simple as sending a MassUpdate PUT request to //MassUpdate\u00c2\u00a0with a payload similar to:\n{\n \"massupdate_params\": {\n \"uid\": [\"12345-67890\", \"09876-54321\"],\n \"tag\": [\n { \"id\": \"23456-78901\", \"name\": \"MyTag1\" },\n { \"id\": \"34567-89012\", \"name\": \"MyTag2\" }\n ]\n }\n}\nThis request will override all existing tags on the named records. To append tags to a record, send the \"tag_type\" request argument set to a value of 1:\n{\n \"massupdate_params\": {\n \"uid\": [\"12345-67890\", \"09876-54321\"],\n \"tag\": [\n { \"id\": \"23456-78901\", \"name\": \"MyTag1\" },\n { \"id\": \"34567-89012\", \"name\": \"MyTag2\" }", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Tags/index.html"} {"id": "032ec26b25b8-3", "text": "],\n \"tag_type\": \"1\"\n }\n}\nMore information on this API endpoint can be found in the //MassUpdate PUT documentation.\nFetching Tags on a Record\nBy default, the tag field is added to all Sidecar module record views. That means when a request is made for a single record through the API, that single record will return the \"tag\" field, which will be a collection of key:value pair objects.\nFor example, when a request is made to the /Accounts/:record GET endpoint, the tags associated with the Accountrecord\u00c2\u00a0 will be returned in the tag field as an array of objects:\n{\n \"id\": \"\",\n \"name\": \"Record Name\",\n \"tag\": [\n { \"id\": \"9876-54-3210\", \"name\": \"Test Tag\" },\n { \"id\": \"4321-56-0987\", \"name\": \"Test Tag 2\" },\n { \"id\": \"1234-56-7890\", \"name\": \"Test Tag 3\" }\n ]\n}\nFiltering a Record List by Tags\nFiltering a list of records by tags can be done simply by sending a filter request to the ModuleApi endpoint for a module. For example, to filter the Accounts list where the tag field has a tag by the name of \"Tradeshow\", you can send a request to the /Accounts GET\u00c2\u00a0endpoint with the following request arguments:\n{\n \"view\": \"list\",\n \"filter\": [\n {\n \"tag\": {\n \"$in\": [\n {\n \"name\": \"Tradeshow\"\n }\n ]\n }\n }\n ]\n}\nCurrently, the tag field filter definitions support the following filter operators:", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Tags/index.html"} {"id": "032ec26b25b8-4", "text": "]\n}\nCurrently, the tag field filter definitions support the following filter operators:\nIs any of ($in)\nIs not any of ($not_in)\nIs empty ($empty)\nIs not empty ($not_empty)\nFetching a list of Tags from the Tags module\nFetch a list of tag records from the Tags module is done the same way as fetch a list of records from any other module, namely by sending a GET request to the /Tags ModuleApi endpoint.\u00c2\u00a0More information can be found in the / GET documentation.\nManipulating Tags Programmatically\nGetting Tags Related to a Record\nHere is an example that demonstrates how to get all the tags and its ids related to a contact record:\n// Creating a Bean for Contacts\n$bean = BeanFactory::getBean(\"Contacts\");\n// Creating a Bean for Tags\n$tagBean = BeanFactory::newBean('Tags');\n// Get all the tags related to Contacts Bean by givin Contact ID. You can provide more than one Record ID.\n$tags = $tagBean->getRelatedModuleRecords($bean, [\"\"]);\nCreating a New Tag and Adding to a Record\nHere is an example that demonstrates how to add create a tag and add to a contact record.\nIn order to add a new tag first, we will create the tag bean. Then using load_relationship function we will add the newly created tag id to the contacts\u00c2\u00a0\n// Creating new Tag Bean\n$tagBean = BeanFactory::newBean(\"Tags\");\n// Setting its name\n$tagBean->name = \"New Tag\";\n$tagBean->save();\n// Retrieving the Contacts Bean\n$bean = BeanFactory::getBean(\"Contacts\", \"\");\n// Getting tag field and its properties\n$tagField = $bean->getTagField();", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Tags/index.html"} {"id": "032ec26b25b8-5", "text": "// Getting tag field and its properties\n$tagField = $bean->getTagField();\n$tagFieldProperties = $bean->field_defs[$tagField];\n// Identifying relation link\n$link = $tagFieldProperties['link'];\n// Loading relationship\nif ($bean->load_relationship($link)) {\n // Adding newly created Tag Bean\n $bean->$link->add($tagBean->id);\n}\nRemoving Tags from a Record\nHere is an example that demonstrates how to remove a tag from a contact record:\n// Getting the Contacts Bean\n$bean = BeanFactory::getBean(\"Contacts\", \"\");\n// Getting tag field and its properties\n$tagField = $bean->getTagField();\n$tagFieldProperties = $bean->field_defs[$tagField];\n// Identifying relation link\n$link = $tagFieldProperties['link'];\n// Loading relationship\nif($bean->load_relationship($link)){\n // Removing the Tag ID\n $bean->$link->delete($bean->id, \"\");\n}\nSynchronizing Tags by Name With API Helpers\nIf you have multiple tags that you need to add and delete at the same time, then you can use SugarFieldTag->apiSave method. Here is an example that demonstrates how to sync tags by using SugarFieldTag Class\u00c2\u00a0for\u00c2\u00a0a Contact record.\nIt is important to know that since this is a sync; you will need to keep the existing tags if you want them to still exist in the record.\u00c2\u00a0\n// Getting the Contacts Bean\n$bean = BeanFactory::getBean(\"Contacts\", \"\");\n// Getting Tag Field ID\n$tagField = $bean->getTagField();\n// Getting Tag Field Properties\n$tagFieldProperties = $bean->field_defs[$tagField];", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Tags/index.html"} {"id": "032ec26b25b8-6", "text": "$tagFieldProperties = $bean->field_defs[$tagField];\n// Preparing the latest Tags to be sync with the record\n$tags = [\n // Note: Already attached tags will be automatically removed from the record\n // If you want to keep some of the existing tags then you will need to keep them in the array\n \"tag\" => [\n // Since this tag is already added, it will be preserved\n 'already added tag' => 'Already Added Tag',\n // The new tags to add - All other tags that previously existed will be deleted\n 'new tag' => 'New Tag',\n 'new tag2' => 'New Tag2',\n ],\n];\n// Building SugarFieldTag instance\n$SugarFieldTag = new SugarFieldTag();\n// Passing the arguments to save the Tags\n$SugarFieldTag->apiSave($bean, $tags, $tagField, $tagFieldProperties);\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Tags/index.html"} {"id": "9717bb124f9b-0", "text": "Backward Compatibility\nOverview\nAs of Sugar\u00c2\u00ae 7, modules are built using the Sidecar framework. Any modules that still use the MVC architecture and have not yet migrated to the Sidecar framework are set in what Sugar refers to as \"backward compatibility\" (BWC) mode.\nFor the list of Studio-enabled modules in backward compatibility for your version of Sugar, please refer to the User Interface (Legacy Modules) documentation for your version of Sugar.\nURL Differences\nThere are some important differences between the legacy MVC and Sidecar URLs. When a module is set in backward compatibility, the URL will contain \"/#bwc/\" in the path and use query string parameters to identify the module and action. An example of the Sidecar BWC URL is shown below.\nhttp://{site url}/#bwc/index.php?module=&action=\nYou can see that this differs from the standard route of:\nhttp://{site url}/#/\nStudio Differences\nThere are some important differences between the legacy MVC modules and Sidecar modules. When a module is in backward compatibility mode, an asterisk is placed next to the modules name in Studio. Modules in backward compatibility will use the legacy MVC metadata layouts, located in ./modules//metadata/, as follows:\nLayouts\nEdit View\nDetail View\nList View\nSearch\nBasic Search\nAdvanced Search\nThese layouts differ from Sidecar in many ways. The underlying metadata is very different and you should notice that the MVC layouts have a separation between the Edit View and Detail View whereas the Sidercar layouts make use of the Record View. The Sidecar metadata for Sugar is located in ./modules//clients/base/views/.\nLayouts\nRecord View\nList View\nSearch\nSearch\nTopicsEnabling Backward CompatibilityHow to enable backward compatibility for modules.Converting Legacy Modules To SidecarHow to upgrade a legacy module to be Sidecar enabled.", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Backward_Compatibility/index.html"} {"id": "9717bb124f9b-1", "text": "Last modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Backward_Compatibility/index.html"} {"id": "e1ca9b298b14-0", "text": "Enabling Backward Compatibility\nOverview\nHow to enable backward compatibility for a module.\nEnabling Backward Compatibility\nBackward Compatibility Mode is not a permanent solution for modules with legacy customizations. If you should need to temporarily get a module working due to legacy customizations, you can follow the steps below to enable the legacy MVC framework.\u00c2\u00a0Please note that switching stock Sugar modules from the Sidecar framework to backward compatibility\u00c2\u00a0mode is not supported and may result in unexpected behaviors in the application.\nEnabling BWC\nTo enable backward compatibility, you must first create a file in ./custom/Extension/application/Ext/Include/ for the module. If the module is custom, there will already be an existing file in this folder pertaining to the module that you can edit.\n./custom/Extension/application/Ext/Include/.php\n';\nOnce the file is in place, you will need to navigate to Admin > Repair > Quick Repair and Rebuild. The Quick Repair can wait until you have completed the following sections for this customization.\nVerifying BWC Is Enabled\nTo verify that backward compatibility is enabled, you can inspect App.metadata.get().modules after running a Quick Repair and Rebuild in your browser's console window:\nUsing Developer Tools in Google Chrome\nOpen Developer Tools\nThis can be done in the following ways:\nCommand + Option + i\nView > Developer > Developer Tools\nRight-click on the web page and selecting \"Inspect Element\"\nSelect the \"Console\" tab\nRun the following command, replacing and verify that it returns true:\nApp.metadata.get().modules..isBwcEnabled\nUsing Firebug in Google Chrome or Mozilla Firefox\nOpen Firebug\nSelect the \"Console\" tab\nRun the following command, replacing , and verify that it returns true:", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Backward_Compatibility/Enabling_Backward_Compatibility/index.html"} {"id": "e1ca9b298b14-1", "text": "Run the following command, replacing , and verify that it returns true:\nApp.metadata.get().modules..isBwcEnabled\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Backward_Compatibility/Enabling_Backward_Compatibility/index.html"} {"id": "f289356a1c8c-0", "text": "Converting Legacy Modules To Sidecar\nHow to upgrade a legacy module to be Sidecar enabled.\nOverview\nAfter upgrading your instance to Sugar 7.x, some custom modules may be left in the legacy backward compatible format. This is normally due to the module containing a custom view or file that Sugar does not recognize as being a supported customization for Sidecar. To get your module working with Sidecar, you will need to remove the unsupported customization and run the UpgradeModule.php script.\nNote:\u00c2\u00a0The following commands should be run\u00c2\u00a0on a sandbox instance before being applied to any production environment. It is also important to note that this script should only be run against custom modules. Stock modules in backward compatibility should remain in backward compatibility.\nSteps to Complete\nThe following steps require access to both the Sugar filesystem as well as an administrative user.\nNote:\u00c2\u00a0As of Sugar 10.0,\u00c2\u00a0the UpgradeModule.php script has been removed from the codebase. We are providing a zip of the files that were removed so that it is still possible to run the upgrade.\nBegin by downloading this zip file that contains the previously removed code\nUnzip the file and move the contents into your Sugar application at ./modules/UpgradeWizard/\nTo upgrade a\u00c2\u00a0custom module, identify the module's unique key. This key can be easily found by identifying the module's folder name in ./modules//. The module's key name will be in the format of abc_module.\u00c2\u00a0\nNext, change to the\u00c2\u00a0./modules/UpgradeWizard/\u00c2\u00a0path relative to your Sugar root directory in your terminal or command line application:cd /modules/UpgradeWizard/\nRun the\u00c2\u00a0UpgradeModule.php\u00c2\u00a0script, passing in the\u00c2\u00a0sugar root directory and\u00c2\u00a0the unique key of the legacy module:php UpgradeModule.php ", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Backward_Compatibility/Converting_Legacy_Modules_To_Sidecar/index.html"} {"id": "f289356a1c8c-1", "text": "An example is shown below:php UpgradeModule.php /var/www/html/sugarcrm/ abc_module\nThe script with then output a series of messages identifying issues that need to be corrected. Once the issues have been addressed, you can then run the\u00c2\u00a0UpgradeModule.php\u00c2\u00a0script again to confirm no errors have been found.\nOnce completed, log into your instance and navigate to Admin > Repair > Quick Repair and Rebuild. Test the custom\u00c2\u00a0module to ensure it\u00c2\u00a0is working as expected. There is no\u00c2\u00a0guarantee that the module will be fully functional in Sidecar and may therefore require additional development effort to ensure compatibility.\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Backward_Compatibility/Converting_Legacy_Modules_To_Sidecar/index.html"} {"id": "3da9e8c0abc3-0", "text": "Access Control Lists\nOverview\nAccess Control Lists (ACLs) are used to control access to the modules, data,\u00c2\u00a0and actions available to users in Sugar. By default, Sugar comes with a default ACL Strategy that is configurable by an Admin through the Roles module via Admin >\u00c2\u00a0Role Management. Sugar also comes with other ACL strategies that are located in the ./data/acl/ folder, and are used in other parts of the system such as the Administration module, Emails module, Locked Fields functionality, and many others. They can also be leveraged by customizations and custom ACL strategies can be implemented to control your own customizations.\nActions\nActions are the use cases in which a User interacts with a particular module in the system. ACLs control access by using different logic to determine if a user can do an action. Below is a list of actions that are utilized by Sugar and will be requested actions against a custom ACL strategy implementation. You can add your own actions to be checked against in a custom strategy, but the following list should always be considered:\nindex, list, listview - for module ListView access\ndetail, detailview, view - module DetailView access\npopupeditview, editview - module EditView access\nedit, save - editing module data\nimport - import into the module\nexport - export from the module\ndelete - delete module record\nteam_security - should this module have team security enabled?\nfield - access field ACLs. The field action is specified via context array, see below\nsubpanel - checks if subpanel should be displayed. Should have \"subpanel\" context option.\nNote: Action names are not case sensitive, although the standard practice is to use them in all lowercase\nField Actions\nWhen using the field action, the action for the particular field that is being checked is passed via Context. The field actions that are used in Sugar are:\naccess - any access to field data", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Access_Control_Lists/index.html"} {"id": "3da9e8c0abc3-1", "text": "access - any access to field data\nread, detail - read access\nwrite, edit - write access\nContext\nThe context array is used throughout Sugar's ACL architecture as a way to pass extra contextual data that is used by an ACL Strategy to determine the access request.\u00c2\u00a0The following context parameters are used in stock contexts, and should be used as a guideline for custom ACL implementations as parameters that should be accommodated or used:\nbean (SugarBean) - the current SugarBean object\nuser (User) - the user to check access for, otherwise defaults to the current user.\nuser_id (String) - the current user ID (also overrides global current user). If the current user object is available, use the user context, since it has precedent.\nowner_override (Bool) - if set to true, apply ACLs as if the current user were the owner of the object.\nsubpanel (aSubPanel) - used in subpanel action to provide aSubPanel object describing the panel.\nfield, action (String) - used to specify field name and action name for field ACL requests.\nmassupdate (Bool) - true if save operation is a mass update\nSugarACL\nThe SugarACL Class, ./data/SugarACL.php, is the static API for checking access for an action against a module.\u00c2\u00a0\ncheckAccess()\nThe checkAccess() method is used to check a users access for a given action against a module.\u00c2\u00a0\nSugarACL::checkAccess('Accounts','edit');\nArguments\nName\nType\nRequired\nDescription\n$module\nString\ntrue\nThe name of the module\n$action\nString\ntrue\nThe name of the action. See Actions section.\n$context\nArray\nfalse\nThe associative array of context data. See Context section.\nReturns\nBoolean\ncheckField()", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Access_Control_Lists/index.html"} {"id": "3da9e8c0abc3-2", "text": "The associative array of context data. See Context section.\nReturns\nBoolean\ncheckField()\nThe checkField() method is used to check a users access for a given field against a module.\u00c2\u00a0\nSugarACL::checkField('Accounts','account_type','view');\nArguments\nName\nType\nRequired\nDescription\n$module\nString\ntrue\nThe name of the module\n$field\nString\ntrue\nThe name of the field\n$action\nString\ntrue\nThe name of the action.\u00c2\u00a0See Actions section.\n$context\nArray\nfalse\nThe associative array of context data. See Context section.\nReturns\nBoolean\ngetFieldAccess()\nThe getFieldAccess() method is used to get the access level for a specific\n$access = SugarACL::getFieldAccess('Accounts','account_type');\nArguments\nName\nType\nRequired\nDescription\n$module\nString\ntrue\nThe name of the module\n$field\nString\ntrue\nThe name of the field\n$context\nArray\nfalse\nThe associative array of context data. See Context section.\nReturns\nInteger\nThe integers are represented as constants in the SugarACL class, and correspond as follows:\nSugarACL::ACL_NO_ACCESS = 0 - access denied\nSugarACL::ACL_READ_ONLY = 1 - read only access\nSugarACL::ACL_READ_WRITE = 4 - full access\nfilterModuleList()\nThe filterModuleList() method is used to filter the list of modules available for a given action. For example, if you wanted to get all the modules the current user had edit access to, you might call the following in code:\nglobal $app_list_strings;\n$modules = $app_list_strings['module_list'];\n$editableModules = SugarACL::filterModuleList($modules,'edit');\nArguments\nName\nType\nRequired\nDescription\n$modules\nArray\ntrue\nThe list of modules you want to filter", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Access_Control_Lists/index.html"} {"id": "3da9e8c0abc3-3", "text": "Required\nDescription\n$modules\nArray\ntrue\nThe list of modules you want to filter\n$action\nString\nfalse\nThe action to check for,\u00c2\u00a0See Actions section.\u00c2\u00a0Defaults to 'access' action\n$use_value\nBoolean\nfalse\nWhether to the module name in the $modules array is in the Key or the Value of the array.\u00c2\u00a0Defaults to false\nFor example, if filtering an array of modules, where the modules are defined in the values of the array:\n$modules = array(\n 'Accounts',\n 'Cases',\n 'Administration'\n);\n$accessModules = SugarACL::filterModuleList($modules,'access',true);\nReturns\nArray\nThe filtered list of modules.\ndisabledModuleList()\nSimilar to the previous method, the disableModuleList() method filters a list of modules to those that the user does not have access to.\nglobal $app_list_strings;\n$modules = $app_list_strings['module_list'];\n$disabledModules = SugarACL::disabledModuleList($modules,'access');\nArguments\nName\nType\nRequired\nDescription\n$modules\nArray\ntrue\nThe list of modules you want to filter\n$action\nString\nfalse\nThe action to check for,\u00c2\u00a0See Actions section.\u00c2\u00a0Defaults to 'access' action\n$use_value\nBoolean\nfalse\nWhether to the module name in the $modules array is in the Key or the Value of the array.\u00c2\u00a0Defaults to false\nFor example, if filtering an array of modules, where the modules are defined in the values of the array:\n$modules = array(\n 'Accounts',\n 'Cases',\n 'Administration'\n);\n$accessModules = SugarACL::filterModuleList($modules,'access',true);\nReturns\nArray\nThe filtered list of modules.\nmoduleSupportsACL()", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Access_Control_Lists/index.html"} {"id": "3da9e8c0abc3-4", "text": "Returns\nArray\nThe filtered list of modules.\nmoduleSupportsACL()\nThe moduleSupportsACL() method is used to check if a module has ACLs defined on the vardefs.\u00c2\u00a0A good use case for this method is to not run any ACL checks if module has no ACL definitions.\nSugarACL::moduleSupportsACL('Accounts');\nArguments\nName\nType\nRequired\nDescription\n$module\nString\ntrue\nThe name of the module\nReturns\nBoolean\nlistFilter()\nThe listFilter() method allows for filtering an array of fields for a module to remove those which the user does not have access to. The removal can be done in a couple of different ways, provided by the $options argument. The filtering of the array is done in place, rather than returning the filtered list.\n$Account = BeanFactory::getBean('Accounts','12345');\n$fields = array(\n 'account_type' => 'foobar',\n 'status' => 'New',\n 'name' => 'Customer'\n);\n$context = array(\n 'bean' => $Account\n);\n$options = array(\n 'blank_value' => true\n);\nSugarACL::listFilter('Accounts',$fields,$context,$options);\necho
json_encode($fields)
;\nShould the user not have access to the 'status' field, the above might output:\n{\n \"account_type\": \"foobar\",\n \"status\": \"\",\n \"name\": \"Customer\"\n}\nArguments\nName\nType\nRequired\nDescription\n$module\nString\ntrue\nThe name of the module\n$list\nArray\ntrue\nThe array, as a reference, which will be filtered\n$context\nArray\nfalse\nThe associative array of context data. See Context section.\n$options\nArray\nfalse", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Access_Control_Lists/index.html"} {"id": "3da9e8c0abc3-5", "text": "false\nThe associative array of context data. See Context section.\n$options\nArray\nfalse\nAn associative array containing some of the following options:\nblank_value (Bool) - instead of removing inaccessible field put '' there\nadd_acl (Bool) - instead of removing fields add 'acl' value with access level\nsuffix (String) - strip suffix from field names\nmin_access (Int) - require this level of access for the field.\u00c2\u00a0Defaults to\u00c2\u00a0SugarACL::ACL_READ_ONLY\u00c2\u00a0or 0\nuse_value (Bool) - look for field name in value, not in the key of the list\nReturns\nVoid\nSugarBean Usage\nThe SugarBean class also comes with some methods for working with the ACLs in regards to the current SugarBean context. These methods automatically provide the 'bean' context parameter and provide a wrapper that utilizes the SugarACL class\ngetACLCategory()\nThe getACLCategory() method is used by all of the ACL helper methods that exist on the SugarBean and is used to determine the module name that should be checked against for the current Bean. By default, it will return the acl_category property set on the Bean, otherwise if that is not set, it will use the module_dir property that is configured on the Bean. This method can be overridden by a custom Bean implementation, but the following code shows which properties on a Bean implementation should be set for usage with ACLs.\ngetACLCategory();\n$submodule = new test_SubmoduleBean();\n//echoes test_SubmoduleBean\necho $submodule->getACLCategory();\nArguments\nNone\nReturns\nString\nACLAccess()\nThe ACLAccess() method is a wrapper for SugarACL::checkField() method, which provides the Bean context as the current SugarBean.\n$Account = BeanFactory::getBean('Accounts','12345');\nif ($Account->ACLFieldAccess('account_type','edit')){\n //do something if User has account_type edit access\n}\nArguments\nName\nType\nRequired\nDescription\n$action\nString\nfalse\nThe name of the action to check.\u00c2\u00a0See Actions section.\n$context\nArray\nfalse\nThe associative array of context data. See Context section.\nReturns\nBoolean\nACLFieldAccess()\nThe ACLFieldAccess() method is a wrapper for SugarACL::checkAccess() method, which provides the Bean context as the current SugarBean.\n$Account = BeanFactory::getBean('Accounts','12345');\nif ($Account->ACLACcess('edit')){\n //do something if User has edit access\n}\nArguments\nName\nType\nRequired\nDescription\n$field\nString\ntrue\nThe name of the field\n$action\nString\nfalse\nThe name of the action to check,\u00c2\u00a0see Field Actions section. Defaults to 'access'\n$context\nArray\nfalse\nThe associative array of context data. See Context section.\nReturns\nBoolean\nACLFieldGet()\nThe ACLFieldGet() method is a wrapper for SugarACL::getFieldAccess() method, which provides the Bean context as the current SugarBean.\n$Account = BeanFactory::getBean('Accounts','12345');", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Access_Control_Lists/index.html"} {"id": "3da9e8c0abc3-7", "text": "$Account = BeanFactory::getBean('Accounts','12345');\n$accountTypeAccess = $Account->ACLFieldGet('account_type');\nArguments\nName\nType\nRequired\nDescription\n$field\nString\ntrue\nThe name of the field\n$context\nArray\nfalse\nThe associative array of context data. See Context section.\nReturns\nBoolean\nACLFilterFields()\nThe ACLFilterFields()\u00c2\u00a0method uses the\u00c2\u00a0SugarACL::checkField() method to blank out those fields which a user doesn't have access to on the current SugarBean.\n$Account = BeanFactory::getBean('Accounts','12345');\n$Account->status = 'Old';\n$Account->ACLFilterFields('edit');\necho $Account->status;\nShould the user not have 'edit' access to the 'status' field, the above wouldn't output any data since the status field would be blank.\nArguments\nName\nType\nRequired\nDescription\n$action\nString\ntrue\nThe name of the action to check.\u00c2\u00a0See Actions section.\n$context\nArray\nfalse\nThe associative array of context data. See Context section.\nReturns\nVoid\nACLFilterFieldList()\nThe ACLFilterFieldList() method is a wrapper for SugarACL::listFilter() method, which provides the Bean context as the current SugarBean.\n$Account = BeanFactory::getBean('Accounts','12345');\n$fields = array(\n 'account_type' => 'foobar',\n 'status' => 'New',\n 'name' => 'Customer'\n);\n$options = array(\n 'blank_value' => true\n);\n$Account->ACLFilterFieldList($fields,array(),$options);\necho \"
\".json_encode($fields).\"
\";\nShould the user not have access to the 'status' field, the above might output:\n{", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Access_Control_Lists/index.html"} {"id": "3da9e8c0abc3-8", "text": "{\n \"account_type\": \"foobar\",\n \"status\": \"\",\n \"name\": \"Customer\"\n}\nArguments\nName\nType\nRequired\nDescription\n$list\nArray\ntrue\nThe array, as a reference, which will be filtered\n$context\nArray\nfalse\nThe associative array of context data. See Context section.\n$options\nArray\nfalse\nAn associative array containing some of the following options:\nblank_value (Bool) - instead of removing inaccessible field put '' there\nadd_acl (Bool) - instead of removing fields add 'acl' value with access level\nsuffix (String) - strip suffix from field names\nmin_access (Int) - require this level of access for the field.\u00c2\u00a0Defaults to\u00c2\u00a0SugarACL::ACL_READ_ONLY\u00c2\u00a0or 0\nuse_value (Bool) - look for field name in value, not in the key of the list\nReturns\nVoid\nLegacy Methods\nWhen working in the Sugar codebase there might be areas that still utilize the following legacy ACLController class. The following gives a brief overview of a few methods that might still be used but should be avoided in future custom development.\nACLController::checkAcess()\nThe ACLController::checkAccess() method is just a wrapper for SugarACL::checkAccess() method and has been left in place for backward compatibility.\nACLController::moduleSupportsACL()\nThe ACLController::moduleSupportsACL() method is just a wrapper for SugarACL::moduleSupportsACL() method and has been left in place for backward compatibility.\nACLController::displayNoAccess()\nThis method does an echo to display a \"no access\" message for pages.\u00c2\u00a0\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/Access_Control_Lists/index.html"} {"id": "cd5c8342db0a-0", "text": "DateTime\nOverview\nThe SugarDateTime class, located in, ./include/SugarDateTime.php, extends PHP's built in\u00c2\u00a0DateTime class and can be used\u00c2\u00a0to\u00c2\u00a0perform common operations on date and time values.\u00c2\u00a0\nSetting\nWith existing SugarDateTime objects, it is recommended to clone the object before modifying or performing operations on it.\n$new_datetime = clone $datetime;\nAnother option is to instantiate a new SugarDateTime\u00c2\u00a0object.\n// defaults to now\n$due_date_time = new SugarDateTime();\n$due_date_time->setDate($dueYear, $dueMonth, $dueDay);\n$due_date_time->setTime($dueHour, $dueMin);\n$due_date_time->setTimezone($dueTZ);\nNote : When creating a new SugarDateTime object, the date and time will default to the current date and time in the timezone configured in PHP.\nSugarDateTime Objects can also be modified by passing in common English textual date/time strings to manipulate the value.\n$due_date = clone $date;\n$end_of_the_month->modify(\"last day of this month\");\n$end_of_next_month->modify(\"last day of next month\");\n$thirty_days_later->modify(\"+30 days\");\nFormatting\nWhen formatting SugarDateTime objects into a string for display or logging purposes, there are a few options you\u00c2\u00a0can utilize through the\u00c2\u00a0formatDateTime() method.\nReturn the date/time formatted for the database:\n$db_datetime_string = formatDateTime(\"datetime\", \"db\");\nReturn the date/time formatted using a user's preference:\nglobal $current_user;\n$user_datetime_string = formatDateTime(\"datetime\", \"user\", $current_user);\nReturn the date/time formatted following ISO-8601\u00c2\u00a0standards:\n$iso_datetime_string = formatDateTime(\"datetime\", \"iso\");", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/DateTime/index.html"} {"id": "cd5c8342db0a-1", "text": "$iso_datetime_string = formatDateTime(\"datetime\", \"iso\");\nThere are times when it is needed to return only certain parts of a date or time. The format() method accepts a string parameter to define what parts or information about the date/time should be returned.\u00c2\u00a0\n// 28 Dec 2016\necho $due_date_time->format(\"j M Y\");\n// 2016-12-28 19:01:09\necho $due_date_time->asDb();\n// The date/time 2016-12-28T11:01:09-08:00 is set in the timezone of America/Los_Angeles\necho \"The date/time \" . $due_date_time->format(\"c\") . \" is set in the timezone of \" . $due_date_time->format(\"e\");\n// The time when this date/time object was created is 11:01:09 AM -0800\necho \"The time when this date/time object was created is \" . $due_date_time->format(\"H:i:s A O\");\n// There are 31 days in the month of December\necho \"There are \" . $due_date_time->format(\"t\") . \" days in the month of \" . $due_date_time->format(\"F\");\n// There are 366 days in the year of 2016\necho \"There are \" . $due_date_time->__get(\"days_in_year\") . \" days in the year of \" . $due_date_time->format(\"Y\");\n// Between Wed, 28 Dec 2016 11:01:09 -0800 and the end of the year, there are 4 days.\necho \"Between \" . $due_date_time . \" and the end of the year, there are \" . ($due_date_time->__get(\"days_in_year\") - $due_date_time->format(\"z\")) . \" days.\";", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/DateTime/index.html"} {"id": "cd5c8342db0a-2", "text": "\u00c2\u00a0For more information on the available options, please refer to http://php.net/manual/en/function.date.php\u00c2\u00a0\nTimeDate Class\nThe TimeDate\u00c2\u00a0class, located in ./include/TimeDate.php, utilizes the SugarDateTime class to provide an extended toolset of methods for date/time usage.\nSetting\nWith existing TimeDate objects, it is recommended to clone the object before modifying or performing operations on it.\n$new_timedate = clone $timedate;\nAnother option is to instantiate a new TimeDate\u00c2\u00a0object.\n// current time in UTC\n$timedate = new TimeDate();\n$now_utcTZ = $timedate->getNow();\n// current time in user's timezone\n$timedate = new TimeDate($current_user);\n$now_userTZ = $timedate->getNow(true);\nNote : When creating a new TimeDate\u00c2\u00a0object, the date and time will default to the current date and time in the UTC timezone unless\u00c2\u00a0a user object is passed in.\u00c2\u00a0\nFormatting\nTimeDate objects can return the Date/Time in either a string format or in a SugarDateTime object.\u00c2\u00a0The TimeDate object has many formatting options; some of the most common ones are :\ngetNow\nGet the current date/time as a\u00c2\u00a0SugarDateTime\u00c2\u00a0object\u00c2\u00a0\nfromUser\nGet SugarDateTime object\u00c2\u00a0from user's date/time string\nasUser\nFormat DateTime object as user's date/time string\nfromDb\nGet SugarDateTime\u00c2\u00a0object\u00c2\u00a0from a DB date/time string\nfromString\nCreate a\u00c2\u00a0SugarDateTime object from a string\nget_db_date_time_format\nGets\u00c2\u00a0the current database date and time format\nto_display_date_time\nFormat a\u00c2\u00a0string\u00c2\u00a0as user's display date/time\ngetNow\nreturns\u00c2\u00a0SugarDateTime object\nParameters\nName\nData Type\nDefault", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/DateTime/index.html"} {"id": "cd5c8342db0a-3", "text": "getNow\nreturns\u00c2\u00a0SugarDateTime object\nParameters\nName\nData Type\nDefault\nDescription\n$userTz\nbool\nfalse\nWhether to use\u00c2\u00a0the user's timezone or not. False will use UTC\nReturns a SugarDateTime object set to the current date/time. If there is a\u00c2\u00a0user object associate\u00c2\u00a0to the TimeDate object, passing true to the $userTz parameter will return the object in user's timezone. If no user is associated or false is passed, the timezone returned will be in UTC.\nExample\n$timedate = new TimeDate($current_user);\n// returns current date/time in UTC\n$now_utcTZ = $timedate->getNow();\n// returns current date/time in the user's timezone\n$now_userTZ = $timedate->getNow(true);\nfromUser\nreturns\u00c2\u00a0SugarDateTime object\nParameters\nName\nData Type\nDefault\nDescription\n$date\nstring\nn/a\nDate/Time string to convert to an object\n$user\nUser\nnull\nUser to utilize formatting and timezone info from\nReturns a SugarDateTime object\u00c2\u00a0converted from the passed in string.\u00c2\u00a0If there is a user object passed in as a parameter will return the object in user's timezone. If no user is passed in, the timezone returned will be in UTC.\nExample\n$date = \"2016-12-28 13:09\";\n$timedate = new TimeDate();\n$datetime = $timedate->fromUser($date, $current_user);\nasUser\nreturns\u00c2\u00a0string\nParameters\nName\nData Type\nDefault\nDescription\n$date\nstring\nn/a\nDate/Time string to convert to an object\n$user\nUser\nnull\nUser to utilize formatting and timezone info from", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/DateTime/index.html"} {"id": "cd5c8342db0a-4", "text": "$user\nUser\nnull\nUser to utilize formatting and timezone info from\nReturns a\u00c2\u00a0string\u00c2\u00a0of the date and time formatted based on the user's profile settings.\u00c2\u00a0If there is a user object passed in as a parameter it will return the object in user's timezone. If no user is passed in, the timezone returned will be in UTC.\nExample\n$datetime = new datetime(\"2016-12-28 13:09\");\n$timedate = new TimeDate();\n$formattedDate = $timedate->asUser($datetime, $current_user);\nfromDb\nreturns SugarDateTime\nParameters\nName\nData Type\nDefault\nDescription\n$date\nstring\nn/a\nDate/Time string in database format to convert to an object\nReturns a SugarDateTime object\u00c2\u00a0converted from the passed in database formatted string.\nNote : If the string does not match the database format exactly, this function will return boolean false.\nExample\n// Y-m-d H:i:s\n$db_datetime = \"2016-12-28 13:09:01\";\n$timedate = new TimeDate();\n$datetime = $timedate->fromDb($db_datetime);\n// returns bool(false)\n$wrong_datetime = \"2016-12-28 13:09\";\n$timedate = new TimeDate();\n$datetime = $timedate->fromDb($timedate);\nfromString\nreturns SugarDateTime\nParameters\nName\nData Type\nDefault\nDescription\n$date\nstring\nn/a\nDate/Time string to convert to an object\n$user\nUser\nnull\nUser to utilize timezone info from", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/DateTime/index.html"} {"id": "cd5c8342db0a-5", "text": "$user\nUser\nnull\nUser to utilize timezone info from\nReturns a SugarDateTime object\u00c2\u00a0converted from the passed in database formatted string.\u00c2\u00a0If there is a user object passed in as a parameter it will return the object in user's timezone. If no user is passed in, the timezone returned will be in UTC.\nExample\n$datetime_str = \"December 28th 2016 13:09\";\n$timedate = new TimeDate();\n$datetime = $timedate->fromString($datetime_str);\nget_db_date_time_format\nreturns\u00c2\u00a0string\nParameters\nN/a\nReturns a\u00c2\u00a0string of the current database date and time format settings.\u00c2\u00a0\nNote : For just the date format use\u00c2\u00a0get_db_date_format() and for just the time format use\u00c2\u00a0get_db_time_format().\nExample\n$timedate = new TimeDate();\n// Y-m-d H:i:s\n$db_format = $timedate->get_db_date_time_format();\nto_display_date_time\nreturns\u00c2\u00a0string\nParameters\nName\nData Type\nDefault\nDescription\n$date\nstring\nn/a\nDate/Time string in database format\n$meridiem\nboolean\ntrue\nDeprecated -- Remains for backwards compatibility only\n$convert_tz\nboolean\ntrue\nConvert to user's timezone\n$user\nUser\nnull\nUser to utilize formatting and timezone info from\nReturns a string of the date and time formatted based on the user's profile settings. If no user is passed in, the current user's default will be used. If $convert_tz is true the string returned will be\u00c2\u00a0in the passed in user's timezone. If no user is passed in, the timezone returned will be in UTC.\nNote : If the string does not match the database format exactly, this function will return boolean false.\nExample", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/DateTime/index.html"} {"id": "cd5c8342db0a-6", "text": "Example\n$datetime_str = \"2016-12-28 13:09:01\";\n// 12-28-2016 07:09\n$timedate = new TimeDate();\n$datetime = $timedate->to_display_date_time($datetime_str);\n// 2016-12-28 13:09\n$timedate = new TimeDate();\n$datetime = $timedate->to_display_date_time($datetime_str, true, false, $diff_user);\nParsing\nIn addition to formatting, TimeDate objects can also return Date/Time values based on special parameters.\u00c2\u00a0The TimeDate object has many date parsing options; some of the most common ones are :\nparseDateRange\nGets\u00c2\u00a0the start and end date/time from a range keyword\u00c2\u00a0\nparseDateRange\nreturns array\nParameters\nName\nData Type\nDefault\nDescription\n$range\nstring\nn/a\nString\u00c2\u00a0from a predetermined list of available ranges\n$user\nUser\nnull\nUser to utilize formatting and timezone info from\n$adjustForTimezone\nboolean\ntrue\nConvert to user's timezone\nReturns an array of\u00c2\u00a0SugarDateTime objects containing the start and Date/Time values calculated based on the entered parameter. If no user is passed in, the current user's default will be used. If $adjustForTimezone\u00c2\u00a0is true the string returned will be\u00c2\u00a0in the passed in user's timezone. If NULL is passed in as the\u00c2\u00a0user, the timezone returned will be in UTC. The available values for $range are :\nRange String\nDescription\nyesterday\nYesterday's start and end date/time\ntoday\nToday's start and end date/time\ntomorrow\nTomorrows's start and end date/time\nlast_7_days\nStart and end date/time of the last seven days\nnext_7_days", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/DateTime/index.html"} {"id": "cd5c8342db0a-7", "text": "Start and end date/time of the last seven days\nnext_7_days\nStart and end date/time of the next seven days\nlast_30_days\nStart and end date/time of the last thirty days\nnext_30_days\nStart and end date/time of the next thirty days\nnext_month\nStart and end date/time of next month\nlast_month\nStart and end date/time of last month\nthis_month\nStart and end date/time of the current month\nlast_year\nStart and end date/time of last year\nthis_year\nStart and end date/time of the current year\nnext_year\nStart and end date/time of next year\nExample\n$timedate = new TimeDate($current_user);\n// returns today's start and end date/time in UTC\n$today_utcTZ = $timedate->parseDateRange(\"today\", NULL, false);\n// returns today's start and end date/time in the user's timezone\n$today_userTZ = $timedate->parseDateRange(\"today\", $current_user, true);\n \tLast modified: 2023-02-03 21:04:03", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/DateTime/index.html"} {"id": "40a0588ef00e-0", "text": "SugarPDF\nOverview\nAn overview of SugarPDF and how it relates to TCPDF.\u00c2\u00a0As of version\u00c2\u00a06.7.x, Sugar includes a Smarty template engine called\u00c2\u00a0PDF Manager that is accessible by navigating to Admin > PDF Manager. The\u00c2\u00a0PDF Manager allows administrators to create and manage templates for deployed modules without having to write custom code. \u00c2\u00a0The following sections are only specific to developers looking to create their own custom TCPDF\u00c2\u00a0templates using PHP.\nPDF Classes\nThe various classes used in generating PDFs within Sugar.\nTCPDF\nSugar uses the TCPDF 4.6.013\u00c2\u00a0library, located in ./vendor/tcpdf/,\u00c2\u00a0as the core engine to generate PDFs. This library is extended by Sugarpdf\u00c2\u00a0which is used by the core application to generate PDFs.\u00c2\u00a0\nSugarpdf\nThe Sugarpdf class, located in ./include/Sugarpdf/Sugarpdf.php, extends the TCPDF class. Within this class, we have overridden certain functions to integrate sugar features. Some key methods that were overridden are listed below:\u00c2\u00a0\nMethod\nDescription\nHeader\nOverridden to enable custom logos.\nSetFont\nOverridden to allow for the loading of custom fonts. The custom fonts direction is defined by the K_PATH_CUSTOM_FONTS var. By default, this value is set to ./custom/vendor/tcpdf/fonts/\nCell\nOverridden to apply the prepare_string() function. This allows for the ability to clean the string before sending to PDF. \u00c2\u00a0\nSome key additional methods that were added are listed below:\nMethod\nDescription\npredisplay\nPreprocessing before the display method is called. Is intended to setup general PDF document properties like margin, footer, header, etc.\ndisplay\nPerforms the actual PDF content generation. This is where the logic to display output to the PDF should be placed.\nprocess", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/SugarPDF/index.html"} {"id": "40a0588ef00e-1", "text": "process\nCalls predisplay and display.\nwriteCellTable\nMethod to print a table using the cell print method of TCPDF\nwriteHTMLTable\nMethod to print a table using the writeHTML print method of TCPDF\nCustom PDF classes that extend Sugarpdf can be located in the following directories:\n./include/Sugarpdf/sugarpdf/sugarpdf..php\n./modules//sugarpdf/sugarpdf..php\n./custom/modules//sugarpdf/sugarpdf..php\nPDF Manager classes\u00c2\u00a0that extend Sugarpdf are located in the following directories:\n./include/Sugarpdf/sugarpdf/sugarpdf.smarty.php\n./include/Sugarpdf/sugarpdf/sugarpdf.pdfmanager.php\n./custom/include/Sugarpdf/sugarpdf/sugarpdf.pdfmanager.php\nEach extended class will define a specific PDF view that is accessible with the following URL parameters:\nmodule=\naction=sugarpdf\nsugarpdf=\nWithin each custom PDF class, the display method will need to be redefined. If you would like, It is also possible to override other methods like Header. The process method of this class will be called from ViewSugarpdf. When a PDF is being generated, the most relevant sugarpdf..pdf class is determined by the SugarpdfFactory.\nViewSugarpdf\nThe ViewSugarpdf class, located in ./include/MVC/View/views/view.sugarpdf.php,\u00c2\u00a0is used to create the SugarViews that generate PDFs. These views can be found and/or created in one of the following directory paths:\n./modules//views/view.sugarpdf.php\n./custom/modules//views/view.sugarpdf.php", "source": "https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_13.0/Architecture/SugarPDF/index.html"} {"id": "40a0588ef00e-2", "text": "./custom/modules//views/view.sugarpdf.php\nSugarViews can be called by navigating to a URL in the format of:\nhttp:///index.php?module=&action=sugarpdf&sugarpdf=\nAs of 6.7, PDFs are mainly generated using the PDF Manager templating system. To generate the PDF stored in the PDF Manager, you would call a URL in the format of:\nhttp:///index.php?module&record=&action=sugarpdf&sugarpdf=pdfmanager&pdf_template_id=