Hi all,
i am facing a wired problem.
I have customized a form where you can open, import, export and remove documents. Its working fine in classic.
All other functions except OPEN works fine in RTC.
When i try to use OPEN Function it on Role Tailored client first it gave me warning - "Function ‘ENVIRON’ is obsolete for Microsoft Dynamics NAV Server."
I used this function in the code where i want to get the File Name. Please let me know what function can be used to open a document from code whose file name , path and extension are stored in the database.
Thanks & Regards,
Saurav Dhyani
Check EnvironFileName in CU419
Hi mohan,
I have used the same, but what happens is a dialoug window get opened.
what i want is that when i click on that option the file get open directly without saving.
Thanks & Regards,
Saurav Dhyani
Can you show your code or send me through PM
Dear Mohan,
For set File Name i use this -
FileName := ENVIRON(‘TEMP’) + Text012 + DocNo + ‘.’ + “File Extension”;
where -
-
Filename - Text type of variable.
-
Text012 -Text Constant whose value is \Doc
-
DocNo - 39.
-
File Extension - A variable which stores file extension type.
Please let me know how i can use this code in RTC.
Thanks & Regards,
Saurav Dhyani
I tried with below code and got file name path in both classic and RTC
DocNo := ‘1’;
“File Extension” := ‘.txt’;
IF NOT ISSERVICETIER THEN
FileName := ENVIRON(‘TEMP’) + Text012 + DocNo + ‘.’ + “File Extension”
ELSE
FileName := “3-Tier”.EnvironFileName(’’,“File Extension”);
MESSAGE(’%1’,FileName);
Just wanted add a point here…
If you say OPEN(‘C:\temp.txt’);
Classic client search for the file in Client system but RTC search it in the system where servicetier is installed.
so you have to UPLOAD your file to servicetier system and open it…
Hi Dhyani,
Did you ever find a solution to your problem? If you did, would you mind sharing it with us and if any of the posted answers helped you on the way, then please verify them.
Thank you.