Hi,

 I added a section filters  on status in Order screen. But When i click on status filter i can see the user name option along with the "select status"&"Clear" options. For what reason is the username visible in Status filters ? I have not given any such conditions there. Can you help me out to remove it.

The code snippet in OrderSectionV2 is given below

define("OrderSectionV2", [], function() {

    return {

        entitySchemaName: "Order",

        details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,

        diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/,

        methods: {

         initFixedFiltersConfig: function() {

                var fixedFilterConfig = {

                    entitySchema: this.entitySchema,

                    filters: [

                         {

                            name: "PeriodFilter",

                            caption: this.get("Resources.Strings.PeriodFilterCaption"),

                            dataValueType: this.Terrasoft.DataValueType.DATE,

                            startDate: {

                                columnName: "StartDate",

                                defValue: this.Terrasoft.startOfWeek(new Date())

                            },

                            dueDate: {

                                columnName: "StartDate",

                                defValue: this.Terrasoft.endOfWeek(new Date())

                            }

                        },

                        {

                            name: "Owner",

                            caption: this.get("Resources.Strings.OwnerFilterCaption"),

                            columnName: "Owner",

                            defValue: this.Terrasoft.SysValue.CURRENT_USER_CONTACT,

                            dataValueType: this.Terrasoft.DataValueType.LOOKUP,

                        },

                          

                        {

                            name: "Status",

                            columnName: "Status",

                            caption: this.get("Resources.Strings.StatusFilterCaption"),

                            appendCurrentOrderMenuItem: false,

                            dataValueType: this.Terrasoft.DataValueType.LOOKUP,

                            addNewFilterCaption: this.get("Resources.Strings.SelectStatusCaption"),

                            hint: this.get("Resources.Strings.SelectStatusCaption"),

                            buttonImageConfig: this.get("Resources.Images.SortIcon"),

                        }

                        

                    ]

                };

                this.set("FixedFilterConfig", fixedFilterConfig);

                

            }

        }

    };

});


 

 

Please find the below screen shot.

 

Like 0

Like

3 comments

Hello, the view that is responsible for generating menu items for fixed filter is called "FixedFilterViewV2" more precisely "getMenuButtonItems" method. We can see that appendCurrentContactMenuItem property is checking inside of this method. http://prntscr.com/mqtpy3



So the solution is to add this property to your filter config and set it to false.  I have already modified your code so please feel free to use it.

define("OrderSectionV2", ["BaseFiltersGenerateModule"], function(BaseFiltersGenerateModule) {
    return {
        entitySchemaName: "Order",
        details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
        diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/,
        methods: {
         initFixedFiltersConfig: function() {
                var fixedFilterConfig = {
                    entitySchema: this.entitySchema,
                    filters: [
                        {
                            name: "Owner",
                            caption: this.get("Resources.Strings.OwnerFilterCaption"),
                            columnName: "Owner",
                            defValue: this.Terrasoft.SysValue.CURRENT_USER_CONTACT,
                            dataValueType: this.Terrasoft.DataValueType.LOOKUP,
                        },
 
                        {
                            name: "Status",
                            columnName: "Status",
                            caption: "Status filter",
                            appendCurrentOrderMenuItem: false,
                            dataValueType: this.Terrasoft.DataValueType.LOOKUP,
                            addNewFilterCaption: "Status filter",
                            hint: "hint caption",
                            appendCurrentContactMenuItem: false,
                            buttonImageConfig: this.get("Resources.Images.SortIcon"),
                        }
 
                    ]
                };
                this.set("FixedFilterConfig", fixedFilterConfig);
 
            }
        }
    };
});

 

Hi Alex_tim,

Thank you. Worked.

Also I have an another question, I want to fix a value for lookup column like in owner filter we are using "defvalue" property. How can this property be used for status filter since this is lookup column.

Sriraksha KS,

You should take a look into "FixedFilterViewV2" and debug it to understand how the menuitems are added to the quick filter.

After debug, you will know how to add menuitems and if it will be necessary, simply override base logic.



Regards,

Alex

Show all comments

Can I have multiple object addition signals within a single process? 

Like 0

Like

1 comments

Dear Kumar,

Yes, you can more than one signal to start a process.For example if record is created or modified. 

Best regards,

Angela

Show all comments

Hi!

Guided by   https://academy.bpmonline.com/documents/technic-sdk/7-11/authservicesvc…

I am trying to authenticate using fiddler as  client, but I get an error, please tell me what am I doing wrong.

user have access to OData.

what i receive:

HTTP/1.1 401 Unauthorized

Cache-Control: private

Content-Type: application/json; charset=utf-8

Server: Microsoft-IIS/8.5

jsonerror: true

X-Powered-By: ASP.NET

X-Frame-Options: SAMEORIGIN

X-Content-Type-Options: nosniff

Date: Sat, 23 Feb 2019 08:02:33 GMT

Content-Length: 91

{"Message":"There was an error processing the request.","StackTrace":"","ExceptionType":""}



 

 

Like 0

Like

1 comments

Dear Bellil,

Please see the article below on how to proceed with the authentication with bpm'online using OData protocol and Fiddler application 

https://academy.bpmonline.com/documents/technic-sdk/7-13/executing-odat…

Also, I would like to share the approach I use: I open the Fiddler --> start tracing all requests --> open login page and enter the credentials --> hit login and looking for this request in Fiddler --> drag the caught request into Fiddler Composer window. There I can see all the headers, and body sent to the system. This helps to understand what is needed, run same request with modified data (if needed for any testing).



Hope you will find it helpful,

Anastasia

Show all comments

I changed the column type of 'UsrBenefitYears' from String to Integer, now I get this error when I try to save a detail or section through the wizard.

Any idea where I start looking to resolve this?

 

Like 0

Like

1 comments

Hello Jordan,



Most likely, you faced with the compilation error. You should go to the configuration, choose the "compile all" option and you will get the error. After that you should fix it basing on received error text. 

Also, you may try to update database structure if you did not perform that action after you changed the type of the column.

Please note, that we don't recommend to change the type of columns because it can lead to unexpected errors. The most convenient way is to create new column with new type.



If you will have further difficulties with resolving the issue, please contact the support team via email : support@bpmonline.com

Show all comments

Here is the method that uses updateQuery.

 

 

 

 

 

//

// Here is the response I am getting

 

//

//

Here is the full response I get from the Uri: https://*.bpmonline.com/0/DataService/json/SyncReply/UpdateQuery

 

Like 0

Like

4 comments

Hello Jordan,

Most likely, in your request you are trying to operate with fields that are not presented in object that is modifying. 

I recommend such way to understand what is going on: Modify the object from bpm'online and catch the update request to the "dataservice" (via fiddler or on network tab in devtools). Caught request will be your example and you should compare 2 request: one that you caught and one that is not valid.



Also, you can find additional information in the article:

https://academy.bpmonline.com/documents/technic-sdk/7-13/dataservice-up…



Best regards,

Alex

Try switching the line on 419 from setColumnValue to setParameterValue. I believe setColumnValue takes different argument types.

Ryan

Ryan Farley,

Thank you Ryan, it appears that was the issue! Is setColumnValue for setting the columns alias?

 

Jordan Kincer,

Glad that was it.

Yes, setColumnValue takes two arguments, one for the column alias and one column expression object which defines an expression for the column. The setParameterValue is for setting the value of a column. 

https://academy.bpmonline.com/api/jscoreapi/7.12.0/index.html#!/api/Ter…

Ryan

Show all comments

How would I go about setting the default behaviour for the + button on an editable grid to add a row instead of opening the card?

Specifically, this is the Order page, with the OrderProduct detail.  The + button here

brings up this full page card:

I would like it to default instead to the blank row you get from ... -> New:

I have tried explicitly setting IsEditable to true when initializing the detail, but it doesn't seem to make a difference.  Where might I be able to change this?

Thank you.

Like 0

Like

6 comments

Hello Darian,



Actually, here is an article that describes how to achieve it:

https://academy.bpmonline.com/documents/technic-sdk/7-13/adding-detail-…



Also I have tested it on my local instance, here is an example how to do it with OpportunityProductDetailV2.



1. Create replacing client module for it

2. Put the code from below and save the schema.

 

define("OpportunityProductDetailV2", ["ConfigurationGrid", "ConfigurationGridGenerator",
    "ConfigurationGridUtilities"], function() {
    return {
        entitySchemaName: "OpportunityProductInterest",
        attributes: {
 
            "IsEditable": {
 
                dataValueType: Terrasoft.DataValueType.BOOLEAN,
 
                type: Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
                value: true
            }
        },
        mixins: {
            ConfigurationGridUtilities: "Terrasoft.ConfigurationGridUtilities"
        },
        diff: /**SCHEMA_DIFF*/[
            {
                "operation": "merge",
                "name": "DataGrid",
                "values": {
                    "className": "Terrasoft.ConfigurationGrid",
                    "generator": "ConfigurationGridGenerator.generatePartial",
 
                    "generateControlsConfig": {"bindTo": "generateActiveRowControlsConfig"},
                    "changeRow": {"bindTo": "changeRow"},
                    "unSelectRow": {"bindTo": "unSelectRow"},
                    "onGridClick": {"bindTo": "onGridClick"},
                    "activeRowActions": [
                        {
                            "className": "Terrasoft.Button",
                            "style": this.Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
                            "tag": "save",
                            "markerValue": "save",
                            "imageConfig": {"bindTo": "Resources.Images.SaveIcon"}
                        },
                        {
                            "className": "Terrasoft.Button",
                            "style": this.Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
                            "tag": "cancel",
                            "markerValue": "cancel",
                            "imageConfig": {"bindTo": "Resources.Images.CancelIcon"}
                        },
                        {
                            "className": "Terrasoft.Button",
                            "style": this.Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
                            "tag": "remove",
                            "markerValue": "remove",
                            "imageConfig": {"bindTo": "Resources.Images.RemoveIcon"}
                        }
                    ],
                    "initActiveRowKeyMap": {"bindTo": "initActiveRowKeyMap"},
                    "activeRowAction": {"bindTo": "onActiveRowAction"},
                    "multiSelect": {"bindTo": "MultiSelect"}
                }
            }
        ]/**SCHEMA_DIFF*/
    };
});

 

Alex_Tim,

I have done that, but it doesn't make a difference.  It does function as expected with OpportunityProductInterest, but OrderProduct still requires using ...->New to get a new line.

REf:

define("OrderProductDetailV2", ["ConfigurationGrid", "ConfigurationGridGenerator",
	"ConfigurationGridUtilities"], function() {
	return {
		entitySchemaName: "OrderProduct",
		attributes: {
			"IsEditable": {
				dataValueType: Terrasoft.DataValueType.BOOLEAN,
				type: Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
				value: true
			}
		},
		mixins: {
			ConfigurationGridUtilities: "Terrasoft.ConfigurationGridUtilities"
		},
		details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
		diff: /**SCHEMA_DIFF*/[
			{
				"operation": "merge",
				"name": "DataGrid",
				"values": {
					"className": "Terrasoft.ConfigurationGrid",
					"generator": "ConfigurationGridGenerator.generatePartial",
					"generateControlsConfig": {"bindTo": "generateActiveRowControlsConfig"},
					"changeRow": {"bindTo": "changeRow"},
					"unSelectRow": {"bindTo": "unSelectRow"},
					"onGridClick": {"bindTo": "onGridClick"},
					"activeRowActions": [
						// [Save] action setup.
						{
							"className": "Terrasoft.Button",
							"style": this.Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
							"tag": "save",
							"markerValue": "save",
							"imageConfig": {"bindTo": "Resources.Images.SaveIcon"}
						},
						// [Cancel] action setup.
						{
							"className": "Terrasoft.Button",
							"style": this.Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
							"tag": "cancel",
							"markerValue": "cancel",
							"imageConfig": {"bindTo": "Resources.Images.CancelIcon"}
						},
						// [Delete] action setup.
						{
							"className": "Terrasoft.Button",
							"style": this.Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
							"tag": "remove",
							"markerValue": "remove",
							"imageConfig": {"bindTo": "Resources.Images.RemoveIcon"}
						}
					],
					"initActiveRowKeyMap": {"bindTo": "initActiveRowKeyMap"},
					"activeRowAction": {"bindTo": "onActiveRowAction"},
					"multiSelect": false
				}
			}
		]/**SCHEMA_DIFF*/,
		methods: {}
	};
});

 

