Hello Everybody
I'm having the following issue when I use the "dotnet" variable "System.Diagnostics.Process" which is located in the assembly:'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Diagnostics.Process.
The following code is used:
Process := Process.Process; //(This variable process runs on the client)
Process.Start('c:\temp\test.txt')
The purpose of the code is to show the file from the rtc client.
The exception which i'm receiving is:
Microsoft Dynamics NAV
Dit bericht is bestemd voor C/AL-programmeurs: De aanroep van lid Start is mislukt: Method 'System.Diagnostics.Process.Start' not found.
OK
0
Comments
RTC will search for file in Service Tier system path c:\temp\test.txt not in client system path.
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I'm receiving this exception:
(Dutch)
Microsoft Dynamics NAV
De DotNet-variabele is niet geïnstantieerd.
OK
Translates to ENU
The DotNet Variable has not been created (something like that)
I already put the code in a assembly which resolved the problem.
By the way, which assembly did you use?
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
After a short search i find out, that "System.Diagnostics.Process" should be suitable for my needs. So i created a DotNet-Variable "Process" ('System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Diagnostics.Process) with "RunOnClient=Yes" and tried to run it on the "OnAssistEdit"-Trigger on my Page.
But when i click on the AssistEdit i get following Error-Message: "Method 'System.Diagnostics.Process.Start' not found".
I'm not very familiar with DotNet-Programming, so i created a simple Console-Application in Visual Studio 2010, that should do the same.
When i start this simple Application, a new Explorer-Window opens on my Computer. So, basically, i think i did nothing wrong in Navision. But why did i get the Error-Message in NAV? Must i do some more setup in NAV to get it running?
Yes, i do use the original build of R2. Sorry, i should have mentioned NAV Version and build in my initial post. :oops: I will try a newer build these days (when i finished setting up a testing environment) and post the results here.
Thanks for the hint!
:thumbsup:
I got the same error. I solved it as follows:
proc := proc.Process;
proc.StartInfo.FileName := filename;
proc.Start;
Process@11020701 : DotNet "'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Diagnostics.Process" RUNONCLIENT;
ProcessStartInfo@11020700 : DotNet "'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Diagnostics.ProcessStartInfo" RUNONCLIENT;
Name := 'notepad.exe';
Parameters := 'c:\temp\temp.txt';
ProcessStartInfo := ProcessStartInfo.ProcessStartInfo(Name,Parameters);
Process := Process.Start(ProcessStartInfo);
Process.WaitForExit;
VarExitCode := Process.ExitCode;
I assume that your solution only works with Notepad. I had to use a solution that works with all kind of documents. My solution doesn't need the update for NAV 2009. It works on NAV 2009R2 build 32012.
Mvg,
Klaas