Question

When I compiled my bpm'online application an error occured (error : Object reference not set to an instance of an object) , what I need to know is the reason of this error, also I want to know if the compilation process has log files somewhere , and how can I access them.

 

Like

1 comments

Dear Mohamad,

This error does not include any meaningful information that can explain what happened. I recommend you to check the logs (Error file in directory like %windows%temp%bpmonline%) - it should contain details of this error. 

Best regards,
Angela

Log in or register to comment
Question

 

I have a button in a page , when I press that button , it performs a save and close operation.Also in this page I have a virtual detail, the problem is that when I press the button no data is saved in the page object when the page is in combinet Mode , if I refresh the page (no longer in combinet mode) and click the button the data is saved

- The code of the Approval Button is :

onApprovalButtonClicked: function(){
 
 
var self= this;
self.set("StStatus", {value: "BFBE5A54-08C6-4830-AE3F-09969C626C4B", displayValue:"Closed"});
self.save();
if (self.tryShowNextPrcElCard()) {
	return;
}
var isLastProcessElement = self.get("IsProcessMode") && !self.get("NextPrcElReady");
if ((self.get("IsInChain") || self.get("IsSeparateMode")) || isLastProcessElement) {
if (!self.destroyed) {
	self.sandbox.publish("BackHistoryState");
}
return;
}
self.sandbox.publish("CloseCard", null, [self.sandbox.id]);
self.hideBodyMask();
 
}

 

- it gives me that error when the button is pressed:

Uncaught Terrasoft.UnsupportedTypeException: Message DetailValidated is not defined in CardModuleV2 (SectionModuleV2_StWorkOrder1Section_CardModuleV2) module 

 

Like

1 comments

Hello Mohammad,
 

To fix the issue please flush Redis and compile all items. That should do the trick. 

Regards,
Alex

Log in or register to comment
Question

In the contact section page , when I click on a contact record , it opens in combinet mode, what I want is when I click on any contact record in the contact section page in first time, I want to open the contact record in Edit mode not in combined mode.

- Combined mode

yy

- when I refresh the page , it's no longer in combined mode 

Like

1 comments

Dear Mohamad,

Unfortunately, this is a hard encoded functionality and the basic application tools do not allow to set it up. We already had similar request and our R&D team will consider developing the functionality that will allow to set up the vertical view in the future application releases. 

Best regards,

Dean

Log in or register to comment
Article

Understanding of core system tables are really important for a successful work with bpm'online on advanced level. Especially, if you work as a system administrator or a developer. The article in the attached file can be useful if you want to gain more knowledge on the topic. 

Share

0 comments
Log in or register to comment
Question

I am following the instructions in the academy page (https://academy.bpmonline.com/documents/technic-sdk/7-13/adding-detail-…) to create an editable list.  When I get to part 2 (Creating a Detail Schema), it says to inherit BaseGridDetailV2 base detail list schema functions, and the picture shows "Base schema - Details with list ( NUI )."  I don't see an option with the NUI in the list, but if I choose the one that is there then I get an error message "Substitution of Modules is not Allowed."  

 

These are the options I have to choose from:

 

I have looked for "BaseGrid" and "base detail list", but there are no options to choose from.  Are these instructions still up to date?

Like

2 comments

The instructions said to add a new Module, but I found that it works if I use a "Schema of the Detail View Model with List" instead.  It works fine doing it this way.

Hello Timothy,

Try to choose "Schema of the Detail View Model with List" option when adding a new module instead of "Module" options. It should help.

Best regards,
Alex

Log in or register to comment
Question

I created a module that I used to generate a custom  comboBoxEdit  view  (lookup/dropdown) , then I used that module in another page (load the component)  , and the view created successfully but without data.

To be more clear:

1- Code of my Custom Module 

define("UsrDropDownGenerator", ["ext-base", "terrasoft", "sandbox"], function (Ext, Terrasoft, sandbox) {
    Ext.define("Terrasoft.configuration.UsrDropDownGenerator", {
        alternateClassName: "Terrasoft.UsrDropDownGenerator",
        extend: "Terrasoft.BaseModule",
       
        Ext: null,
        sandbox: null,
        Terrasoft: null,
        viewModel: null,
        
        view: null,
      
        init: function () {
            debugger;
            this.callParent(arguments);
            this.initViewModel();
        },

        initViewModel: function () {
           debugger;
            var self = this;
            
            this.viewModel = Ext.create("Terrasoft.BaseViewModel", {
                values: {
                    
                    booleanValueColumnList: Ext.create("Terrasoft.Collection")
                },
                columns: {
                    
                    booleanValueColumnList: {
                        type: Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
                        name: "booleanValueColumnList",
                        isCollection: true,
                    }
                    
                },
                methods: {

                     getColumnList: function (filters, list) {
                         
                         debugger;
                       if (list === null) {
                            return;
                        }
                        list.clear();
                        var columns = {};
                       for (var x = 0; x < 4; x++) 
                          {
                                            
                                var value1 = {
                                displayValue: "qq",
                                value:"1"
            
                              };
                            columns[x] = value1;
                          } 
            
                            list.loadAll(columns);
                            
                    },
                    
                    simpleFilterColumnChange  :function(args){
                        debugger;
                    }
                }
            });
            
        },
        
        render: function (renderTo) {
                 

 // This is executed on the module initialization, right after the init method.

            
              this.view = this.Ext.create("Terrasoft.Container", {
            
                items: [
                    Ext.create("Terrasoft.Container", {
                        renderTo: renderTo,
                    
                        items: [
                            {
                                width: "300px",
                                markerValue: "testMarker",
                                rightIconClasses: ["combobox-edit-right-icon"],
                                className: "Terrasoft.ComboBoxEdit",
                                list: {
                                    bindTo: "booleanValueColumnList"
                                },
                                prepareList: {
                                    bindTo: "getColumnList"
                                },
                                change: {
                                    bindTo: "simpleFilterColumnChange"
                                }
                                
                            }
                            
                        ]
                    })
                ]
            });
            
            
          
            this.view.bind(this.viewModel);
            
            
            return this.view;
        },

       
        destroy: function () {
            
            this.view.destroy();
           
            this.viewModel.destroy();
        }
    });
    debugger;
    
    return Terrasoft.UsrDropDownGenerator;
});
 

2- Code of my page  

......

        methods: {
                             
            onEntityInitialized:function(){
                
                this.callParent(arguments);
                
                var configObj = {
                       data : [{label : "Name" , description:"hh"},{label:"Age" , description : "10"},{label:"Job" , description : "bb"}]
                };
                                      
                this.sandbox.loadModule("UsrDropDownGenerator", {
                        renderTo: "centerPanel", //name of the container where visual module view will be displayed
                        keepAlive: true
                });
                
            },
        
            
        },

 

The dropdown was created successfully and appeared in the page  , but it does not contains any data.

When I click the dropdown ,  the getColumnList() function executed and the data are saved in the list , but no data appear in UI .

Why the data are not filled in the dropdown  , where is the problem in my code?

 

Like

1 comments

Hello,

Unfortunately, it`s hard to tell why exactly this code is not applying.

I can recommend you another, easier way to achieve it . If I understood you right, the task is to create dropdown with some values. 
To achieve it you can simply create new object that will store all the data, and add the new lookup field to the page via section wizard.

Also, you can create some custom styles for this field, more about styles can be found here: https://community.bpmonline.com/questions/how-add-custom-style-control-… and here https://community.bpmonline.com/articles/how-add-or-edit-css-style

Best regards,
Alex
 

Log in or register to comment
Question

How can I set a color value as an attribute? 

I have tried something similar to the below but it didnt work out:

attributes:{
  "labelCaption": {
		    "dataValueType": Terrasoft.DataValueType.TEXT,
		    "type": Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
		    "value": "Test"
		   },
 
   "labelColor": {
		    "dataValueType": Terrasoft.DataValueType.COLOR,
		    "type": Terrasoft.ColorEncoding.HEX,
		    "value":"#009900"
		   }
}

Although labelCaption is working fine but labelColor is not

Like

5 comments

Hello Mohammad,

The code that you provided is working and attribute "labelColor" is storing "#009900". If this behavior is not something that you expected, please specify more accurately what are you trying to achieve.

In case you want to create some custom styles for html elements we recommend to use CSS styles instead:  https://academy.bpmonline.com/documents/technic-sdk/7-13/advanced-setti…

Best regards,
Alex

You can do this by adding a CSS module, then add this module to your page, and then specify the CSS class using the wrapClass element.

See the following for creating a CSS module:

https://community.bpmonline.com/articles/how-add-or-edit-css-style

https://community.bpmonline.com/questions/how-add-custom-style-control-…

Once you created your CSS, simply add the CSS class to the element using wrapClass. For example:

{
	"operation": "insert",
	"name": "PaymentAmount",
	"values": {
		"layout": {
		"colSpan": 12,
		"rowSpan": 1,
		"column": 0,
		"row": 1,
		"layoutName": "Tab01"
	},
	"bindTo": "PaymentAmount",
	"wrapClass": [
		"payment-amount-highlight"
	]},
	"parentName": "Tab00",
	"propertyName": "items",
	"index": 2
}

Ryan

Im trying to set the color and the text to certain values based on some conditions at runtime.. Here is the rest of the code

//In Diff
{
"operation": "insert",
"name": "HeaderLabel2",
"values": {
"itemType": 6,
	"classes": {
		"labelClass": [
			"results-caption"
		]
	},
	"layout": {
		"colSpan": 10,
		"rowSpan": 1,
		"column": 0,
		"row": 0,
		"layoutName": "Header"
		},
	"caption": {
		"bindTo": "labelcaption"
	},
	"styles": {
		"labelStyle": {
			"color":{
				"bindTo": "labelColor"
			} 
		}
	}
},
"parentName": "Header",
"propertyName": "items",
"index": 0
},
 
//In onEntityInitialized method
 
if(//some condition)
  this.set("labelColor","#ff0000");
  this.set("labelcaption", "Message Testing"));

However, as I said before, labelcaption is working fine but lableColor isnt

Mohammad Yahfoufi,

The response on this post shows you how to change the label color based on conditions: 

https://community.bpmonline.com/questions/how-add-custom-style-control-…

Ryan

Ryan Farley,

Thanks! This will work.. But why doing it as an attributes wont work?

 

Log in or register to comment
Question

I want to add borders to all dropdowns/lookups in the system.

How can I achieve that?

Like

4 comments

Dear Mohammad,

Hope you are doing well today.

If you need to change the size of the lookup fields on a page, you can do it through the section wizard. Here is the article for more details. Please refer to the paragraph 'How to set up field location on a page'

https://academy.bpmonline.com/documents/administration/7-13/how-set-pag…

Best regards,

Dean

Dear Dean Parrett,

Hope you are doing good as well.

What I wanted is to have all my dropdowns as the dropdown of the filter i.e. the field have borders and the dropdown icon is always visible. 

 

Thank you in advance!

 

Mohammad Yahfoufi,

To achieve it you simply should add your custom css styles. Here is some links that will be helpful for you.

How to add css style: 

https://community.bpmonline.com/articles/how-add-or-edit-css-style

Css style based on condition:
https://community.bpmonline.com/questions/how-add-custom-style-control-…

Advanced settings of a custom detail:
https://academy.bpmonline.com/documents/technic-sdk/7-13/advanced-setti…

Best regards,
Alex

 

Thank you Alex! 

Log in or register to comment
Question

When I click the detail row , it disappear , and a white background appear , I wonder what is the problem.

Note : I'm  working with a custom detail with list

 

Like

2 comments

this is my code

 

define("StFriendAndFamilyNumbersDetail", ["StFriendAndFamilyDetailResources", "ConfigurationGrid", "ConfigurationGridGenerator",
    "ConfigurationGridUtilities", "StServiceViewModel", "css!StServiceDetailCSS"], function (resources) {
    var detailData =[];
    var isAddMode =false;
    var isFirstTime = true;
return {
    entitySchemaName: "StFriendAndFamilyDetail",
    mixins: {
        ConfigurationGridUtilities: "Terrasoft.ConfigurationGridUtilities"
    },
    attributes: {
        "StNameFilter": {
            "dataValueType": Terrasoft.DataValueType.TEXT
        },
        "IsEditable": {
            "dataValueType": Terrasoft.DataValueType.BOOLEAN,
            "type": Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
            "value": false
        },
        "PageNumber": {
            "dataValueType": Terrasoft.DataValueType.INTERGER,
            "type": Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
            "value": 0
        },
        "NumberOfRecords": {
            "dataValueType": Terrasoft.DataValueType.INTERGER,
            "type": Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
            "value": 15
        }
    },
    methods: {
        sortColumn: this.Terrasoft.emptyFn,
        loadGridData: this.Terrasoft.emptyFn,
        loadFilter: function () {
            this.set("PageNumber", 0);
            var gridData = this.getGridData();
            if (gridData) {
                gridData.clear();
                this.set("IsDetailCollapsed", false);
                this.loadSearchItems(
                    this.get("StNameFilter"),
                    this.get("PageNumber"),
                    this.get("NumberOfRecords"),
                    gridData
                );
            }
        },
        loadMore: function () {
            var pageNumber = this.get("PageNumber");
            this.set("PageNumber", ++pageNumber);
            var gridData = this.getGridData();
            if (gridData) {
                this.loadSearchItems(
                    this.get("StNameFilter"),
                    this.get("PageNumber"),
                    this.get("NumberOfRecords"),
                    gridData
                );
            }
        },
        generateActiveRowControlsConfig: function (id, columnsConfig, rowConfig) {
            debugger;
            this.columnsConfig = columnsConfig;
            var gridLayoutItems = [];
            var currentColumnIndex = 0;
            this.Terrasoft.each(columnsConfig, function (columnConfig) {
                var columnName = columnConfig.key[0].name.bindTo;
                var column = this.getColumnByColumnName(columnName);
                var cellConfig = this.getCellControlsConfig(column);
                cellConfig = this.Ext.apply({
                    layout: {
                        colSpan: columnConfig.cols,
                        column: currentColumnIndex,
                        row: 0,
                        rowSpan: 1
                    }
                }, cellConfig);
            /*    if (cellConfig.name === "StServiceParams") {
                    this.set("ComboBoxCollection", new this.Terrasoft.Collection());
                    cellConfig.contentType = Terrasoft.ContentType.ENUM;
                    cellConfig = this.Ext.apply({
                        controlConfig: {
                            list: {
                                bindTo: "ComboBoxCollection"
                            },
                            prepareList: {
                                bindTo: "getComboBoxItems"
                            },
                            change: {
                                bindTo: "ontServiceParamsChange"
                            }
                        }
                    }, cellConfig);
                    cellConfig.enabled = true;
                }
                else {
                    cellConfig.enabled = false;
                }*/
                gridLayoutItems.push(cellConfig);
                currentColumnIndex += columnConfig.cols;
            }, this);
            var gridData = this.getGridData();
            var activeRow = gridData.get(id);
            var options = activeRow.values;
            activeRow.setOptions(options);
            var viewGenerator = this.Ext.create("Terrasoft.ViewGenerator");
            viewGenerator.viewModelClass = { prototype: this };
            var gridLayoutConfig = viewGenerator.generateGridLayout({
                name: this.name,
                items: gridLayoutItems
            });
            console.log(gridLayoutConfig);
            rowConfig.push(gridLayoutConfig);
        },
    
    /*    onSubmitDetail: function () {
            var selectedRows = this.get("SelectedRows");
            if (selectedRows && selectedRows.length > 0) {
                for (var i = 0; i < selectedRows.length; i++) {
                    var selectedItem = this.getGridData().collection.getByKey(selectedRows[i]);
                }
                debugger;
                // TODO selected items processing logic
            }
            else {
                this.showInformationDialog("There isn't any selected item");
            }
        },*/
        init: function (callback, scope) {
            this.set("PageNumber", 0);
            this.callParent([
                function () {
                    var gridData = this.getGridData();
                    if (gridData) {
                        gridData.clear();
                        this.set("IsDetailCollapsed", false);
                        this.loadSearchItems( null, this.get("PageNumber"),
                        this.get("NumberOfRecords"), gridData);
                    }
                    callback.call(scope);
                }, this
            ]);
        
        
            this.sandbox.subscribe("SendDetailData", function (arg) {
                    debugger;
                     detailData = arg.array;

                    this.UpdateRatePlanServices();

                }, this, ["SendDetailDataKey"]);
                
                
            this.sandbox.subscribe("GetDetailData", function (arg) {
                   debugger;
                   var gridData = this.getGridData();
                   var array=[];
        
                if(isFirstTime){
                    
                    isFirstTime=false;
                    
                    for (var i = 0; i < gridData.collection.items.length; i++) {
                           
                           var item = gridData.collection.items[i];
                           var obj={};
                        obj.Id = item.values.StId;
                        obj.PhoneNumber = item.values.StPhoneNumber;
                        obj.ContractId = item.values.StContractId;
                        
                        array.push(obj);
                           
                       }
                       
                    return array;
                    
                }else{
                    
                    return detailData;
                    
                }
                   
                    
           }, this, ["GetDetailDataKey"]);
        
        
        },
        onDetailCollapsedChanged: function () {
            this.callParent(arguments);
            if (!this.get("IsDetailCollapsed")) {
                this.set("PageNumber", 0);
                var gridData = this.getGridData();
                if (gridData) {
                    gridData.clear();
                    this.loadSearchItems( null, this.get("PageNumber"),
                    this.get("NumberOfRecords"), gridData);
                }
            }
        },
        loadSearchItems: function (nameFltr, pageNb, nbOfRecords, gridData) {
    
            debugger;

            var contractId = this.sandbox.publish("GetContractIDMessage", null, ["GetContractIDMessageKey"]);
            
            this.set("MaskId", Terrasoft.Mask.show({ timeout: 0 }));
            this.set("IsGridEmpty", true);
            this.set("IsGridLoading", true);
            this.set("IsGridDataLoaded", false);
            
            if(detailData == null || detailData == "" || detailData == []){
                
                var serviceConfig = {
                    serviceName: "StContractManagerService",
                    methodName: "GetFriendAndFamilyNumbers",
                    timeout: 120000,
                    data: { 
                        contractId: contractId
                    }
                };
                isAddMode = false;
            }else{
                
                var serviceConfig = {
                    serviceName: "StContractManagerService",
                    methodName: "ConstructFriendAndFamilyDetail",
                    timeout: 120000,
                    data: { 
                        array: JSON.stringify(detailData)
                    }
                };
                    isAddMode = true;
            }
            
            this.callService(serviceConfig, function (responseJson) {
                this.set("IsGridLoading", false);
                this.set("IsGridDataLoaded", true);
                if (!this.Ext.isEmpty(responseJson)) {
                    
                        if(!isAddMode){ 
                            var response = this.Ext.decode(responseJson.GetFriendAndFamilyNumbersResult);
                        }else{
                            var response = this.Ext.decode(responseJson.ConstructFriendAndFamilyDetailResult);
                        }
                        
                    if (response.success) {
                            console.log(response);
                        if (response.rowsAffected > 0) {
                            this.set("IsGridEmpty", false);
                            this.set("CanLoadMoreData", response.canShowMore);
                            var esq = this.Ext.create("Terrasoft.EntitySchemaQuery", {
                                rootSchemaName: "StFriendAndFamilyDetail",
                                rowViewModelClassName: "Terrasoft.StServiceViewModel"
                            });
                            esq.parseResponse(response, function (result) {
                                if (result.success) {
                                    console.log(result);
                                    var resultCollection = result.collection;
                                    resultCollection.each(function (item) {
                                    item.init(this);
                                    }, this);
                                    gridData.loadAll(result.collection);
                                    this.prepareResponseCollection(resultCollection);
                                    Terrasoft.Mask.hide(this.get("MaskId"));
                                    
                                    
                                }
                                else {
                                    this.showInformationDialog(result.errorInfo);
                                    Terrasoft.Mask.hide(this.get("MaskId"));
                                }
                            }, this);
                        }
                        else {
                            this.set("CanLoadMoreData", false);
                            Terrasoft.Mask.hide(this.get("MaskId"));
                        }
                    }
                    else {
                        this.set("CanLoadMoreData", false);
                        this.showInformationDialog(response.errorInfo.message);
                        Terrasoft.Mask.hide(this.get("MaskId"));
                    }
                }
            }, this);
        },
    
        UpdateRatePlanServices: function(){
            var gridData = this.getGridData();
                    if (gridData) {
                        gridData.clear();
                        this.set("IsDetailCollapsed", false);
                        this.loadSearchItems( null, this.get("PageNumber"),
                        this.get("NumberOfRecords"), gridData);
                    }
            },
    
        
        onActiveRowAction: function (buttonTag,primaryColumnValue) {
                debugger;
                switch (buttonTag) {
                case "someButton":
                //this.onSomeButtonClicked(primaryColumnValue);
                break;
                default:
                break;
                }
        },
                
    },
    messages: {
            "SendDetailData": {
                mode: Terrasoft.MessageMode.PTP,
                direction: Terrasoft.MessageDirectionType.SUBSCRIBE
            },
             "GetDetailData":
             {
                mode: Terrasoft.MessageMode.PTP,
                direction: Terrasoft.MessageDirectionType.SUBSCRIBE
            },
            "GetContractIDMessage": {
                mode: Terrasoft.MessageMode.PTP,
                direction: Terrasoft.MessageDirectionType.PUBLISH
            },

        },
    diff: /**SCHEMA_DIFF*/[
        {
            "operation": "merge",
            "name": "DataGrid",
            "parentName": "Detail",
            "values": {
                "className": "Terrasoft.ConfigurationGrid",
            //    "generator": "ConfigurationGridGenerator.generatePartial",
                "generateControlsConfig": { "bindTo": "generateActiveRowControlsConfig" },
                /*"changeRow": { "bindTo": "changeRow" },*/
                "multiSelect": true
            },
            "index": 0
        },

    {
                "operation": "merge",
                "name": "DataGrid",
                "values": {
                    "activeRowAction": {"bindTo": "onActiveRowAction"},
                    "activeRowActions": []
                    
                }
            },
            {
                "operation": "insert",
                "name": "DataGridActiveRowSomeButton",
                "parentName": "DataGrid",
                "propertyName": "activeRowActions",
                "values": {
                    "className": "Terrasoft.Button",
                    "style": Terrasoft.controls.ButtonEnums.style.GREEN,
                    "caption": "Details",
                    "tag": "someButton"
                }
            },
    
            
    
    ]
    /**SCHEMA_DIFF*/
};
});
 

Hello Mohamad!

To resolve this problem you should debug js client code. Here you can read additional information about debugging client code:
https://academy.bpmonline.com/documents/technic-sdk/7-13/client-code-de… 

If I got this right, method "generateActiveRowControlsConfig" triggers when user clicks on row, so you should pay an extra attention to it.

Best regards,
Alex

Log in or register to comment
Question

Hello,

I created a custom virtual detail and I fill it with data , I have column called 'url' and I want to make its value linkable .

Like

2 comments

I made my text controls on the Edit page of a record clickable hyperlinks with the help of this question https://community.bpmonline.com/articles/creating-custom-web-link-field

Log in or register to comment