In the case of an integer value the conversion happens implicit by assigning the variant to an integer variable.
If the value of the variant variable does not match integer you will get a runtime error.
if VariantVar.ISINTEGER then
IntVar := VariantVar;
The main issue here is that the IntVar is a DotNet integer. The goal is to assign C/AL datatypes to the corresponding DotNet type. That DotNet integer is Nullable. I thought using the Variant might help. I have attached the error message. Any thoughts?
Comments
If the value of the variant variable does not match integer you will get a runtime error.
if VariantVar.ISINTEGER then
IntVar := VariantVar;
NAV Developer
The main issue here is that the IntVar is a DotNet integer. The goal is to assign C/AL datatypes to the corresponding DotNet type. That DotNet integer is Nullable. I thought using the Variant might help. I have attached the error message. Any thoughts?