Cannot mul incompatible operands of type List of Variant and type List of Variant.

Certified Senior Developer

Hello Folks,

Please anyone guide me on this?

I am using below code and getting this error: "Cannot mul incompatible operands of type List of Variant and type List of Variant."  Basically I am multiplying two values. Any thoughts on this?

 a!textField(
                    label: "",
                    labelPosition: "ADJACENT",
                    value:product(index(ri!case, "amount", {}),
                    index(
                      ri!case,
                      "newamount",
                      {}
                    ) / 100),
                    
                    readOnly: true(),
                  ),

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Associate Developer

    Can you try the following code, i.e., replacing the index function's default value with zero ex. index(ri!case, "amount", {}) ->  index(ri!case, "amount", 0) and index(local!case, "newamount", {})  -> index(local!case, "newamount", 0)

    a!localVariables(
      local!case: a!map(amount: 50, newamount: 100),
      a!textField(
        label: "",
        labelPosition: "ADJACENT",
        value: product(
          index(local!case, "amount", 0),
          index(local!case, "newamount", 0) / 100
        ),
        readOnly: true()
      )
    )

Reply
  • 0
    Certified Associate Developer

    Can you try the following code, i.e., replacing the index function's default value with zero ex. index(ri!case, "amount", {}) ->  index(ri!case, "amount", 0) and index(local!case, "newamount", {})  -> index(local!case, "newamount", 0)

    a!localVariables(
      local!case: a!map(amount: 50, newamount: 100),
      a!textField(
        label: "",
        labelPosition: "ADJACENT",
        value: product(
          index(local!case, "amount", 0),
          index(local!case, "newamount", 0) / 100
        ),
        readOnly: true()
      )
    )

Children