Skip to main content
May 26, 2021
Solved

Cast Invalid Error

  • May 26, 2021
  • 6 replies
  • 0 views

Hi,

I am getting cast invalid error when I am trying to store a value in my cdt field which refers as foreign key. 

The scenario is  I am passing the product name as parameter and fetching all the details of that product using expression rules.

Now the product id I want to store in another cdt  then it is showing cast invalid error.

Please help me to resolve this error.

Thanks,

    Best answer by stefanhelzle0001

    OK. If you want to store the structure I suggest to do just that. That would change line 49

    value: local!pid.productId

    to

    value: local!pid

    6 replies

    stefanhelzle0001
    Brainy
    May 26, 2021

    Sure. More details please. How do the CDTs look like? Which data type is the rule input? The error is triggered by the button?

    arund0002Author
    May 26, 2021

    this is my CDTs.

    stefanhelzle0001
    Brainy
    May 26, 2021

    The a!save seems to try to store the product id, which is a string, into a field which is of a CDT type. This is what the error message says and what I see from looking at the CDT.