Showing a file from the RTC client
Chiel
Member Posts: 32
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
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
-
i hope you are aware of this
RTC will search for file in Service Tier system path c:\temp\test.txt not in client system path.0 -
Yes, i'm aware of that.0
-
so your file is located in service tier systems path c:\temp\test.txt?0
-
The is located on the client. The dotnet variable has the property RunOnClient=Yes, The exception is: Method 'System.Diagnostics.Process.Start' not found.0
-
For me this is working without problems:
Proc.Start('somefileonlocaldisc');where the Proc is the DotNet class System.Diagnostic.Process with RunOnClient=Yes. The Start is static method, you do not need to use the constructor to create the variable...0 -
Hello Kine
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?0 -
I have used the System assembly, class System.Diagnostic.Process.0
-
I have the same problem. I want to open an Explorer-Window out of a Page in the RoleTailored Client. If I use Automation (per Windows Script Host Object Model) it all works fine, except that annoying Security-Warning. Then i heared, that if i use DotNet, i can skip this Warning by setting "serviceprincipalnamerequired" to "true" in the clientusersettings.config. So i decided to try to start the Explorer per DotNet.
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.Process := Process.Process(); Process.Start('explorer.exe');
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.using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Diagnostics; namespace ConsoleApplication2 { class Program { static void Main(string[] args) { Process.Start("explorer.exe"); } } }
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?0 -
deV.ch wrote:Are you running the original build of 2009 R2?
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!0 -
I updated my R2 installation to Build 33997 and, suddenly, the same two lines of code work! Thank you very much!
:thumbsup:0 -
Hello,
I got the same error. I solved it as follows:
proc := proc.Process;
proc.StartInfo.FileName := filename;
proc.Start;0 -
I found the following working quite well:
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;0 -
Hello Duikmeester,
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,
Klaas0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 322 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions


