Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
5 replies
Subscribers
7 subscribers
Views
2834 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
User Interface
In 7.5 we were using the APN functions for displaying records and dashboards. i
lesliem
over 10 years ago
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
0
lesliem
over 10 years ago
...datasubset(rule!SO_CA_GetCommentsByCorpAction(rf!caDetailsId), pagingInfo),
if(dataSubset.totalCount=0,{},
rule!APN_uiSectionOneColumn(
label: "Comments",
contents:
{
rule!APN_uiPagingGrid(
label: "",
columns: {
rule!APN_uiGridTextColumnAuto(
label: "Comment Type",
field: "commentType",
data: dataSubset.data
),
rule!APN_uiGridTextColumnAuto(
label: "Comment",
field: "comment",
data: dataSubset.data
),
rule!APN_uiGridTextColumnAuto(
label: "Comment Added By",
field: "commentBy",
data: dataSubset.data
),
rule!APN_uiGridTextColumnAuto(
label: "Comment Date / Time",
field: "commentDateTime",
data: dataSubset.data
)
},
pagingInfo: pagingInfo,
totalCount: dataSubset.t...
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
lesliem
over 10 years ago
...otalCount
)
}
)
)
)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
lesliem
over 10 years ago
=load(
pagingInfo: topaginginfo(1, 10),
with(
dataSubset: todatasubset(rule!SO_CA_GetCommentsByCorpAction(rf!caDetailsId), pagingInfo),
if(dataSubset.totalCount=0,{},
rule!APN_uiSectionOneColumn(
label: "Comments",
contents:
{
rule!APN_uiPagingGrid(
label: "",
columns: {
rule!APN_uiGridTextColumnAuto(
label: "Comment Type",
field: "commentType",
data: dataSubset.data
),
rule!APN_uiGridTextColumnAuto(
label: "Comment",
field: "comment",
data: dataSubset.data
),\ t
rule!APN_uiGridTextColumnAuto(
label: "Comment Added By",
field: "commentBy",
data: dataSubset.data
),
rule!APN_uiGridTextColumnAuto(
label: "Comment Date / Time",
field: "commentDateTime",
data: dataSubset.data
)\t
},
pagingInfo: pagingInfo,
totalCount: dataSubset.totalCount
)
}
)
)
)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
abhi.jana
Appian Employee
over 10 years ago
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
)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
lesliem
over 10 years ago
Thanks, that worked great. I will be changing all of the forms.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel