Hello all,
I am creating inside Navision a calculation engine with a more or less complex structure.
Example, after having calculated the value of all my variables, I get the following expression in a field :
(18*(3/(4+2))*5)/3 +9
The number of brackets can change. It is difficult to do it in Navision;
That's the reason why I had the idea to run the windows calculator (without opening it) to pass in the calc.exe program the expression (example : (18*(3/(4+2))*5)/3 +9) and to get the result (24).
I thought at the shell command which could be run before NAV 2013 with an automation variable.
But I have now to do it with Dotnet;
Does anyaone have an idea of the name of the name of the assembly to use and which syntax can be used to run the calculator with a formula as parameter ?
I woul really an answer from you.
Best regards
M. Bultel
0
Comments
viewtopic.php?f=32&t=62682
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
its works.
I had already seen this post but could not find the assembly system.diagnostics.process.
The reason is simple : I had to select the assembly SYSTEM first and that's all.
there are in the list other assemblies which have quite the same name but not the same.
Within the Microsoft.VisualBasic.Interaction namespace is the Shell method, MSDN here http://msdn.microsoft.com/en-us/library/f92d6y8s(v=vs.110).aspx?appId=Dev11IDEF1&l=EN-US&k=k(Microsoft.VisualBasic.Interaction.Shell)%3bk(TargetFrameworkMoniker-.NETFramework,Version%3dv4.5)%3bk(DevLang-VB)&rd=true&cs-save-lang=1&cs-lang=vb#code-snippet-1
Using this method you can create a process without using the additional code.
Define two variables:
vbShell of DotNet using Microsoft.VisualBasic.Interaction.'Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
vbAppWinStyle of DotNet using Microsoft.VisualBasic.AppWinStyle.'Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
The C/AL code required is as follows;
Much simpler but less control.
Enjoy 8)