Hi all,
When you execute from Navision 4.00 one of the functions listed below, you change the Navision Work Directory (for example C:\Program Files\Microsoft Business Solutions-Navision 4\Client>) with the new directory you select for these functions (for example C:\Navision License> or C:\Picture> etc...).
List of Function that change the Navision Work Directory:
* Tools - License Informations - Change
* (From Navigation Pane) Administration - Application Setup - General - Company Information - Button "Picture" - Import...
* (From Navigation Pane) Administration - Application Setup - General - Company Information - Button "Picture" - Export...
* (From Navigation Pane) Financial Management - General Ledger - Budgets - Button "Functions" - Import from Excel...
To see the current work directory, I've put this statement into the "On Run" event of a new code-unit:
SHELL('c:\windows\system32\cmd.exe');
So:
1) Try to run this code-unit from Object Designer, and you see a dos prompt of the current work directory.
2) Then try to execute one of the functions I wrote before.
3) Then execute the new code-unit again, and you see the work directory changed.
I need a way to set the work directory before I execute every Shell statement from Navision C/AL, because I've an application that needs to work in the original Navision 4.00 Work Directory even if the other application change this work Directory.
Can you help me?
Thanks in advance
Comments
1) Make a shortcut for the fin.exe (or finsql.exe) and put the working directory in there.
2) When launching an external program, in stead of launching it directly, you make a batch file that you launch. And in the batchfile you change the subdirectory and then you launch the program from the batch.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
see http://www.mibuso.com/forum/viewtopic.php?t=8008
PS : It would have been better creating a new topic instead of replying to this topic that is about something else
PS2 : next time try also to search the forum. Most of the time, the problem is already solved
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
I would use your second possibility but I don't know how to get the current work directory from Navision to set in the batchfile.
Thank you
Maria
When entering in Navision, (eg in Codeunit1) you have to save the current path. How to do it:
Another possibility (maybe better) is that you set the Navision-path in a setup.
Or if you have different Navision-paths (depending on the computer), make a table like this:
Table "Navision Path"
Field10:"Computer Name":Text50 (Primary key field, can be blank to have a default for all computers)
Field20:"Navision Path":Text250
How to get the correct record:
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
see http://www.mibuso.com/forum/viewtopic.php?p=33673#33673
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!