Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

How to save the file in shared Network folder

Posted on by 182
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
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 73,647 Super User 2024 Season 2 on at
    How to save the file in shared Network folder
    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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans