Hi Team,
I'm trying to use System.String in NAV2009-R2. I can't assign value to System.String variable. I refered the function "IsValidFileName" of NAV 2013 CU-419(File Management). But 2013 can assign the value. Why can't use in NAV2009-R2? Is it something wrong in my code?
Name DataType Subtype Length
String DotNet 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.String
String := 'balabala';
---------------------------
Microsoft Dynamics NAV Classic
---------------------------
Assignment is not allowed for this variable.
Best Regards,
Yukon
Answers
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Yes I did. Can't compile object.
Regards,
Yukon
There are changes in the dotnet interop in NAV 2013 and it looks like they solved some basic problems of the DotNet from 2009. Looks like you hit one...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I think some .net variable cannot use directly in NAV. I found at this blog http://navigateintosuccess.com/blog/generics-in-net-interop-for-nav-2013.
Best Regards,
Yukon
But I managed to find a workaround by using stringbuilder instead
StringBuilder := StringBuilder.StringBuilder(String);
StringBuilder.Replace('MyOldValue', 'MyNewValue');
F.WriteAllText(FileName, Stringbuilder.ToString);
Have you checked the cables?
Have you released the filters?
http://www.navfreak.com