Hello,
I have a .NET DLL which exposes some properties as COM. For example:
public decimal Amount
{
[return: MarshalAs(UnmanagedType.Currency)]
get{ return this.amountField; }
set{ this.amountField = value; }
}
I have a decimal type in NAV which I pass to the Amount property. For example:
"Automation Line".Amount := "Decimal Var";
This works fine in the classic client but when the code runs in the role tailored client, I get the following error:
This message is for C/AL programmers: The call to member Amount failed: Method
'My.Namespace.Line.Amount' not found..
All non-decimal types work fine in the role tailored client. One work-around might be to extend the DLL by adding a method which takes the line amount as a string and have the DLL convert the string to decimal, but I'd rather not extend the DLL if at all possible. Does anyone have any idea what could be going wrong or a better solution?
Thanks,
Adam
0
Comments
Group Program Manager, Client
Microsoft Dynamics NAV
http://blogs.msdn.com/freddyk
The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
Hi Freddy,
Thanks for your response. I'm not exactly sure what you're saying. Are you saying to try a different return type in my DLL? Maybe I should try marshaling my decimal types as something other than UnmanagedType.Currency? Or are you saying there is something I can do on the NAV side of things? I wasn't quite sure what you meant by ReturnAs(). Thanks again for your input and if you can elaborate a little bit more on the different return type options that you mentioned, it would be a great help.
Thanks,
Adam
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.