Launching Applications of files from the RT Client in 2009

bmccarthy
Member Posts: 48
Hi,
we are looking at updating our NAV addin for NAV2009. Part of our integration allows you to use NAV to view files stored outside of NAV. A text file for example stored in a shared network folder. From the classic client we use a custom COM automation component to launch the correct application to view files when requested by the user. This does not work in the RT client as the COM component is running on the server and not client side.
So, is there any way to launch an application client side from the Role tailored client. I see that the links dialog does this but we cannot access the code in that page as it is hidden..
Anyone got any ideas???
Oh ya, SHELL is obsolete for the RT client so that doesn't work.
B
we are looking at updating our NAV addin for NAV2009. Part of our integration allows you to use NAV to view files stored outside of NAV. A text file for example stored in a shared network folder. From the classic client we use a custom COM automation component to launch the correct application to view files when requested by the user. This does not work in the RT client as the COM component is running on the server and not client side.
So, is there any way to launch an application client side from the Role tailored client. I see that the links dialog does this but we cannot access the code in that page as it is hidden..
Anyone got any ideas???
Oh ya, SHELL is obsolete for the RT client so that doesn't work.

B
0
Comments
-
-
You can use windows script host DLL and instantiate it on the client to run the code.0
-
Nice one, works well thanks!!
Here is some sample code for anyone wondering:
Locals:
Name DataType Subtype Length
Vbs OCX ScriptControl Object
code1 Text 250
txtCR Text 30Vbs.Language := 'VBScript'; txtCR := ''; txtCR[1] := 13; code1 := code1 + 'sub OpenFile()' + txtCR; code1 := code1 + 'dim objShell' + txtCR; code1 := code1 + 'Set objShell = CreateObject("Shell.Application")' + txtCR; code1 := code1 + STRSUBSTNO('objShell.Open("%1")', filePath) + txtCR; code1 := code1 + 'set objShell = Nothing' + txtCR; code1 := code1 + 'End Sub'+ txtCR; Vbs.AddCode(code1); Vbs.ExecuteStatement('OpenFile()'+ txtCR );
0 -
[Changed the attribute of the topic to <Solved>/<Good Posting>]Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Ok, so I've made progress with the file opening but I already have functions like this in a COM dll which I call from the classic client on the client side via automation. I would like to run other functions in my COM dll on the client machine such as printing the file and launching a scanner interface. To do so I have written and OCX (like the ScriptControl Object) to call from the Role Tailored PAGE which will in turn call my registered COM component. Is this going to work? Or is the ScriptControl a special OCX? Is this a viable solution for re-routing calls to my automation objects which are not available in pages as automation functions run on the server or is there a standard method for performing local client operations from pages?
So far I have registered my OCX however I can't see my OCX functions. Has anyone ever written a custom OCX to call function on from NAV? If so any tips on getting NAV to see the functions?
Cheers0 -
I don't think you can use ocx for RT client. It needs to be activeX/COM dll file0
-
you can't use CREATE for ocx components.0
-
Creating an variable of type OCX will instantiate it to run on the machine that runs the client, this is also valid for RTC.
If you wish to create an automation object that is goind to run on the client machine, you must use the method that takes tree arguments. Where the last argument determines where the automaiton object will be created. True = Client and False = Server.
Create(someAutomationVariable,True/False(New Server),True/False (Run on Client));0 -
stomdahl wrote:Creating an variable of type OCX will instantiate it to run on the machine that runs the client, this is also valid for RTC.
If you wish to create an automation object that is goind to run on the client machine, you must use the method that takes tree arguments. Where the last argument determines where the automaiton object will be created. True = Client and False = Server.
Create(someAutomationVariable,True/False(New Server),True/False (Run on Client));
From you example above it's automation variable not OCX!!!!!0 -
Correct
Automation variables can be instantiated on the Client Tier with the CREATE statement, setting the third paramter to TRUE.
OCX'es will demand load on the Client Tier always (there is an implicit CREATE done the first time you use the variable of type OCX)
You only need to install the Automation object (DLL) or the OCX on the tier on which they will run - but note, that when you import .fob's and when you enable the NAV Server and other things - we need to compile all objects and during this compile process - the automation objects and the OCX'es needs to be present to do a successful compile.
If the objects are not present, compile will fail and you will have to go to a machine which has the object to do the compile.
/FreddyFreddy Kristiansen
Group Program Manager, Client
Microsoft Dynamics NAV
http://blogs.msdn.com/freddyk
The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.0 -
Thanks for the clarification. I have to try it. Maybe add this info to the help file?0
-
I thought the main message of the Role Tailored Client was that you will not be able to run your Automation objects client side and hence why I started this thread...
If all it takes is an extra undocumented parameter then I've been merrily wasting my time writing an OCX. Perhaps Microsoft should have considered this before telling everyone to refactor their code to run Automation server side. :x
B0 -
It is not so simple. Do not forget to the limitations for the automation which cna be run on client side or on server side.0
-
I thought the main message of the Role Tailored Client was that you will not be able to run your Automation objects client side and hence why I started this thread...
/FreddyFreddy Kristiansen
Group Program Manager, Client
Microsoft Dynamics NAV
http://blogs.msdn.com/freddyk
The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.0 -
Sorry for stupid question but is it possible to call for example notepad with some parameter from the RTC?
i.e.: If i call the 'c:\windows\system32\notepad.exe' as filepath, there is no problem but if i call it with 'c:\windows\system32\notepad.exe 1.txt' (open the 1.txt file in notepad) nothing happens.-Mihail- [MCTS]0 -
I used the HYPERLINK() function with the relative path to the file \\. Works for me!0
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
- 320 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