Darian Lewis,

Basically, I tried to apply the code that you sent and it works in a required way if you are trying to add the product via "new" button

http://prntscr.com/mprbvm



To make "plus" button behave as "new" button you should override the logic of the plus button.



Best regards,

Alex

Alex_Tim writes:

To make "plus" button behave as "new" button you should override the logic of the plus button.

Yes, that's what I'm asking for help with - I can't find where to override the plus button.

Darian Lewis,

The logic of "plus" button lays in "BaseGridDetailV2 module. This button is binded to "addRecord" method.

The logic of "new" button lays in "ConfigurationGridUtilities" module. This button is binded to "addRow" method.



So the solution is to override "plus" button and bind it to "addRow" method.



To achieve it, new replacing client module for "OrderProductDetailV2"  should be created and

the code from below should be inserted into the module.



define("OrderProductDetailV2", ["ConfigurationGridUtilities"], function() {

    return {

        entitySchemaName: "OrderProduct",

        messages: {},

        attributes: {},

        methods: {},

        diff: /**SCHEMA_DIFF*/[

            {

                "operation": "merge",

                "name": "AddRecordButton",

                "values": {

                    "click":{"bindTo":"addRow"}

                }

            }

        ]/**SCHEMA_DIFF*/

    };

});

 

Alex_Tim,

Thank you, that did the trick.

Show all comments

Hi colleagues,

I am searching for a way to add/remove fields to be copied when clicking the Copy button on Quote Section (section actions).

Could anyone, kindly, share any reference on how to customize that?

thanks a lot.

Like 0

Like

5 comments

Please modify the section edit page with a section wizard, then go to the configuration section, find a newly created UsrQuotesSection module, open it, add the "remove" block to the diff and save it. 

 

define("AccountSectionV2", [], function() {

    return {

        entitySchemaName: "Account",

        details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,

        diff: /**SCHEMA_DIFF*/[

            {

                "operation": "remove",

                "name": "DataGridActiveRowCopyAction"

            }

        ]/**SCHEMA_DIFF*/,

        methods: {}

    };

});


 

Eugene Podkovka,

Hi Eugene, thanks for your message. I am actually looking for a way to select what fields should be copied. For instance, when user copies a quote, I would like to copy 2 new fields (Usr´s fields) + the Product list (OpportunityProductInteress entries from the original quote).

Thanks

Danilo Lage,

You can select which fields are copied in the object designer, with the 'Make copy' checkbox.

Unfortunately, this doesn't work for the contents of detail objects.

Darian Lewis,

Hi Darian, thanks for you message. Appreciate.

Let´s implement the detail object copy, then.

Danilo Lage writes:

Darian Lewis,

Hi Darian, thanks for you message. Appreciate.

Let´s implement the detail object copy, then.

Any comments about this implementation?? 

Show all comments

Hi,

 

related to question https://community.bpmonline.com/questions/hide-run-process-button-side-panel-roles-1 ,

I would like to hide the run process button. https://prntscr.com/mmaait  

 

I tried by creating replacing client module but the result is not as expected:

1. create a replacing client module : https://prntscr.com/mma6zg

2. create the replacing client module with parent object "Upper menu module (NUI)" : 

https://prntscr.com/mma75s

3. copy all the source code and css from parent object "Upper menu module (NUI)"

source code : https://prntscr.com/mma7ah

Less tab : https://prntscr.com/mma7eq

4. however, the result is like this:

https://prntscr.com/mma7hv

 

what was wrong ? do you have any step-by-step process to hide the process button ? 

 

thank you

 

best regards,

 

Antonius

 

Like 0

Like

3 comments

Hello Antonius,



The issue you are facing is connected to missing schema resources. Most likely that you haven't indicated resource bindings in your replacing modlue "Upper menu module" . Please make sure that you have added LeftPanelTopMenuModuleResources" to module dependencies.

