Hi Hari,
Code seems to be ok.
Sure that the product weight you want is stored in Product ?
Don't forget to refresh your cache if you have store the product
weight just before this reading.
Hari Plaikoil a écrit :
> Hi All,
>
> Would you like to help me, how to fetch value from a variable which its type
> is GenericValue?
> this is my code:
>
> GenericValue product = delegator.findByPrimaryKeyCache("Product",
> UtilMisc.toMap("productId",productId ));
>
> I want to get the weight's value by this code:
>
> double weight = product.getDouble("weight").doubleValue();
>
> but, I don't have any value store in weight's variable.
>
> I don't know what mistakes I've done. Please help me.
>
>
> Thank you
>