how would you call an .exe file from code behind a form?

jversusj
Member Posts: 489
i searched the forum and could not find anything on this - please redirect me if i missed something.
on a button, i can set the properties for PushAction = RunSystem and RunCommand = path to an executable i'd like to run.
now, is is possible to instead put business logic behind the button (on the OnPush trigger for instance), so that one could do something like:
i'm looking at the CAL help files but i do not see any commands to handle this - just references to the button properties. can anyone give me a hint on this? do i need to create a global of type file, and then somehow do a File.RUN or something?
thanks!
on a button, i can set the properties for PushAction = RunSystem and RunCommand = path to an executable i'd like to run.
now, is is possible to instead put business logic behind the button (on the OnPush trigger for instance), so that one could do something like:
IF Company = US THEN call usa.exe. IF company = DK THEN call denmark.exe etc. etc.essentially, the form would have a single button that calls a specific external application depending on which Naivision company the user is logged into.
i'm looking at the CAL help files but i do not see any commands to handle this - just references to the button properties. can anyone give me a hint on this? do i need to create a global of type file, and then somehow do a File.RUN or something?
thanks!
kind of fell into this...
0
Comments
-
if GLOBALLANGUAGE = (usalanguageidentifier) then shell(mypathusa.exe); if GLOBALLANGUAGE = (deulanguageidentifier) then shell(mypathdeu.exe);
languageidentifiers are fixed integers...find'em on google
p.s.: never used but I think this works...try it...0 -
You can have a look at the SHELL command in Navision.
Here is an example of how you can use the SHELL function:
SHELL('c:\joe\myprog.exe', 'arg1', 'arg2');0 -
thank you both.
all of our companies are operated in English - so i think i will lean towards following the "SHELL" recommendation. thanks.kind of fell into this...0 -
yes! i got it to call my application! thank you. i knew there had to be some command...
i got a pop-up saying "this is the first time you are calling
file = generic.exe
parameter =
and it may not be trusted. proceed?" (paraphrased)
this only happened the first time i ran this - wondering if this would pop up for every new user/machine to make the call or just this first time that i tried it?kind of fell into this...0 -
Try this Tip & Trick to execute a program without Confirmation-link: Shell without confirmation-request of Navision 4.00No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
thank you all again. this looks like a nice solution. i have included it into my code and will hopefully get to test it soon.
i apologize for not searching the forum for SHELL after being lead down that path. it is often too easy to continue the conversation in this thread instead of going back out to look for pre-existing answers.kind of fell into this...0 -
To define which .exe to run, you might create an option in the Company-setup and then depending on that decide on the .exe to run. (or you might create a new setup-field in the company-setup with the .exe to run in it).Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!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