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

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

Parents Reply
  • 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: {}
      )
    )

Children