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
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 ExpressionExpression 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)
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.
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.
Based on the errors, I'm guessing that you want this:
rule!RSR_IAI_CaseSummaryView( rule!RSR_IAI_QueryTable( rf!intakeID ), true, true )
@peter. This worked. Thank you. I did try this earlier but my interface was called before the query rule during that attempt. Such a simple solution to the issue. Thank you.
For what it's worth, I strongly urge you to write that code like this instead:
rule!RSR_IAI_CaseSummaryView( ruleInput1: rule!RSR_IAI_QueryTable( id: rf!intakeID ), ruleInput2: true, ruleInput3: true )
(you will need to replace "ruleInput1", etc, with the actual rule input names from your CaseSummaryView rule).
Will do. Thank you.