Basically,  "define" should look like this: define("LeftPanelTopMenuModule", ["LeftPanelTopMenuModuleResources"]



Best regards,

Alex

Alex_Tim,

Hi Alex,

 

thank you for your response.

I've added it as shown in this source code :  : https://prntscr.com/mma7ah

but, the result still like this : https://prntscr.com/mma7hv

 

regards,

Antonius

Antonius,

Hello Antonius,



Basically, step by step solution is:

1.Create replacing client module for "MainHeaderSchema"

2. Add attribute to it:

define("MainHeaderSchema", [], function() {

    return {

        attributes: {

            "isSysAdmin": {

            "type": Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,

            "dataValueType": Terrasoft.DataValueType.BOOLEAN,

            "value": false

        },

        }

    };

});



3. Create replacing client module for "LeftPanelTopMenu". Please note on getUserRights method and visible property of process menu item in loadMenu method.

4. Code of LeftPanelTopMenuModule:



define("LeftPanelTopMenuModule", ["LeftPanelTopMenuModuleResources", "LookupUtilities", "ConfigurationConstants",

"LeftPanelUtilitiesV2",

"HoverMenuButton", "CheckModuleDestroyMixin", "ProcessEntryPointUtilities",

"MaskHelper", "ProcessModuleUtilities",

"ServiceHelper", "MainMenuUtilities"], function(resources, LookupUtilities,

ConfigurationConstants, LeftPanelUtilities) {

    function createConstructor(context) {

        var Ext = context.Ext;

        var sandbox = context.sandbox;

        var Terrasoft = context.Terrasoft;

        

        /**

         * Left panel top menu module view model.

         */

        Ext.define("Terrasoft.LeftPanelTopMenuModuleViewModel", {

            extend: "Terrasoft.BaseViewModel",

            mixins: [

                "Terrasoft.CheckModuleDestroyMixin"

            ],

            Ext: null,

            Terrasoft: null,

            sandbox: null,

            

            

            getUserRights: function() {

                var scope = this;

                var currentUser = Terrasoft.SysValue.CURRENT_USER.value;

                var sysAdmins = ConfigurationConstants.SysAdminUnit.Id.SysAdministrators;

             var esq = Ext.create("Terrasoft.EntitySchemaQuery", { rootSchemaName: "SysUserInRole" });

                esq.addColumn("SysRole");

                esq.addColumn("SysUser");

                esq.filters.add("SysUser", Terrasoft.createColumnFilterWithParameter(

                Terrasoft.ComparisonType.EQUAL, "SysUser", currentUser));

                esq.filters.add("SysRole", Terrasoft.createColumnFilterWithParameter(

                Terrasoft.ComparisonType.EQUAL, "SysRole", sysAdmins));

                esq.getEntityCollection(function(response) {

                    if (response && response.success) {

                        var result = response.collection;

                        var isSysAdmin = (result.collection.length !== 0);

                        scope.set("isSysAdmin", isSysAdmin);

                    }

                }, this);

            },

                            

            /**

             * @inheritdoc Terrasoft.BaseViewModel#init

             * @override

             */

            init: function(callback, scope) {

                this.getUserRights();

                this.loadMenu();

                this.setSystemDesignerVisible();

                LeftPanelUtilities.on("collapsedChanged", this.onSideBarCollapsedChanged, this);

                this.set("Collapsed", LeftPanelUtilities.getCollapsed());

                callback.call(scope);

            },

            /**

             * Sets based on the configuration of the property is responsible for the display panel buttons "System Designer".

             * Responsible for showing and hiding "System Designer" button on the toolbar.

             * @private

             */

            setSystemDesignerVisible: function() {

                var isSystemDesignerVisible = !this.get("IsSSP");

                Terrasoft.SysSettings.querySysSettings(["BuildType"], function(sysSettings) {

                    var buildType = sysSettings.BuildType;

                    if (buildType && (buildType.value === ConfigurationConstants.BuildType.Public)) {

                        isSystemDesignerVisible = false;

                    }

                    this.set("IsSystemDesignerVisible", isSystemDesignerVisible);

                }, this);

            },

            /**

             * Returns main menu item config.

             * @param {Object} entity Main menu lookup value.

             * @return {Object} Main menu item config.

             */

            getConfigMenuItem: function(entity) {

                var uId = entity.get("IntroPageUId");

                var name = entity.get("Name");

                var tag = entity.get("Tag");

                return {

                    Id: uId,

                    Caption: name,

                    Tag: tag,

                    Class: "menu-item",

                    Click: {bindTo: "goToIntroPageFromMenu"},

                    canExecute: {bindTo: "canBeDestroyed"}

                };

            },

            /**

             * Fills the collection of the main menu items.

             * @protected

             */

            loadItemsMainMenu: function() {

                var esq = this.Ext.create("Terrasoft.EntitySchemaQuery", {

                    rootSchemaName: "ApplicationMainMenu",

                    isDistinct: true

                });

                esq.addColumn("Id");

                esq.addColumn("IntroPageUId");

                esq.addColumn("Name");

                esq.addColumn("[SysSchema:UId:IntroPageUId].Name", "Tag");

                esq.getEntityCollection(function(result) {

                    if (!result.success) {

                        return;

                    }

                    var menuCollection = this.Ext.create("Terrasoft.BaseViewModelCollection");

                    var entities = result.collection;

                    var mainMenuConfig = {

                        Id: "menu-menu-item",

                        Tag: "MainMenu",

                        Caption: resources.localizableStrings.mainManuMenuItemCaption,

                        Visible: {

                            bindTo: "IsSSP",

                            bindConfig: {

                                converter: function(value) {

                                    return !value;

                                }

                            }

                        }

                    };

                    var entitiesCount = entities.getCount();

                    if (entitiesCount === 0) {

                        mainMenuConfig.Class = "menu-item";

                        mainMenuConfig.Click = {bindTo: "goToFromMenu"};

                        menuCollection.add(mainMenuConfig.Id, this.Ext.create("Terrasoft.BaseViewModel", {

                            values: mainMenuConfig

                        }));

                    } else if (entitiesCount === 1) {

                        entities.each(function(entity) {

                            var menuItem = this.getConfigMenuItem(entity);

                            menuItem.Caption = mainMenuConfig.Caption;

                            menuCollection.add(menuItem.Id, this.Ext.create("Terrasoft.BaseViewModel", {

                                values: menuItem

                            }));

                        }, this);

                    } else {

                        mainMenuConfig.Type = "Terrasoft.MenuSeparator";

                        menuCollection.add(mainMenuConfig.Id, this.Ext.create("Terrasoft.BaseViewModel", {

                            values: mainMenuConfig

                        }));

                        entities.each(function(entity) {

                            var menuItem = this.getConfigMenuItem(entity);

                            menuCollection.add(menuItem.Id, this.Ext.create("Terrasoft.BaseViewModel", {

                                values: menuItem

                            }));

                        }, this);

                        var id = "end-menu-menu-item";

                        menuCollection.add(id, this.Ext.create("Terrasoft.BaseViewModel", {

                            values: {

                                Id: id,

                                Type: "Terrasoft.MenuSeparator"

                            }

                        }));

                    }

                    var mainMenuItems = this.get("MainMenuItems");

                    menuCollection.loadAll(mainMenuItems);

                    mainMenuItems.clear();

                    mainMenuItems.loadAll(menuCollection);

                }, this);

            },

            /**

             * Loads quick add menu items.

             * @protected

             */

            loadItemsQuickAddMenu: function() {

                var collection = this.get("quickAddMenu");

                collection.clear();

                var quickItems = Terrasoft.configuration.QuickAddMenu.QuickAddMenu;

                Terrasoft.each(quickItems, function(item) {

                    var id = item.itemId;

                    collection.add(id, this.Ext.create("Terrasoft.BaseViewModel", {

                        values: this.getItemQuickAddMenuConfig(id, item)

                    }));

                }, this);

            },

            /**

             * Gets config of the quick add menu item.

             * @private

             * @param {String} id Item id name.

             * @param {Object} item

             * @return {Object} Config of the quick add menu item.

             */

            getItemQuickAddMenuConfig: function(id, item) {

                var config = item.hasAddMiniPage ? {} : {

                    canExecute: {"bindTo": "canBeDestroyed"}

                };

                this.Ext.apply(config, {

                    Id: id,

                    Caption: item.name,

                    Click: {bindTo: "processQuickMenuClick"},

                    ModuleName: item.ModuleName,

                    Tag: id,

                    TypeColumnName: item.TypeColumnName,

                    TypeColumnValue: item.TypeColumnValue,

                    EditPageName: item.EditPageName,

                    EntitySchemaName: item.EntitySchemaName,

                    MiniPage: {

                        schemaName: item.miniPageSchema,

                        hasAddMiniPage: item.hasAddMiniPage

                    }

                });

                return config;

            },

            /**

             * Processes quick add menu item click.

             * @protected

             * @param {String} tag Tag value of quick add menu item.

             */

            processQuickMenuClick: function(tag) {

                var collection = this.get("quickAddMenu");

                var quickMenuItem = collection.get(tag);

                var moduleName = quickMenuItem.get("ModuleName") || "SysModuleEditManageModule";

                require([moduleName], function(module) {

                    if (module) {

                        module.Run({

                            sandbox: sandbox,

                            item: quickMenuItem

                        });

                    }

                });

            },

            /**

             * Returns query for reading available for running processes.

             * @private

             * @return {Terrasoft.EntitySchemaQuery} The Query to EntitySchema.

             **/

            _getRunProcessESQ: function() {

                var filters = [];

                filters.push(Terrasoft.createExistsFilter("[RunButtonProcessList:SysSchemaUId:UId].Id"));

                var esq;

                if (Terrasoft.ProcessEntryPointUtilities.getCanRunProcessFromSection()) {

                    esq = Terrasoft.ProcessModuleUtilities.createRunProcessESQ(filters);

                } else {

                    esq = Terrasoft.ProcessModuleUtilities.createRunProcessSelect(filters);

                }

                return esq;

            },

            /**

             * Return menu item view model.

             * @private

             * @param {Object} modelConfig Configuration object.

             **/

            _createMenuItem: function(modelConfig) {

                return this.Ext.create("Terrasoft.BaseViewModel", {

                    values: modelConfig

                });

            },

            /**

             * Fills caption to "Run process" menu.

             * @private

             * @param {Terrasoft.Collection} startProcessMenuItems Menu items collection.

             */

            _fillCaptionMenuItem: function(startProcessMenuItems) {

                var id = "caption-runprocess-menu-item";

                var modelConfig = {

                    Id: id,

                    Type: "Terrasoft.MenuSeparator",

                    Caption: resources.localizableStrings.RunProcessButtonMenuCaption

                };

                startProcessMenuItems.add(id, this._createMenuItem(modelConfig));

            },

            /**

             * Fills process record item to "Run process" menu.

             * @private

             * @param {Terrasoft.Collection} startProcessMenuItems Menu items collection.

             * @param {String} id Item id.

             * @param {String} caption Item caption.

             */

            _fillRunProcessMenuItem: function(startProcessMenuItems, id, caption) {

                var modelConfig = {

                    Id: id,

                    Caption: caption,

                    Click: {bindTo: "runProcess"},

                    canExecute: {bindTo: "canBeDestroyed"},

                    Tag: id,

                    MarkerValue: caption

                };

                startProcessMenuItems.add(id, this._createMenuItem(modelConfig));

            },

            /**

             * Fills separator to "Run process" menu.

             * @private

             * @param {Terrasoft.Collection} startProcessMenuItems Menu items collection.

             */

            _fillSeparatorMenuItem: function(startProcessMenuItems) {

                var id = "separator-runprocess-menu-item";

                var modelConfig = {

                    Id: id,

                    Type: "Terrasoft.MenuSeparator"

                };

                startProcessMenuItems.add(id, this._createMenuItem(modelConfig));

            },

            /**

             * Fills "open process page" item to "Run process" menu.

             * @private

             * @param {Terrasoft.Collection} startProcessMenuItems Menu items collection.

             */

            _fillOpenProcessPageMenuItem: function(startProcessMenuItems) {

                var id = "open-process-page";

                var modelConfig = {

                    Id: id,

                    Caption: resources.localizableStrings.AnotherProcessMenuItemCaption,

                    Click: {bindTo: "openProcessPage"},

                    Tag: id

                };

                startProcessMenuItems.add(id, this._createMenuItem(modelConfig));

            },

            /**

             * Returned clear startProcessMenu collection.

             * @private

             * @return {Terrasoft.Collection} Start process menu items.

             */

            _getClearedStartProcessMenuItems: function() {

                var startProcessMenuItems = this.get("startProcessMenu");

                startProcessMenuItems.clear();

                return startProcessMenuItems;

            },

            /**

             * Fills the collection menus global business process start button.

             */

            loadItemsStartProcessMenu: function() {

                var esq = this._getRunProcessESQ();

                esq.getEntityCollection(function(result) {

                    if (result.success) {

                        var startProcessMenuItems = this._getClearedStartProcessMenuItems();

                        var entities = result.collection;

                        if (!entities.isEmpty()) {

                            this._fillCaptionMenuItem(startProcessMenuItems);

                            var idColumnName = "Id";

                            var captionColumnName = "Caption";

                            entities.each(function(entity) {

                                var id = entity.get(idColumnName);

                                var caption = entity.get(captionColumnName);

                                this._fillRunProcessMenuItem(startProcessMenuItems, id, caption);

                            }, this);

                            this._fillSeparatorMenuItem(startProcessMenuItems);

                            this._fillOpenProcessPageMenuItem(startProcessMenuItems);

                        }

                        this.sandbox.publish("LoadedItemsStartProcessMenu");

                    } else {

                        throw new Terrasoft.QueryExecutionException();

                    }

                }, this);

            },

            /**

             * Returns view config.

             * @return {Object} View config.

             */

            getViewConfig: function() {

                var view = {

                    id: "side-bar-top-menu-module-container",

                    selectors: {

                        wrapEl: "#side-bar-top-menu-module-container"

                    },

                    classes: {

                        wrapClassName: ["top-menu-module-container"]

                    },

                    items: this.getTopMenuConfig()

                };

                return view;

            },

            /**

             * Returns menu object.

             * @return {Object}

             */

            loadMenu: function() {

                this.loadItemsStartProcessMenu();

                this.sandbox.subscribe("ResetStartProcessMenuItems", function() {

                    this.loadItemsStartProcessMenu();

                }, this);

                this.loadItemsQuickAddMenu();

                var menuCollection = this.Ext.create("Terrasoft.BaseViewModelCollection");

                var id = "process-menu-item";

                menuCollection.add(id, this.Ext.create("Terrasoft.BaseViewModel", {

                    values: {

                        Id: id,

                        Tag: "ProcessExecute",

                        Caption: resources.localizableStrings.processMenuItemCaption,

                        Click: {bindTo: "openProcessPage"},

                        Visible: {

                            bindTo: "IsSSP",

                            bindConfig: {

                                converter: function(value) {

                                    debugger;

                                    return !value;

                                }

                            }

                        }

                    }

                }));

                id = "collapse-menu-item";

                menuCollection.add(id, this.Ext.create("Terrasoft.BaseViewModel", {

                    values: {

                        Id: id,

                        Tag: "CollapseMenu",

                        Caption: this.getCollapseSideBarMenuItemCaptionConfig(),

                        Click: {bindTo: "collapseSideBar"}

                    }

                }));

                var workplaceMenu = this.getWorkplaceMenu();

                if (workplaceMenu.getCount() > 0) {

                    menuCollection.loadAll(workplaceMenu);

                }

                id = "system-designer-menu-item";

                menuCollection.add(id, this.Ext.create("Terrasoft.BaseViewModel", {

                    values: {

                        Id: id,

                        Tag: "IntroPage/SystemDesigner",

                        Caption: resources.localizableStrings.systemDesignerMenuItemCaption,

                        Click: {bindTo: "goToFromMenu"},

                        Visible: {bindTo: "IsSystemDesignerVisible"},

                        canExecute: {bindTo: "canBeDestroyed"}

                    }

                }));

                id = "profile-menu-item";

                menuCollection.add(id, this.Ext.create("Terrasoft.BaseViewModel", {

                    values: {

                        Id: id,

                        Tag: "UserProfile",

                        Caption: resources.localizableStrings.userProfileMenuItemCaption,

                        Click: {bindTo: "goToFromMenu"},

                        canExecute: {bindTo: "canBeDestroyed"}

                    }

                }));

                id = "exit-menu-item";

                menuCollection.add(id, this.Ext.create("Terrasoft.BaseViewModel", {

                    values: {

                        Id: id,

                        Tag: "Exit",

                        ClassName: "Terrasoft.MenuItem",

                        Caption: resources.localizableStrings.exitMenuItemCaption,

                        Click: {bindTo: "exitClick"},

                        canExecute: {bindTo: "canBeDestroyed"}

                    }

                }));

                var mainMenuItems = this.get("MainMenuItems");

                mainMenuItems.loadAll(menuCollection);

                this.loadItemsMainMenu();

            },

            /**

             * Returns collection of workplace models for workplace menu.

             * @return {Terrasoft.BaseViewModelCollection} Workplace models collection.

             */

            getWorkplaceMenu: function() {

                var workplaceMenuItems = this.Ext.create("Terrasoft.BaseViewModelCollection");

                var workplaces = Terrasoft.deepClone(

                    Terrasoft.configuration.WorkplacesStructure.Workplaces);

                if (workplaces.length > 0) {

                    var id = "separator-top-menu-item";

                    workplaceMenuItems.add(id, this.Ext.create("Terrasoft.BaseViewModel", {

                        values: {

                            Id: id,

                            Type: "Terrasoft.MenuSeparator",

                            Caption: resources.localizableStrings.workPlaceMenuItemCaption

                        }

                    }));

                    workplaces.sort(function(a, b) {

                        if (a.name < b.name) {

                            return -1;

                        }

                        if (a.name > b.name) {

                            return 1;

                        }

                        return 0;

                    });

                    Terrasoft.each(workplaces, function(item) {

                        if (item.hide) {

                            return;

                        }

                        var menuItemConfig = {

                            Caption: item.name,

                            Tag: item.workplaceId,

                            Click: {

                                bindTo: "workPlaceMenuItemClick"

                            },

                            Id: "workspace-" + Terrasoft.formatGUID(item.workplaceId, "N") + "-menu-item"

                        };

                        workplaceMenuItems.add(this.Ext.create("Terrasoft.BaseViewModel", {

                            values: menuItemConfig

                        }));

                    }, this);

                    id = "separator-botom-menu-item";

                    workplaceMenuItems.add(id, this.Ext.create("Terrasoft.BaseViewModel", {

                        values: {

                            Id: id,

                            Type: "Terrasoft.MenuSeparator"

                        }

                    }));

                }

                return workplaceMenuItems;

            },

            /**

             * Returns the top menu configuration.

             * @return {Object}

             */

            getTopMenuConfig: function() {

                var menuConfig = [

                    {

                        id: "collapse-button",

                        tag: "CollapseMenu",

                        className: "Terrasoft.HoverMenuButton",

                        style: Terrasoft.controls.ButtonEnums.style.TRANSPARENT,

                        classes: {

                            imageClass: ["button-image-size"],

                            wrapperClass: ["collapse-button-wrapperEl"]

                        },

                        imageConfig: resources.localizableImages.collapseIconSvg,

                        click: {

                            bindTo: "collapseSideBar"

                        },

                        hint: this.getCollapseSideBarMenuItemCaptionConfig(),

                        markerValue: this.getCollapseSideBarMenuItemCaptionConfig()

                    },

                    {

                        id: "menu-button",

                        tag: "MainMenu",

                        className: "Terrasoft.HoverMenuButton",

                        style: Terrasoft.controls.ButtonEnums.style.TRANSPARENT,

                        hint: {bindTo: "getMenuButtonHint"},

                        markerValue: resources.localizableStrings.MenuButtonHint,

                        classes: {

                            imageClass: ["button-image-size"],

                            wrapperClass: ["menu-button-wrapperEl"]

                        },

                        imageConfig: resources.localizableImages.menuIconSvg,

                        menu: {

                            items: {bindTo: "MainMenuItems"},

                            "alignType": "tr?",

                            "ulClass": "position-fixed"

                        },

                        delayedShowEnabled: {

                            bindTo: "Collapsed"

                        },

                        showDelay: this.get("ShowDelay"),

                        hideDelay: this.get("HideDelay")

                    },

                    {

                        id: "menu-startprocess-button",

                        tag: "StartProcessMenu",

                        className: "Terrasoft.HoverMenuButton",

                        style: Terrasoft.controls.ButtonEnums.style.TRANSPARENT,

                        hint: {bindTo: "getStartProcessMenuButtonHint"},

                        markerValue: resources.localizableStrings.StartProcessButtonHint,

                        classes: {

                            imageClass: ["button-image-size"],

                            wrapperClass: ["menu-startprocess-button-wrapperEl"]

                        },

                        imageConfig: resources.localizableImages.processIconSvg,

                        menu: {

                            items: {bindTo: "startProcessMenu"},

                            "alignType": "tr?",

                            "ulClass": "position-fixed"

                        },

                        click: {

                            bindTo: "startProcessMenuButtonClick"

                        },

                        visible: {

                            bindTo: "isSysAdmin",

                            bindConfig: {

                                converter: function(value) {

                                    return value;

                                }

                            }

                        },

                        delayedShowEnabled: {

                            bindTo: "Collapsed"

                        },

                        showDelay: this.get("ShowDelay"),

                        hideDelay: this.get("HideDelay")

                    },

                    {

                        id: "menu-quickadd-button",

                        tag: "quickAddMenu",

                        className: "Terrasoft.HoverMenuButton",

                        style: Terrasoft.controls.ButtonEnums.style.TRANSPARENT,

                        classes: {

                            imageClass: ["button-image-size"],

                            wrapperClass: ["menu-quickadd-button-wrapperEl"]

                        },

                        hint: {

                            bindTo: "getQuickAddHint"

                        },

                        markerValue: resources.localizableStrings.AddButtonHint,

                        imageConfig: resources.localizableImages.quickaddIconSvg,

                        menu: {

                            items: {bindTo: "quickAddMenu"},

                            "alignType": "tr?",

                            "ulClass": "position-fixed"

                        },

                        visible: {

                            bindTo: "IsSSP",

                            bindConfig: {

                                converter: function(value) {

                                    return !value;

                                }

                            }

                        },

                        delayedShowEnabled: {

                            bindTo: "Collapsed"

                        },

                        showDelay: this.get("ShowDelay"),

                        hideDelay: this.get("HideDelay")

                    }

                ];

                return menuConfig;

            },

            /**

             * Handles start process button click.

             * @protected

             * @return {boolean} Returns false for preventing default click handler.

             */

            startProcessMenuButtonClick: function() {

                var startProcessMenu = this.get("startProcessMenu");

                if (startProcessMenu.getCount() > 0) {

                    return false;

                }

                this.openProcessPage();

            },

            /**

             * Returns quick add menu button hint.

             * @return {String} Quick add menu button hint text.

             */

            getQuickAddHint: function() {

                return this.getHint(resources.localizableStrings.AddButtonHint);

            },

            /**

             * Returns start process menu button hint.

             * @return {String} Start process menu button hint text.

             */

            getStartProcessMenuButtonHint: function() {

                return this.getHint(resources.localizableStrings.StartProcessButtonHint);

            },

            /**

             * Returns menu button hint.

             * @return {String} Menu button hint text.

             */

            getMenuButtonHint: function() {

                return this.getHint(resources.localizableStrings.MenuButtonHint);

            },

            /**

             * Returns hint text.

             * When left panel state is collapsed, returns null.

             * @param {String} hint Hint text.

             * @return {String|null} Hint text.

             */

            getHint: function(hint) {

                var collapsed = this.get("Collapsed");

                if (!collapsed) {

                    return hint;

                }

                return null;

            },

            /**

             * Returns the configuration of the switching element collapsed left panel.

             * @return {Object}

             */

            getCollapseSideBarMenuItemCaptionConfig: function() {

                return {

                    bindTo: "Collapsed",

                    bindConfig: {

                        converter: this.getCollapseSideBarMenuItemCaption

                    }

                };

            },

            /**

             * Run the business process from the list of global processes start button.

             * @param {Object} tag UId business Process diagrams.

             */

            runProcess: function(tag) {

                Terrasoft.ProcessModuleUtilities.executeProcess({

                    sysProcessId: tag

                });

            },

            goTo: function() {

                var tag = arguments[3];

                var currentModule = this.sandbox.publish("GetHistoryState").hash.historyState;

                if (currentModule !== tag) {

                    Terrasoft.MaskHelper.ShowBodyMask();

                    this.sandbox.publish("PushHistoryState", {hash: tag});

                }

            },

            /**

             * @deprecated

             */

            replaceWindowLocation: function(location) {

                window.location.replace(location);

            },

            /**

             * Handles exit menu item click.

             * @private

             */

            exitClick: function() {

                Terrasoft.MainMenuUtilities.logout();

            },

            goToFromMenu: function(tag) {

                var currentHistoryState = this.sandbox.publish("GetHistoryState").hash.historyState;

                if (currentHistoryState !== tag) {

                    Terrasoft.Mask.show();

                    this.sandbox.publish("PushHistoryState", {hash: tag});

                }

            },

            goToIntroPageFromMenu: function(tag) {

                var currentHistoryState = this.sandbox.publish("GetHistoryState").hash.historyState;

                if (currentHistoryState !== tag) {

                    var hash = "IntroPage/" + tag;

                    this.sandbox.publish("PushHistoryState", {hash: hash});

                }

            },

            openProcessPage: function() {

                var vwSysProcessFilters = Terrasoft.createFilterGroup();

                vwSysProcessFilters.name = "vwSysProcessFiler";

                var sysWorkspaceFilter = Terrasoft.createColumnFilterWithParameter(

                    Terrasoft.ComparisonType.EQUAL, "SysWorkspace",

                    Terrasoft.SysValue.CURRENT_WORKSPACE.value);

                vwSysProcessFilters.addItem(sysWorkspaceFilter);

                var businessProcessTagFilter = Terrasoft.createColumnFilterWithParameter(

                    Terrasoft.ComparisonType.EQUAL, "TagProperty",

                    ConfigurationConstants.SysProcess.BusinessProcessTag);

                vwSysProcessFilters.addItem(businessProcessTagFilter);

                var isMaxVersionFilter = Terrasoft.createColumnFilterWithParameter(

                    Terrasoft.ComparisonType.EQUAL, "IsMaxVersion", true);

                vwSysProcessFilters.addItem(isMaxVersionFilter);

                var config = {

                    entitySchemaName: "VwSysProcess",

                    isRunProcessPage: true,

                    captionLookup: resources.localizableStrings.processLookupCaption,

                    multiSelect: false,

                    columnName: "Caption",

                    filters: vwSysProcessFilters,

                    hideActions: true

                };

                var handler = function(args) {

                    var activeItems = args.selectedRows.getItems();

                    if (!this.Ext.isEmpty(activeItems)) {

                        Terrasoft.ProcessModuleUtilities.executeProcess({

                            sysProcessId: activeItems[0].Id

                        });

                    }

                };

                LookupUtilities.Open(this.sandbox, config, handler, this, null, false, false);

            },

            collapseSideBar: function() {

                LeftPanelUtilities.changeCollapsed();

            },

            showESN: function() {

                var esnHash = "SectionModuleV2/ESNFeedSectionV2/";

                var currentModule = this.sandbox.publish("GetHistoryState").hash.historyState;

                if (currentModule !== esnHash) {

                    Terrasoft.MaskHelper.ShowBodyMask();

                    this.sandbox.publish("PushHistoryState", {hash: esnHash});

                }

            },

            /**

             * Returns the text for the switching element folding left panel.

             * @param {Boolean} isCollapsed Collapsed flag.

             * @return {String} The text for the switching element folding left panel.

             */

            getCollapseSideBarMenuItemCaption: function(isCollapsed) {

                if (this.Ext.isEmpty(isCollapsed)) {

                    isCollapsed = LeftPanelUtilities.getDefaultCollapsed();

                }

                if (isCollapsed) {

                    return resources.localizableStrings.expandSideBarMenuItemCaption;

                } else {

                    return resources.localizableStrings.collapseSideBarMenuItemCaption;

                }

            },

            workPlaceMenuItemClick: function(tag) {

                var workplaceItem = this.getWorkplaceData(tag);

                if (workplaceItem) {

                    this.sandbox.publish("ChangeCurrentWorkplace", tag);

                }

            },

            getWorkplaceData: function(workplaceId) {

                var workplaces = Terrasoft.configuration.WorkplacesStructure.Workplaces;

                var workplaceItem = null;

                if (workplaces.length > 0) {

                    Terrasoft.each(workplaces, function(item) {

                        if (item.workplaceId === workplaceId) {

                            workplaceItem = item;

                        }

                    }, this);

                }

                return workplaceItem;

            },

            /**

             * Handler of the changes Hide left panel.

             * @param {Boolean} isCollapsed Collapsed attribute.

             */

            onSideBarCollapsedChanged: function(isCollapsed) {

                this.sandbox.publish("ChangeSideBarCollapsed", isCollapsed);

                this.set("Collapsed", isCollapsed);

                this.sandbox.publish("ChangeGridUtilitiesContainerSize");

            }

        });

        Ext.define("Terrasoft.configuration.LeftPanelTopMenuModule", {

            extend: "Terrasoft.BaseModule",

            isAsync: false,

            viewModel: null,

            viewModelClassName: "Terrasoft.LeftPanelTopMenuModuleViewModel",

            render: function(renderTo) {

                this.generate(renderTo);

            },

            init: function(callback, scope) {

                var viewModel = this.viewModel = this.getViewModel();

                callback = callback || Ext.emptyFn;

                scope = scope || this;

                viewModel.init(function() {

                    callback.call(scope);

                }, this);

            },

            getViewModel: function() {

                return Ext.create(this.viewModelClassName, {

                    Terrasoft: Terrasoft,

                    Ext: Ext,

                    sandbox: sandbox,

                    values: {

                        Collapsed: false,

                        quickAddMenu: Ext.create("Terrasoft.BaseViewModelCollection"),

                        startProcessMenu: Ext.create("Terrasoft.BaseViewModelCollection"),

                        MainMenuItems: Ext.create("Terrasoft.BaseViewModelCollection"),

                        IsSystemDesignerVisible: true,

                        IsSSP: (Terrasoft.CurrentUser.userType === Terrasoft.UserType.SSP),

                        ShowDelay: 0,

                        HideDelay: 20

                    }

                });

            },

            generate: function(container) {

                var viewModel = this.viewModel;

                var view = this.view;

                if (!Ext.isEmpty(viewModel) && !Ext.isEmpty(view)) {

                    view.destroy();

                }

                var viewConfig = viewModel.getViewConfig();

                view = Ext.create("Terrasoft.Container", Terrasoft.deepClone(viewConfig));

                view.bind(viewModel);

                view.render(container);

                Terrasoft.MaskHelper.HideBodyMask();

            }

        });

        return Terrasoft.configuration.LeftPanelTopMenuModule;

    }

    return createConstructor;

});

 

 

Show all comments

Hi all,

I created a process lauched where Users are Created / Modified / Deleted.

Seems that the events are no triggered on this table.

Is it Possible ?

Like 0

Like

2 comments

Dear Jerome,

To create such process we recommend using object "Users (view)". Can you please specify if this is the object you used? 

Angela Reyes,

No I used "System administration object". I will try yours and give you a feedback. Thank you.

Show all comments

Dear all,

 

When opening an email in the communications pane, the user can bind this mail to an object: http://prntscr.com/mj72zr

Is there a way to change the order of these options?

For example: first option is Invoice, second option is Lead, ...

 

Kind regards,

Vincent

Like 0

Like

3 comments

Dear Vincent,

There are no basic tools to change the order of the option in this detail. We received similar requests from multiple customers and our R&D team will implement the functionality that will allow to modify the detail. As for now, you can change the order of the options by adjusting the code of the detail schema in the advanced configurations. 

Best regards,

Dean

Dean Parrett,

Hi Dean,

Thanks for the info.

I have been looking for this code, but could't find it. Do you have any idea in which file it can be found?

Kind regards,

Vincent

Dear Vincent,

The detail schema that you need to modify is EntityConnectionLinksResourceUtilities. Note, that you will not be able to edit the base schema unless it is replaced with the custom one.

Best regards,

Dean

Show all comments