web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

How to save the file in shared Network folder

(1) ShareShare
ReportReport
Posted on by 244
Hi Team,

I have written a codeunit which will run through JOB QUEUE and save the report in an predefined local folder.

However when i want to save the same file to a shared network folder, I am getting error. How do I achieve this?

I am using ON-PREMISE BC and I am using ExcelReport.SaveAsExcel(FileNameAndPath); to save the report in local folder which is working properly.
 
    trigger OnRun()
    var
        FileNameAndPath: Text[250];
        LoanRec: Record xxx;
        ExcelReport: Report /xxx Excel Report/;
        Startdate: Date;
        Enddate: Date;
    begin
        Startdate := 20210101D; //Requirement: Start Date 1/1/2021
        Enddate := Today;
        LoanRec.SetCurrentKey(/Creation Date/);
        LoanRec.SetRange(/Creation Date/, Startdate, Enddate);
        ExcelReport.SetTableView(LoanRec);
        FileNameAndPath := '////xxx//xxx//xx//xx//xx//xxx Excel Report.xlsx';
        ExcelReport.SaveAsExcel(FileNameAndPath);
    end;

I have the full access to the network folder and when I run the job queue I am getting below error

‘Either the caller does not have the required permission or the specified path is read-only.’

Please provide a solution or alternate way to save the file in network folder.

Thanks in advance.
Rajaneesh H
I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    95,597 Super User 2025 Season 2 on at
    Hi, Please check the following two places. The first is the user set in NAV Instance. Does this user have access rights to the shared folder?
    Second, please check whether the user running the Job queue has file access permissions.
    And hope the following helps.
     
    Thanks.
    ZHU
     
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,917

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,161 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,025 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans