Skip to main content
Inspiring
May 26, 2021 6:49 AM UTC
Solved

Cast Invalid Error

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,

    stefanhelzle0001
    Brainy
    May 26, 2021 10:26 AM UTC

    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 7:51 AM UTC

    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
    Inspiring
    May 26, 2021 8:13 AM UTC

    this is my CDTs.

    stefanhelzle0001
    Brainy
    May 26, 2021 8:16 AM UTC

    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.