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
0
Answers
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
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
Thanks & Regards,
Saurav Dhyani
Do you Know this About NAV?
Connect - Twitter | Facebook | Google + | YouTube
Follow - Blog | Facebook Page | Google + Page
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
For set File Name i use this -
FileName := ENVIRON('TEMP') + Text012 + DocNo + '.' + "File Extension";
where -
1) Filename - Text type of variable.
2) Text012 -Text Constant whose value is \Doc
3) DocNo - 39.
4) 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
Thanks & Regards,
Saurav Dhyani
Do you Know this About NAV?
Connect - Twitter | Facebook | Google + | YouTube
Follow - Blog | Facebook Page | Google + Page
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);
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
yeah that is write, i checked at the location and the file is actually getting saved there. But its not getting open.
For opening file what i have used this function which is working fine in classic -
IF NOT EXISTS(FilePathName) THEN
ERROR(Text001);
IF NOT SplitFilePathName(FilePathName,FolderName,FileName) THEN
ERROR(Text002);
CREATE(objShell);
objFolder := objShell.NameSpace(FolderName);
objFolderItems := objFolder.Items;
objFolderItem := objFolderItems.Item(FileName);
objFolderVerbs := objFolderItem.Verbs;
i := -1;
REPEAT
i := i + 1;
IF i < objFolderVerbs.Count THEN
objFolderVerb := objFolderVerbs.Item(i);
UNTIL (STRPOS(UPPERCASE(objFolderVerb.Name),Text006) > 0) OR (i >= objFolderVerbs.Count);
IF (STRPOS(UPPERCASE(objFolderVerb.Name),Text006) > 0) THEN
objFolderVerb.DoIt
ELSE
ERROR(Text004,FileName);
Where SplitFilePathName is used to break the path of the file name into folders name and file name.
objShell 'Microsoft Shell Controls And Automation'.Shell
objFolder 'Microsoft Shell Controls And Automation'.Folder
objFolderItems 'Microsoft Shell Controls And Automation'.FolderItems
objFolderItem 'Microsoft Shell Controls And Automation'.FolderItem
objFolderVerbs 'Microsoft Shell Controls And Automation'.FolderItemVerbs
objFolderVerb 'Microsoft Shell Controls And Automation'.FolderItemVerb
how it can be taken into RTC, or if there is any default function to open file from RTC.
Thanks & Regards,
Saurav Dhyani
Do you Know this About NAV?
Connect - Twitter | Facebook | Google + | YouTube
Follow - Blog | Facebook Page | Google + Page
But first, make a distinct difference of files residing on the cliënt and files residing on the server.
Shell is of no need, hyperlink usually works.
|To-Increase|
File get downloaded on the client not at server.
Please let me know how can i open the file without using shell & what is hyperlink ?
Thanks & Regards,
Saurav Dhyani
Thanks & Regards,
Saurav Dhyani
Do you Know this About NAV?
Connect - Twitter | Facebook | Google + | YouTube
Follow - Blog | Facebook Page | Google + Page
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..
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Try to pass to this function the URL of the file you want to open.
It works as expected... More or Less...