Default sorting in detail

Hello creatio community,

 

I have created a column into the object "RegDocumentType" named "Order". This object is used as a foreign key in "DocListInFinApp" which is displayed in "FinAppLendingPage" screen.

 

I want to apply a default sorting by RegDocumentType.Order in FinAppLendingPage as below:

"DocListInFinAppDetail": {
	"schemaName": "DocListInFinAppDetail",
	"filter": {
		"masterColumn": "Id",
		"detailColumn": "FinApplication"
	},
	"sortColumn": "Document",
	"sortColumnDirection": Terrasoft.OrderDirection.ASC,
	"sortColumnIndex": 0
},

 

The filter applied its working when I open the page. Do you have any suggestions on how to fix it?

Like 0

Like

1 comments

Hello,

 

In case you need to modify the default sorting you need to use the initQuerySorting method override (should be done in the detail schema and also replace the "UsrOrderColumn" with the column you need to use for sorting):

initQuerySorting: function(esq) {
                    const sortedColumn = esq.columns.find("UsrOrderColumn");
                    if (!sortedColumn) {
                        return;
                    }
                    sortedColumn.orderPosition = 0;
                    sortedColumn.orderDirection = Terrasoft.OrderDirection.DESC;
                },

Once saved you can refresh the page and the default sorting will be changed.

Show all comments