Question

Limit for selected rows?

Hello,

 

I'm trying to run a process for the selected records from a section. I've been using this example

and it's working.

https://academy.bpmonline.com/documents/technic-sdk/7-13/handling-selection-several-records-examples

The problem is that the collection I'm getting (from this.get("SelectedRows")) contains maximum 60 records, although I've selected more than 100 records.

Is there a records limit? Do I need to get the next records using other method?

 

Thank you,

Cristian Galatan.

 

 

 

Like 0

Like

4 comments

The records aren't getting loaded all at once, but by small parts while a page is being scrolled down in order to optimize the loading. 

In order to obtain all selected records in js code please explore how the same functionality was implemented in the action "Export to excel".

I have analyzed the code and found the following root method.

getSelectedRowsEsq: function() {

            const esq = this.getGridDataInitializedEsq(true);

            const selectedRows = this.getSelectedItems();

            const selectAllModeEnabled = this.$SelectAllMode;

            if ((!this.Ext.isEmpty(selectedRows) && this.$MultiSelect) || selectAllModeEnabled) {

                esq.filters.clear();

                esq.filters.addItem(selectAllModeEnabled

                        ? this._getSelectAllModeFilters()

                        : this.Terrasoft.createColumnInFilterWithParameters(this.primaryColumnName, selectedRows));

            }

            return esq;

        }

 

Alina Kazmirchuk,

Thank you Alina. I will check this.

Hi Cristian,



I am encountering the same. Have you found a way how to retrieve all the records from Select All?

Hello,

 

Try performing visa versa operation - get all records that are not checked when all records are checked and perform a mass operation.

 

IMPORTANT NOTE: we strongly don't recommend developing such a logic of mass actions (especially when a section contains millions of records) since your app can crash when triggering this logic.

 

Here is an example of a mass updateQuery executed for all records selected in the Opportunity section (button click event handler):

setAllDone: function() {
				var update = this.Ext.create("Terrasoft.UpdateQuery", {
                                rootSchemaName: "Opportunity"
                            });
				const unselectedItems = this.getUnselectedItems();
				if (!Ext.isEmpty(unselectedItems)) {
					unselectedItems.forEach(function(item) {
						update.filters.addItem(Terrasoft.createColumnFilterWithParameter(Terrasoft.ComparisonType.NOT_EQUAL, "Id", item));
					});
					update.filters.logicalOperation = Terrasoft.LogicalOperatorType.AND;
				} else {
					const isNotNull = update.createIsNotNullFilter(Ext.create("Terrasoft.ColumnExpression", {columnPath: "Id"}));
					update.filters.addItem(isNotNull);
				}
				update.setParameterValue("UsrToUncheck", true, this.Terrasoft.DataValueType.BOOLEAN);
				update.execute(function() {
                            this.reloadGridData();
                        }, this);
			},

The filter is required anyway since when performing an update without a filter this message is received:

Note how the getUnselectedItems method was used there. It returns an array of records that are not selected in the list.

 

In your case you need to use the logic similar to the one I shared above.

Show all comments