Question about customer picker field

Hi, I'm using a custom picker field in my UI. Say I have 1000 data to search for, but i want the custom picker field to only show 20 suggestions with each keyword I typed. Is there any way to do that?

OriginalPostID-214635

OriginalPostID-214635

  Discussion posts and replies are publicly visible

Parents
  • @erick258 - As suggested by @prosenjitd you have to write expression in suggestion function which will return data from database based on the filter entered by user.
    For e.g - your ucArrayPickerFilter will contain following code snippet, Input parameters will be filter which will be value or _ from arraypicker -
    with(
    local!data:a!queryEntity(
    entity:ri!entity,
    query:a!query(
    selection:{
    a!querySelection(
    columns:a!queryColumn(field:"companyName")
    )
    },
    filter:a!queryFilter(
    field:"companyName",
    operator:"includes",
    value:ri!filter
    ),
    pagingInfo:a!pagingInfo(
    startIndex:1,
    batchSize:20
    )
    )
    ),

    type!DataSubset(data: index(local!data,"companyName"), identifiers: index(local!data,"companyName"))

    )

    In your current code the suggestion function was trying to search for matching filter in 20 records which were already loaded in the local variable. You have to fetch data as user enters characters.

    If the data that you are trying to use in suggestion function is less you can just change local paging info to

    local!pagingInfo:a!pagingInfo(1,-1) - which will fetch all the records and filter on it and your code will work fine.
Reply
  • @erick258 - As suggested by @prosenjitd you have to write expression in suggestion function which will return data from database based on the filter entered by user.
    For e.g - your ucArrayPickerFilter will contain following code snippet, Input parameters will be filter which will be value or _ from arraypicker -
    with(
    local!data:a!queryEntity(
    entity:ri!entity,
    query:a!query(
    selection:{
    a!querySelection(
    columns:a!queryColumn(field:"companyName")
    )
    },
    filter:a!queryFilter(
    field:"companyName",
    operator:"includes",
    value:ri!filter
    ),
    pagingInfo:a!pagingInfo(
    startIndex:1,
    batchSize:20
    )
    )
    ),

    type!DataSubset(data: index(local!data,"companyName"), identifiers: index(local!data,"companyName"))

    )

    In your current code the suggestion function was trying to search for matching filter in 20 records which were already loaded in the local variable. You have to fetch data as user enters characters.

    If the data that you are trying to use in suggestion function is less you can just change local paging info to

    local!pagingInfo:a!pagingInfo(1,-1) - which will fetch all the records and filter on it and your code will work fine.
Children
No Data