Question

I need to edit organizational roles and show some additional fields in its page. can we do this by replacing object ? or what is the best approach and how can we do it?

Like

1 comments

Dear Ayman,

Unfortunately as for now there is no possibility to change the org.role page with the help of out-of-the-box tools of the application and we do have a correspondent problem registered on our side.

As for now theoretically the only one way to change them is with the help of the replacing object, but we should warn you that it is risky to do, because roles like "All employees" and "System administrators" are used almost everywhere in the application and making some changes to them can lead to some new errors. Actually we don't recommend performing changes to this object, but if you want to try - please use dev-instance or local instance.

Best regards,

Oscar

Log in or register to comment
Question

I am using the Update Query to save an object programmatically. I also created a business process that is triggered when this object is updated.

After updating the object programmatically using Update Query, the process is not triggered.

Is there any methods on the business layer that i can use for this purpose?

Like

2 comments

Hello.

The business process cannot be triggered after the direct update in the database. That is done on purpose. You can create another process that would do the update for you, the updates made by the business process trigger other business processes. However, we do not recommend you to do this for large batches of records.

Best regards,

Matt

We used Entity.Save() method and it worked. https://academy.bpmonline.com/api/SDKNETAPI/7.7.0/Terrasoft.Core~Terras… 

 

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

Hi, 

I have developed an editable List Grid Detail (derived from BaseGridDetailV2). The detail is added to OrderProductPage.

The entity schema (table) for this detail has the following columns:

  - OrderProductId (Lookup field from OrderProduct table)

  - AssetId (Lookup field from custom asset table)

Assets are linked to Account. The detail is rendered properly however I want to filter the Asset field in the detail based on the opened Order's Account field (Detail screenshot attached). Currently it lists, all the records from the Asset table

Any Ideas on how this can be achieved?

Thank you

 

Like

1 comments

Hello,

You can add filtering rules on the edit page for the detail and it will be honored in the detail editable list. Edit the page for the detail and add the filtering rule there.

Ryan

Log in or register to comment
Question

Hi, 

What is the difference between Amount and Primary Amount fields in the following tables: 

 - Order

 - OrderProduct

There are some other fields with primary counterparts like (Total, TaxAmount) in OrderProduct and InvoiceProduct tables. I have seen the orders section documentation on Academy but only the "Amount" field is documented. Similarly, what is the rationale of having Quantity and BaseQuantity fields in OrderProduct table?

In addition, is there any Use Case where these fields have a different value. Like Amount and Primary Amount fields with a different value.

Thank you,

Like

1 comments

Dear Hatim, 

Regarding to the Primary Amount there is no such column in the base configuration, could you please specify the column name?

Regarding to the Base quantity: when editing product you can add units of measure that indicate the number of pieces in singular product transaction (pieces, packages, etc.) When choosing anything besides pieces you specify the amount of pieces (when choosing pieces the correspondence to the Quantity is 1 to 1). See the first screenshot in attachments. After that when you add product on the detail you specify in which units it would be purchase (See the 2nd screenshot). After adding product Base quantity is updated following the equation Quantity * Pieces in unit and Total is calculated as Base quantity * price (See the 3rd screenshot). When the Quantity is updated the Base quantity gets updated and the Total is recalculated.
https://prnt.sc/lz06nz
https://prnt.sc/lz06y7
https://prnt.sc/lz0735
Here is the example, lets say that I want to ship bottles of water and i want to ship them in packages of 6 bottles. In this case i add unit measure of package in my product and set the number of units in a package to 6. When I add this product on a detail and add packages as unit of measure if i choose to ship 1000 packages the quantity would be 1000, the Base Quantity, however, would be 6000 as I ship 6*1000 bottles in total. The total cost would be calculated based on the Base quantity amount. 

Best regards,
Dennis

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
Question

Hi, 

I am modifying the Case object in a business process which triggers on the following events:

 - Record Modified (case object)

 - Record Added (case object) 

The modify business process element causes the Record modified event to be triggered and the business process is called again. Is there a way to suppress event generation when I modify the record with Modify Data business process element?

Thanks,

Like

3 comments

Dear Hatim,

You can select fields which must be modified to trigger this element(changes expected -> in any of the selected fields).

Best regards,
Angela

Angela Reyes,

Thank you Angela. I understand that with "Changes Expected" the trigger can be constrained to go off on changes to specific fields. 

I have a use case in which I am modifying one of the Case field in a business process which is included in the "Changes Expected" list of fields. We need the business process to only trigger when the changes are made to this field from user interface however when we change it from business process using (Modify Data) element, the trigger should be suppressed. Is there a way of achieving this? 

Regards,

Hatim Hussain,

Can you please specify what's the difference between changes made by users and changes made by BP? Why do you need to divide them, what is your business task? Since you can use filters for data modified (for example start process only if case status was modified to In progress) it is unclear why do you need to divide users and BP. 

Log in or register to comment
Question

Hi, 

Is there a way to search a contact from command line by any other attribute apart from Full Name (mobile number for example). bpm'online by default searches the search term entered into command line by comparing the search term against full name.

Like

3 comments

Hello,

By default if you enter the phone number the system will show you all records where this number is present. If you see that the global search returns you full name that means either that indexation for the section is disabled (please check it in the section wizard like on the screenshot http://prntscr.com/la5mpt) or that global search is deactivated for your instance. If so you need to create a support request by writing an email to support@bpmonline.com and you need to tell the name of the instance and also provide information on this problem in the email.

Best regards,

Oscar

Oscar Dylan,

Thank you Oscar for your response. 

Is it also available in v 7.11?

Hatim Hussain,

The functionality of Global Search became available earlier then 7.11 version and if you want to find out the version when it was added then you need to search in release notes here https://academy.bpmonline.com/documents/bpmonline-release-notes-7-13-0. As for indexation in sections - then it became available in 7.12.3 version of the instance.

Please also note that you have on-site instance then you need to follow this article https://academy.bpmonline.com/documents/administration/7-12/global-sear… to set it up.

Best regards,

Oscar

Log in or register to comment
Question

Hi All,

I have this requirement of generating single Invoices for Multiple Orders placed in Specific month.

I understand that in the Out of the Box feature, BPM'Online supports in selecting multiple records and generate invoice but it generates that many number of Invoices. In other words, if I select 7 Orders using Multi-select in Orders Section and select the Invoice, it has downloaded for me 7 Invoices which is not what I would need.

Is there a way to loop through the selected Order record and generate Invoice which includes all the selected Order details.

Kindly suggest.

Like

2 comments

Hello! 

You can do it via printables. DevExpress printables allows downloading data for multiple records. Set-up any DevExpress printable, turn on "show in section" button, select multiple records and print them. It will create a single file with data from all selected records. 

Best regards,
Angela

I have not tried this, but it should be possible in a Business Process.  Initialize the invoice, Order is not a required field.  Loop through each order and add its products to the invoice.  Add anything else you want.

Log in or register to comment
Question

What are the conditions to filter and get the "Overdue invoices"?

Like

1 comments

Hello.

First of all, the invoices do not have the due date out of the box, but you can use the date field instead. You need to add a condition, that the date is less than the current date and the invoice status is not final.

Best regards,

Matt

Log in or register to comment