Skip to main content

Notifications

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

How to save the file in shared Network folder

Posted on by 179
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 72,941 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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 229,918 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans