Memory Threshold issue when filter large size data from DB- Any solution

Certified Associate Developer

In my application, the DB contains the fields (id,name,unit,type,isActive). The name and unit values are retrieved based on the type and shown in the UI dropdown and that is the List.

One Particular type contains 13000+ active records and gives Memory Threshold issue when it tries to load the data. In the expression rule, the batch size as set as -1 to retrieve all the data's from DB. 

To avoid this exception, I added the batch size as 100 in a!pagingInfo(). But the problem is now able to see only the 100 records in dropdown field and not all the 13000+records.

 Is there any other option is available to resolve this problem.

Regards

Martina

  Discussion posts and replies are publicly visible

Parents
  • Hi Martina

    A single drop-down with 13000+ records is pretty unwieldy. You might want to consider some alternate patterns:

    • Can you categorize the data so that you can have two related dropdowns, the first to pick a category and the second to pick from a subset of the records that are in the selected category? For example: you might have a list of cars, so the first category might be the manufacturer of the car and the second the specific model.
    • Do your users have any pre-knowledge of what might be in the list? Could you use a custom picker component and let the user type into it something that would return a subset of the records?
  • 0
    Certified Associate Developer
    in reply to Stewart Burchell

    Thank you, Stewart.

    Unfortunately, not able to categorize the data right now.

    In actual the Custom Picker field should be implemented in the Row List. But I tried with Single Custom Picker field.

    While search, the filter shows only value "1" and throws the exception when the value is selected.

       

    Code Snippet:

    a!localVariables(

      local!selectedName,

      local!selectedRecord:rule!DSC_GetProductNameByType(cons!DSC_CONS_PRODUCTTYPES[2]),

      local!recordLabels: local!selectedRecord.productName,

      local!recordValues: local!selectedRecord.id,

      a!sectionLayout(

        contents:{

          a!pickerFieldCustom(

            label: "Product Name",

            placeholder: "Enter Name",

            maxSelections: 1,

            suggestFunction: rule!ucArrayPickerFilter(filter: _, labels: local!recordLabels, identifiers: local!recordLabels),

            selectedLabels: a!forEach(

              items: local!selectedName,

              expression: index(

                local!recordLabels,

                wherecontains(

                  touniformstring(fv!item), 

                  touniformstring(local!recordValues)

                )

              )

            ),

            value: local!selectedName,

            saveInto: local!selectedName

          )

        }

    )

    )

  • 0
    Certified Lead Developer
    in reply to Martina Joseph

    The trick with the custom picker is, to put the database query inside the suggest function.

Reply Children
No Data