Hi all, I am trying to set the 'sort' parameter 'pagingInfo' of

Hi all, I am trying to set the 'sort' parameter 'pagingInfo' of query record with multiple fields. But I am getting the following error when trying to do so : "Expression evaluation error at function 'queryrecord': Error evaluating function 'queryrecord' : Cannot sort by multiple fields."
Here goes my configuration:
pagingInfo: 'type!PagingInfo'(
          startIndex:1,
          batchSize:-1,
          sort:{{field:"firstName", ascending:true()},{field:"lastName", ascending:true()}}
)
Did I do any mistake in the configuration? Or do pagingInfo of queryrecord() doesn't accept sortinfo array? Bu the same 'sort' configuration worked fine when passed to a query rule. I am just curious to know why the same 'sort' configuration which worked fine when passed to query rule isn't working when passed to 'pagingInfo' in 'query' parameter of queryrecord().
Thanks in advance....

OriginalPostID-78481

OriginalPostID-78481

  Discussion posts and replies are publicly visible

Parents
  • Here is an approach you could try:
    1) Collect your data using the queryrecord() function with one or no sort
    2) Define a paging info using rule!APN_pagingInfo(sort: {{field: "field1", ascending: true}, {field: "field1", ascending:true}, ... }) which will allow you to pass in an array
    3) todatasubset(local!data, local!pagingInfo)
    4) use data from (3) to populate your grid/chart etc.
Reply
  • Here is an approach you could try:
    1) Collect your data using the queryrecord() function with one or no sort
    2) Define a paging info using rule!APN_pagingInfo(sort: {{field: "field1", ascending: true}, {field: "field1", ascending:true}, ... }) which will allow you to pass in an array
    3) todatasubset(local!data, local!pagingInfo)
    4) use data from (3) to populate your grid/chart etc.
Children
No Data