When i share the folder, i have an error while running the report from NAV.
When i create a new folder and i run the report from NAV, the file ll be created.
What must i do ?
Thanks in advance.
When i share the folder, i have an error while running the report from NAV.
When i create a new folder and i run the report from NAV, the file ll be created.
What must i do ?
Thanks in advance.
Hi Alia,
Not sure I understand what are you sharing and how? Could you please describe what you do, and what you expected NAV to do?
Hi Erik,
I’m runing a report from NAV that generate a file .txt in a path that i v defined in the NAV server.
After that, i must to share the folder that contain the file .txt
When i share the folder, at runing report, i will have an error message “impossible to write in flow”
if i create a new folder i v not an error.
I hope that’s clear now.
Hello Alia,
No, we need more information from you in order to help you in the best possible way.
You have a report where you save the data as a txt-file. How is that done? is it Report.SAVEAS?
The folder that you save to is it \SERVER\PUBLICFOLDER\xxx or is it X:\FOLDER\FILENAME ?
I have never seen an error saying “impossible to write in flow” - What is the exact error message?
Thanks
Palle
Sorry not clear at all. To me then it sounds like you are running a custom-made report. Which report is it?
As Palle and Erik say, we don’t have enought info to help you. It seems like a customized report. The shared folder has to have permissions for both, you and user used to run Dynamics NAV server, and the recommended path will be \server_name\publicfolder_name\path_to_file, because if you use letters, they can be different in diferent computers, or the same letter in different computers point to diffent servers and/or public folders.
Hello,
the path is X:\FOLDER\FILENAME
the code is :
file.create(…);
file.write(…);
i have not problem in creating file or at saving. The file is on the path defined on the report.
the problem is when i share the folder, i wasn’t generate file another time.
So the files are generated from the report and saved correctly to the folder? Even without a file.close?
Exactly what do you mean by “sharing the folder”? What process is that? And exactly what is the full error message?
Are you using local folder?
When you use instructions to create/write/read files in C/AL Code, they are executed in NAV Server, with the permissions of user running that service.
Is the shared folder accessible from NAV server? Has the user that run NAV server permissions to access that shared folder?
Yes and with file.close
the folder is at NAV SERVER, if i share folder with adding permession to users to access to the folder, i’ll have this error “impossible to write in the flow”
Now i change the conception, i generate report and the file.txt will be send by e-mail
In a local database, the report is generated correctly also the file .txt and the e-mail is sended to my e-mail.
Now, in integrating report at the customer server, the report and the file .txt are generated correctly, but the e-mail is not send. What i should to check ? (i have not an error message).
Thanks in advance.
Please read my previous replies.
Are you doing it directly on the folder using file explorer, command prompt, powershell or is it something build into NAV? Do you have any screen dumps of the error? We are just trying to understand exactly what it is that you are doing. I cannot recognize any such workflows in standard NAV.
Exactly what do you mean by “sharing the folder”? What process is that? And exactly what is the full error message?
→ i share folder : is to give permessions to users to consult the folder, creating into NAV SERVER, that contain the file generated by the report.// The message of error is in french “impossible d’écrire dans le flux” .
For the second part, it’s something build into NAV.
The code :
IF DiskGenerate THEN
Mail.CreateAndSendMessage(User.“ContactEmail”,’’,’’,'text '+CompanyInfo.Name,‘text’,FileName,FALSE,TRUE);
END;
When does the error happen? When you change the permissions? Or when running the “DiskGenerate”?
As I understand it now, then first you go to your X-drive. Here you create a Folder (a folder on your nav server). Here you manually (via File Explorer) assign permissions to the individual users who are allowed to access the file in the folders?
Have you made sure that the user running the NAV service also must have permissions to write to that folder?
Then you go back into NAV and runs your DiskGenerate (to generate the file?) and emails the user?
I still feel a little in the blind about what you are doing or what the problem really is? Who is getting the error? Or do you not get an error when at the customer site? Have you checked the same permissions are in place there? If it works locally at your site?
And if mail doesn’t work at the customer site, then are the SMTP/Mail settings correct, are you able send other mails from the system?
I know that you have changed the beaviour, but… have you read my previous answer?
Anyway, I think that a more accurate translation for “impossible d’écrire dans le flux” is “Unable to write to stream”.
Is Outlook installed on customer computer? The mail codeunit (id 397) use Outlook to send e-mail. You can use SMTP Mail (codeunit 400) to use a SMTP server to send email and doesn’t need Outlook. To use this codeunit you need to configure “SMTP Mail Setup”.
The folder is under C:\ (of NAV server).
yes
yes
When i change permissions to the folder and running the “diskGenerate”, i have an error.
yes, exactly.
yes of course.
yes, the file will be gererated and also the e mail.
The user who execute the report have the error and the file is not generated into the first case (change permissions of folder).
The e mail is send in my local server and dont send to the end customer from the NAV server.
No, i don’t see the SMTP/MAIL settings.
Now, Yes.
yes, it’s installed.
I used CodeUnit 397. I should change the codeUnit ?
If your customer has Outlook installed, I think is fine using codeunit 397. But only will work if process is running from a RTC client… I think codeunit 400 is better to send mails with no user interaction, and it can be used from a process started by Job Queue or Webservice. If Codeunit 397 is not working fine, try with codeunit 400, but before you have to configure SMTP in NAV.
Hello
There are differencies in using CU 397 / 400, which should be adressed instead of just say “cu 400 is better”, because it is not neccesary true.
CU 397:
Requires that the outlook client is installed
The mailbox sending the mails are prefixed and locked to the user that sends the mail /or the NAS
A copy of the sent mail is being saved in the send box (and then you have documentation of your outgoing mails)
CU 400:
My issue now, is that the mail is send in the local server of my society but not in site of customer (PS : i use the same report, and codeUnit 397).