Hello All,
I have to use .NET assembley in NAV. But I cant put data into .NET string type.
How can I convert C/AL decimal type to .NET string type? also from .NET string into C/AL decimal/text
Difficult to say without knowing your .NET assembly. I would assume it doesn't provide a simple string datatype but something more complex as a first guess. For instance you won't be able to autoconvert if your .NET datatype has a nullable datatype.
I would suggest to check your .NET datatypes. Have a look at the constructors and methods of the .NET variables displayed on your C/AL Symbols and try to identify its data type.
Thanks Andrew
I try to integrate to other system using this assembly so I dont know about that well.
I only know fields and data type. Functions return by JSON Ustring data type.
Ok, sounds like my initial assumption is correct then. The JSON Ustring datatype seems to cause the problem here as it doesn't seem to be based of the simple .NET datatype System.string so you cannot apply the integrated data mapping provided by NAV's .NET interop.
As I do not have any experience with JSON data type integration into NAV I cannot help you any further but initially you would have to find out how to deal with this JSON string datatype in NAV.
Just an idea - can you assign it to a .NET variable of type System.string ?
Answers
have you already checked out built-in data type mapping between C/AL and .NET ?
As per
https://msdn.microsoft.com/en-us/library/hh165619(v=nav.90).aspx
C/AL strings can be mapped to .NET strings directly.
So a simple convert of your C/AL decimal into C/AL string by using FORMAT should do the trick...
Hope this helps
Andrew T.
I`ve already tried that. But it appears dont match types. Is there any reason for this?
Regards,
Undy
I would suggest to check your .NET datatypes. Have a look at the constructors and methods of the .NET variables displayed on your C/AL Symbols and try to identify its data type.
Andrew T.
I try to integrate to other system using this assembly so I dont know about that well.
I only know fields and data type. Functions return by JSON Ustring data type.
As I do not have any experience with JSON data type integration into NAV I cannot help you any further but initially you would have to find out how to deal with this JSON string datatype in NAV.
Just an idea - can you assign it to a .NET variable of type System.string ?
Cheers
Andrew T.