Hi,
Sometimes on UI getting the below error:Expression evaluation error [evaluation ID = 19742:9c777] in rule 'Test_Rule' at function a!dropdownField [line 314]: An error occurred while executing a save: java.lang.ClassCastException: com.appiancorp.core.expr.portable.Value cannot be cast to com.appiancorp.core.data.Variant
Please provide some guidance on the above error to fix.
Regards,Sandeep
Discussion posts and replies are publicly visible
The error points out that when you select a dropdown value (of the dropdown component at line 314), a save is executed in which the target type and value type do not line up.
i.e. you are trying to save some value of type A into a target that expects type B value.
This obviously will not work.
Error message itself is a clear guidance. If you can share the code snippet we might help you solve this error faster.
Thank you Laurens and Sanchit,Please review the attached code:
a!localVariables( local!id, local!unionChoicelabels: union("A", "A", "B", "B"), local!unionChoiceValues: union(1, 1, 2, 2), local!number, local!Detail: cast( typeof( 'type!{urn:com:appian:types:AAA}AAA_Details'() ), {} ), a!dropdownField( label: "Select SMT", labelPosition: "JUSTIFIED", helpTooltip: "Select the name of the SMT", placeholder: "Select SMT", choiceLabels: local!unionChoicelabels, choiceValues: local!unionChoiceValues, value: local!id, saveInto: { local!id, a!save(local!number, null), a!save(local!Detail.id, local!id) }, required: true, validations: {} ) )
This piece of code looks fine and working. You might mind sharing the actual code where the error occurs at line 314.
Hi Sanchit,
Line 314 is itself starting of a!dropdownField() which is shared sample code. Let me know if any more info needed.
You could check the CDT fields and their references, as the issue may be resolved by doing so
a!save(local!Detail.id, local!id) comment this and try once