How to get the "Temporary Navision Path"

eromein
Member Posts: 589
Hi,
Does anybody know how to get the "Temporary Navision Path" (TempFilePath from Navision options) within Navision. I need this path to save a Temporary file.
If this is not possible I would like to get the Windows Temporary path.
Thanks,
Emiel Romein
Does anybody know how to get the "Temporary Navision Path" (TempFilePath from Navision options) within Navision. I need this path to save a Temporary file.
If this is not possible I would like to get the Windows Temporary path.
Thanks,
Emiel Romein
"Real programmers don't comment their code.
If it was hard to write, it should be hard to understand."
If it was hard to write, it should be hard to understand."
0
Comments
-
Hello,
This is the way i use to use the Windows temporary folder.
============================
txtPath:=ENVIRON('temp');
IF txtPath='' THEN
ERROR('unknowned variable TEMP');
IF COPYSTR(txtPath,STRLEN(txtPath),1)<>'\' THEN
txtPath:=INSSTR(txtPath,'\',STRLEN(txtPath)+1);
recFile.RESET;
recFile.SETRANGE(Path,txtPath);
IF NOT(recFile.FIND('-')) THEN
ERROR('TEMP not set');
=============================
Hope it could help you,
Regards,0 -
While in Navision if you go to TOOLS->OPTIONS
It shows you the TempFilePath. You can change it if you'd like.
-Is this what you are asking about?0 -
Is there an ENVIRON parameter to get the Navision Temp. path?"Real programmers don't comment their code.
If it was hard to write, it should be hard to understand."0 -
Try this code to get the TempPath:
Vars Name DataType Subtype Length filFile File txtFileName Text 250 txtTempPath Text 250 i Integer filFile.CREATETEMPFILE; txtFileName := filFile.NAME; filFile.CLOSE; FOR i := STRLEN(txtFileName) DOWNTO 1 DO BEGIN IF COPYSTR(txtFileName,i,1) = '\' THEN BEGIN txtTempPath := COPYSTR(txtFileName,1,i - 1); i := 0; END; END; MESSAGE('TempPath = %1',txtTempPath);
It uses the CREATETEMPFILE function, which is available from Attain 3.60.No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0 -
Great Stuff!
Thx y'all!"Real programmers don't comment their code.
If it was hard to write, it should be hard to understand."0 -
I think there is an easier way: :roll:
TempPath := ENVRION('TMP');
But be careful: Navision's TempFilePath is the TMP environment variable, not the TEMP variable. It's set on startup and will not be update during a running session.0 -
-
and time has evolved..
since NAV 2009 we can use the system function: TEMPORARYPATH
http://msdn.microsoft.com/en-us/library/dd338849.aspx0 -
Hi all. I have a strange problem. My TEMPORARYPATH var in nav 5 return ...local\Temp indeed ..local\Temp\ID\
What can be the problem?
Thanks0
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