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
Hi Martina
A single drop-down with 13000+ records is pretty unwieldy. You might want to consider some alternate patterns:
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
}
The trick with the custom picker is, to put the database query inside the suggest function.