In 7.5 we were using the APN functions for displaying records and dashboards. i

In 7.5 we were using the APN functions for displaying records and dashboards. i.e. rule!APN_uiSectionOneColumn, rule!APN_uiPagingGrid,rule!APN_uiGridTextColumnAuto. If there is an empty todatasubset and we tried to display the grid it would display nicely with "No Records found".

We are trying to upgrade to 7.7 but are getting the following error on the same code if there are no records in the grid to display.

Expression evaluation error in rule 'apn_uigridtextcolumnauto' (called by rules 'apn_uipaginggrid' > … > 'apn_uirecorddashboardonecolumn' > 'so_ca_activeevents_dashboard') at function 'reduce' [line 2]: Invalid index: Cannot index property 'commentType' of type Text into type List of Variant (APNX-1-4198-000)

What is the easiest way to fix this error. I have a lot of dashboards that will need to be changed for upgrading to 7.7.

Here is the code for one of the dashboards:
=load(
pagingInfo: topaginginfo(1, 10),
with(
dataSubset: to...

OriginalPostID-128059

OriginalPostID-128059

  Discussion posts and replies are publicly visible

Parents
  • Hi Leslie, i was able to recreate the issue in 7.7. In your case, you could replace each rule!APN_uiGridTextColumnAuto with rule!APN_uiGridTextColumn or if you have a large number of forms to be edited, you can simply edit the expression rule APN_uiGridTextColumnAuto in your common objects folder and replace the contents with that of below -

    =with(
    indexData: if(or(isnull(ri!data),length(ri!data)=0),{},reduce(fn!index, ri!data, split(ri!field, "."))),
    a!gridTextColumn(
    label: ri!label,
    field: ri!field,
    data: if(or(isnull(ri!formatter),length(indexData)=0), indexData, apply(ri!formatter, indexData)),
    alignment: ri!alignment
    )
    )
Reply
  • Hi Leslie, i was able to recreate the issue in 7.7. In your case, you could replace each rule!APN_uiGridTextColumnAuto with rule!APN_uiGridTextColumn or if you have a large number of forms to be edited, you can simply edit the expression rule APN_uiGridTextColumnAuto in your common objects folder and replace the contents with that of below -

    =with(
    indexData: if(or(isnull(ri!data),length(ri!data)=0),{},reduce(fn!index, ri!data, split(ri!field, "."))),
    a!gridTextColumn(
    label: ri!label,
    field: ri!field,
    data: if(or(isnull(ri!formatter),length(indexData)=0), indexData, apply(ri!formatter, indexData)),
    alignment: ri!alignment
    )
    )
Children
No Data