Sorting on Task Report Not Working

A Score Level 1

 I have created a task report but the sorting seems to be broken for the three columns I am showing...I am not sure what I'm missing here as I followed the tutorial and all else is working as expected:

load(
 local!pagingInfo: a!pagingInfo( startIndex: 1, batchSize: - 1),
 local!statusFilter: 4,
with(
 local!report: a!queryProcessAnalytics( report: cons!FOB_MY_TASKS_REPORT,
   query: if( local!statusFilter = 4, {},
     a!query(
       filter: a!queryFilter( field: "c5", operator: "=", value: local!statusFilter),
   pagingInfo: local!pagingInfo ))
    ),
 a!sectionLayout(
  firstColumnContents: {
    a!dropdownField(
      label: "Status",
      choiceLabels: {"All", "Accepted", "Assigned", "Completed", "Not Started"},
      choiceValues: {4, 1,0, 2, 3 },
      value: local!statusFilter,
      saveInto: { local!statusFilter, a!save(local!pagingInfo.startIndex, 1)}
       ),
   a!gridField(
     label: local!report.name,
     instructions: local!report.description,
     totalCount: local!report.totalCount,
     columns: {
      a!gridTextColumn(
         label: "Name",
         field: local!report.data.c0,
         data: index(local!report.data, "c0", {} ),
         links: apply(a!processTaskLink( task: _), index( local!report.data, "dp0", {}))
           ),
      a!gridTextColumn(
         label: "Received",
         field: local!report.columnConfigs[2].field,
         data: apply(rule!FOB_displayDate(_), index( local!report.data,"c2", {}))
           ),
     a!gridTextColumn(
         label: "Assigned To",
         field: local!report.columnConfigs[7].field,
        data: apply( rule!FOB_displayPeople(_), index( local!report.data, "c8", {} ))
         ),
},
  value: local!pagingInfo,
   saveInto: local!pagingInfo
)
}
)
)
)

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Hi Gabi (gabriellal) ,

    Please use the below syntax.

     

    a!gridTextColumn(

            label: "Name",

            field: "c0",

            data: index(local!report.data, "c0", {} ),

            links: apply(a!processTaskLink( task: _), index( local!report.data, "dp0", {}))

              ),

         a!gridTextColumn(

            label: "Received",

            field: "c2",

            data: apply(rule!FOB_displayDate(_), index( local!report.data,"c2", {}))

              ),

        a!gridTextColumn(

            label: "Assigned To",

            field: "c8",

           data: apply( rule!FOB_displayPeople(_), index( local!report.data, "c8", {} ))

            ).

     

    And also the sorting will work as per the original process report values not the display values in grid.

     

     

  • +2
    A Score Level 1
    in reply to Rama Thummala

    Thanks! I ended up figuring out the issue on my own...in case anyone is curious it was an error in the way my query was set up...I realized sorting was working if the status was anything but "All" so in order to fix it I had to adjust the filters for when local!statusFilter = 4. The following fixed it:
    query: if(
    local!statusFilter = 4,
    a!query(
    filter: a!queryFilter(
    field: "c5",
    operator: "in",
    value: {0,1,2,3}
    ),
    pagingInfo: local!pagingInfo
    ),
    a!query(
    filter: a!queryFilter(
    field: "c5",
    operator: "=",
    value: local!statusFilter
    ),
    pagingInfo: local!pagingInfo
    )
    )

     

    Only after this fix does the sorting work if the field is set to local!report.columnConfigs[1].field for example

Reply
  • +2
    A Score Level 1
    in reply to Rama Thummala

    Thanks! I ended up figuring out the issue on my own...in case anyone is curious it was an error in the way my query was set up...I realized sorting was working if the status was anything but "All" so in order to fix it I had to adjust the filters for when local!statusFilter = 4. The following fixed it:
    query: if(
    local!statusFilter = 4,
    a!query(
    filter: a!queryFilter(
    field: "c5",
    operator: "in",
    value: {0,1,2,3}
    ),
    pagingInfo: local!pagingInfo
    ),
    a!query(
    filter: a!queryFilter(
    field: "c5",
    operator: "=",
    value: local!statusFilter
    ),
    pagingInfo: local!pagingInfo
    )
    )

     

    Only after this fix does the sorting work if the field is set to local!report.columnConfigs[1].field for example

Children
No Data