119941 - no subject - Hi All,\n\nAm getting below error for al

Hi All,

Am getting below error for all the entity backed reports
Expression evaluation error in rule 'queryrecord' (called by rules 'getreportdetails' > 'dailyreport') [line 19]: The a!queryAggregation function has an invalid value for the “aggregationColumns” parameter. “aggregationColumns” must not be null or empty.

Please let me know if anyone of you faced and fixed this?
Regards,
Madhu
...

OriginalPostID-119941

  Discussion posts and replies are publicly visible

  • This error may occur due to null or empty value being passed to a!queryAggregation function. Can you share your code snippet?
  • Please find below query record code, am not using any a!queryAggregation function, this report was working earlier, after few changes to xsd, we did impact analysis, after this it is not working, same is with the other entitybacked reports

    = queryrecord(
    recordType: cons!REQUESTINFO_REPORT_RECORDTYPE,
    query: a!query(
    selection: a!querySelection(
    columns: {
    a!queryColumn(
    field: "id",
    visible: true
    ),
    a!queryColumn(
    field: "requestId",
    visible: true
    ),
    a!queryColumn(
    field: "requestStatus",
    visible: true
    ),
    a!queryColumn(
    field: "createdDate",
    visible: true
    ),
    a!queryColumn(
    field: "accountDetails.accountNumber",
    visible: true
    ),
    a!queryColumn(
    field: "accountDetails.accountName",
    visible: true
    ),
    a!queryColumn(
    field: "accountDetails.accountType.accountTypeName",
    visible: true
    )
    }
    ),
    logicalExpression: a!queryLogicalExpression(
    operator: "AND",
    filters: {
               if(
    isnull(
    ri!accountType
    ),
    {},
    a!queryFilter(
    field: "accountDetails.accountType.accountTypeName",
    operator: "=",
    value: ri!accountType
    )
    ),
    a!queryFilter(
    field: "createdDate",
    operator: "not null"
    ),
    if(
    and(
    not(
    isnull(
    ri!startDate
    )
    ),
    ri!startDate <> "",
    trim(
    ri!startDate
    ) <> ""
    ),
    a!queryFilter(
    field: "createdDate",
    operator: ">=",
    value: todatetime(
    ri!startDate
    )
    ),
    {}
    ),
    if(
    and(
    not(
    isnull(
    ri!endDate
    )
    ),
    ri!endDate <> "",
    trim(
    ri!endDate
    ) <> ""
    ),
    a!queryFilter(
    field: "createdDate",
    operator: "<=",
    value: todatetime(
    ri!endDate + 1
    )
    ),
    {}
    )
    }
    ),
              accountType: ri!accountType,
    startDate: ri!startDate,
    endDate: ri!endDate,
    pagingInfo: ri!pagingInfo
    )
    )
  • The main problem here is that the error refers to queryrecord() as a rule instead of referring to it as a function. See how the error mentions queryrecord() is a rule, which is wrong:

    Expression evaluation error in rule 'queryrecord'

    this explains why stopped working all of a sudden; someone created a rule called queryrecord and now your expressions automatically refer to that rule instead of refering to the out of the box function.

    To prove this, change your rule to use the fn! prefix before the word queryrecord like this and leave the rest as-is; you should see the behavior changes.

    =fn!queryrecord(

    ....
    )

    once you confirm that works I'll guide you through the steps to get rid of the conflict.
  • Yes Eduardo we found yesterday that a rule with name queryrecord was created and my expression referred to that automatically. In one of the rule expressions it is like rule!queryrecord(...) and so I tried modifying to queryrecord removing 'rule!', saved and when we open that rule back it was still showing up as rule!queryrecord(...) , even after deleting the queryrecord rule still there is some reference left, it worked once we changed it back to fn!queryrecord(....). Please let me know the steps which you have mentioned above.
  • 1. Create the deleted rule again and call it "queryrecord"
    2. Export it in an application (only the rule)
    3. Delete this new "queryrecord" rule
    4. Edit this rule's XML by extracting it from the ZIP/content/yyyy.xml. Change its name to "queryrecordrule"
    5. Put it back into the ZIP (drag and drop on Windows Explorer)
    6. Import the application
    7. Delete the renamed rule
    8. Restart the application server.

    This is what you need to be aware of:
    ---> 3.1 Objects that WERE saved/saved&published after the problematic rule was created will have to be re-mapped. The re-mapping will work after the restart of the app server.
    ---> 3.2 Objects that WERE NOT updated during the existence of the problematic rule are NOT impacted.
  • Hi Eduardo,

    Can we not have a restriction / limitation set up in Appian to block users from creating rules that have same name as Appian functions? We too faced the same issue when auser created a rule with the name 'append'.
  • Yes but only in 7.6 and newer. Per the release notes (AN-54222) forum.appian.com/.../Appian_Release_Notes.html

    "New rules and constants cannot be named with the same name as an existing function. Now, using the designer interface or public API to create a rule or constant with the same name as a function will result in an error."