I am trying to convert the following VB.NET code to ABL.
Dim responseType as ENResponseType
responseType = CType(response.Type.GetValue(),ENResponseType);
I have tried the following but get Incompatible data types in expression error.
DEFINE
VARIABLE oResponseType AS CLASS ENResponseType NO-UNDO.
oResponseType = CAST (oResponse:TYPE:GetValue(), ENResponseType ).
The C# equivalent is
ENResponseType responseType = (ENResponseType)response.Type.GetValue();
Any help would be greatly appreciated.
You will need to add a referenece to the assembly that contains ENResponseType. This looks like a QuickBooks type.
Hello Joseph,
It is a Quickbooks type. I do have a reference to the assembly with the following.
USING
Interop.QBFC8.*.
I ended up using my old preprocessors that we used when using com. I am not sure why it does not like the CAST but it does not.
IF
oResponse:TYPE:GetValue() EQ {&rtAccountQueryRs}
Thanks for the reply.
It is a Quickbooks type. I do have a reference to the assembly with the following.
USING
Interop.QBFC8.*.
Have you added an assembly to the assemblies.xml as well? The runtime needs to have access as well - the USING statement has no effect when the .dll file is not available.
Yes.