CastInvalid (APNX-1-4198-000)

I am receiving the following error on the summary page of a record.

"Error Evaluating UI Expression Expression evaluation error [evaluation ID = WNTC55XX] in rule 'rsr_iai_casesummaryview' at function a!textField [line 10]: Could not cast from Number (Integer) to RSR_IAI_IntakeAssessment. Details: CastInvalid (APNX-1-4198-000)"

All the data types are setup and configured correctly. I am using the following rule to display the summary of record: rule!RSR_IAI_QueryTable(rule!RSR_IAI_CaseSummaryView(rf!intakeID,true,true))  

Everything works well when i test the rule but on the site or tempo it keeps throwing the error. What could be going wrong?

  Discussion posts and replies are publicly visible

Parents
  • Just a guess based on naming, but it seems like your rules should be reversed:

    rule!RSR_IAI_CaseSummaryView(
        rule!RSR_IAI_QueryTable(
            rf!intakeID,
            true,
            true
        )   
    ) 

    The summary view should be the outermost rule since that is the interface that displays; your query is what returns the data to be passed into the interface rule. If that doesn't work, I'd suggest trying them individually to see if they work (i.e. just summary view with no inputs, just query with no inputs). Also, try it in a different interface / expression rule and hardcode your rf! variables to see if they work.

  • Hi Peter, Thank you for the prompt response. I am new to Appian, so please bear with me.

    I tried changing the query to the following three versions but none of them worked:

    rule!RSR_IAI_CaseSummaryView(rule!RSR_IAI_QueryTable(rf!intakeID,false,true))
    Error Evaluating UI Expression
    Expression evaluation error [evaluation ID = 50WZ70B2] at function rule!RSR_IAI_CaseSummaryView: Rule 'rsr_iai_casesummaryview' has 3 parameters, but instead passed 1 parameters. (APNX-1-4198-000)

    rule!RSR_IAI_CaseSummaryView(rf!intakeID,false,true)
    Error Evaluating UI Expression
    Expression evaluation error [evaluation ID = SOGIN7P8] in rule 'rsr_iai_casesummaryview' at function a!textField [line 10]: Could not cast from Number (Integer) to RSR_IAI_IntakeAssessment. Details: CastInvalid (APNX-1-4198-000)

    rule!RSR_IAI_QueryTable(rf!intakeID)
    Expression evaluation error [evaluation ID = QCS431O1] : Cannot compare incompatible operands of type List of Variant and type Number (Integer). (APNX-1-4198-000)

  • 0
    Certified Lead Developer
    in reply to sirishreddyr0001

    Without knowing what those two rules do and what their parameters are, we really have no way of knowing what the issue might be. 

    Though I can tell you that the first error message above (complaining about number of parameters) is due to you passing a single value (the result of the QueryTable rule) into the CaseSummaryView rule which has more than one parameter.

Reply Children
  • The query rule displays all the field values of the record based on the cased/record id(primary key). It works when i test it in the query interface. I have attached a screen shot of the query.

    On the first error, i have tried passing single parameter as opposed to 3 but it's the same error.

  • 0
    Certified Lead Developer
    in reply to sirishreddyr0001

    For query-style Expression rules, you should always pass in your rule inputs using dictionary syntax.  If you don't, and you ever edit the rule to add a new parameter (such as a new filter on your query), any places you've already called it without dictionary syntax will break.  Therefore I urge you to format your rule call like this:

    rule!RSR_IAI_QueryTable(id: rf!intakeID)

    You should also format calls to your CaseSummaryView rule this way.  That said, what does that rule do and where/how are you trying to use it?  Is it displaying the above error(s) in the Interface Designer, or somewhere else?