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 0

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

Show all comments

I created a custom service following this guide: https://academy.bpmonline.com/documents/technic-sdk/7-12/how-create-custom-configuration-service. The GET method works as expected but when I created a POST endpoint, the only response I get is 403. Actually sending POST request to any endpoint ends up with this error. My class looks like this:

[ServiceContract]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
public class UsrCustomService: BaseService
{
	[OperationContract]
	[WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
	public bool PostTest()
	{
		return true;
	}
 
	[OperationContract]
	[WebInvoke(Method = "GET", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
	public string GetTest()
	{
		return "Hello world";
	}
}

Do you know how can I fix it?

Like 0

Like

7 comments

Dear Carlos,

This error indicated that you are forbidden to insert into the object. This usually happens, when the user, whose login details you are using to connect does not have rights to write to the indicated object.

Please double check the rights for the object per user you are authenticating with.

Regards,

Anastasia

Anastasia Botezat,

Hm, I'm not inserting into any objects here, the service just returns constant values (for now). I'm also authenticating with Supervisor account.

Carlos,

Please check the CSRF header in your request. Probably, you don't pass CSRF cookie and therefore get the error - https://academy.bpmonline.com/documents/technic-sdk/7-12/protection-csrf-attacks-during-integration-bpmonline

If this won't help. please contact our support at support@bpmonline.com, since it's hard to say what's wrong with the request as we don't see the request body and the request headers. Please, use Fiddler as a proxy and send us a full text of the request from Fiddler. This way we will be able to find the cause of issue.

Regards,

Anastasia

Carlos Zaldivar Batista,

How are you calling the configuration service? Is it from within a client schema or from externally using code or something like postman? 

Ryan 

Ryan Farley,

Postman. And before making request to UsrCustomService I first make a request to /ServiceModel/AuthService.svc/Login to obtain authentication cookies.

Carlos Zaldivar Batista,

Are you also copying the contents of the BPMCSRF cookie on the call to AuthService.svc/Login to the CSRF header for the request to the config service? 

This article in the academy outlines the steps for making this call via Postman https://academy.bpmonline.com/documents/technic-sdk/7-13/how-call-confi…

Ryan Farley,

Nope, that's what I was missing. Thanks!

Show all comments

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 0

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…;

 

Show all comments

Hi Community,

 

How can I sort the the records in detail using the client code

Like 0

Like

3 comments

Dear Fulgen,

You may use and example described here: https://community.bpmonline.com/articles/how-sort-records-date-modifica…

Angela Reyes,

Hi Angela,

Thanks for your answer, but I don't need to create a query anymore since I am using already a detail, is there any property under it that can sort the list by column

Fulgen Ninofranco,

I recommend you to use entityschemaquery like Angela said, but if it`s not an option there is one more way to achieve it.



Also, please note on attributes of GridDetail: sortColumn, sortColumnDirection, sortColumnIndex.

It will look something like this: 

"sortColumn": {"bindTo": "sortColumn"},
"sortColumnDirection": {"bindTo": "GridSortDirection"},
"sortColumnIndex": {"bindTo": "SortColumnIndex"}

Also, more about details you can find here:

https://academy.bpmonline.com/documents/technic-sdk/7-13/details-0

Best regards,

​​​​​​​Alex

 

 

Show all comments

Hi Community,

 

How can i create radio button field like in opportunity page

 

Like 0

Like

1 comments

Hi Community,

 

I want to create a PAGE, this page can add record but instead of adding one record at a time I want its behavior like in adding product in order page (all products were listed already, you can enter multiple records and save).

 

Like 0

Like

1 comments

Hello.

You can use a detail with the selection from a lookup for this purpose. The step by step guide is available in the article below:

https://academy.bpmonline.com/documents/technic-sdk/7-13/creating-detai…

Best regards,

Matt

Show all comments

Hi Community,

How can I create an excel file then send this excel file as email attachment using script task.

Like 0

Like

1 comments

Hello Fulgen!



Usually, we recommend to create business process for this purpose. It `s more convenient to develop and maintain it later. To generate excel file you can use "EPPlus" library which is frequently updated and comes under the GNU public license. There are some useful links below, please check it.



How to send email with attachments:  https://community.bpmonline.com/questions/email-attachments-business-pr…



Generate printable and send is as attachment:

https://community.bpmonline.com/articles/generate-printable-and-send-it…



Library "EPPlus":

https://github.com/JanKallman/EPPlus



Developing the configuration server code in the user project:

https://academy.bpmonline.com/documents/technic-sdk/7-13/developing-con…



Best regards,

Alex

 

Show all comments

Hi,

I don't know how create an automation:

 

when I create an event, I need send SMS to contact for notice of that 1 day before appointment.

 

How can to do it?

Like 0

Like

1 comments

I have a detail that can have long texts, as shown on the picture:

Is it possible to make the long text collapsible, so that it is shown only when user click's it intentionally? If not, do you have other ideas about how to present this data?

Like 0

Like

2 comments

Hello Carlos!



Unfortunately, we have no out-of-the-box functionality that you required. You can achieve it only via development.



The idea is to create custom css that will hide long text and js method that will show it when you clicked on a row. FYI: method that triggers when you click on a row is called "onActiveRowAction". I attached useful links that might help you below.



Work with row selection :https://community.bpmonline.com/articles/add-button-active-row-detail



Custom css: 

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

https://academy.bpmonline.com/documents/technic-sdk/7-12/advanced-setti…



Best regards,

Alex

Alex_Tim,

Thank you, it should work.

EDIT: I think I managed to do that with only CSS. I added this rule to my detail:

 

#UsrCommunicationDetailDetailControlGroup > div > div.grid-listed-row:not(.grid-row-selected) div {
	white-space: nowrap;
	text-overflow: ellipsis;
	overflow: hidden;
}

 

Show all comments

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 0

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

Show all comments