Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Bug]: External Storage - Document Attachments fails on Purch. Cr. Memo Hdr. due to trailing dot in generated SharePoint folder name

Open Beginner friendly
#12,012 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Domain
backend, cloud

Research direction

Start in codeunit 8751 "DA External Storage Impl.", specifically GetTableNameFolder, and reproduce the Posted Purchase Credit Memo attachment upload through the SharePoint connector. The work is done when generated folder names remove unsupported trailing characters, including the trailing dot in "Purch. Cr. Memo Hdr.", before folders are created.

Written by the indexing model from the issue text.

Description

Team: SCM
Describe the issue

We are testing the integration between:
 

  • External Storage - Document Attachments
  • External File Storage - SharePoint Connector
     
    When attempting to upload a document attachment from a Posted Purchase Credit Memo, the upload fails with the following error:
Image Image
Expected behavior

Before creating folders in SharePoint, the connector should sanitize folder names and remove invalid trailing characters "." (and other character not supported by sharepoint).

For Example "Purch. Cr. Memo Hdr." should became "Purch._Cr._Memo_Hdr"

Steps to reproduce
  1. Configure External File Storage - SharePoint Connector
  2. Configure a valid SharePoint site
  3. Enable external storage for Document Attachments
  4. Open "Posted Purchase Credit Memos" and upload an attachment
Additional context

Business Central 28.5 SaaS
External Storage - Document Attachments
External File Storage - SharePoint Connector
No legacy API

I will provide a fix for a bug
  • I will provide a fix for a bug
Suggested fix

codeunit 8751 "DA External Storage Impl." implements "File Scenario"

Current code:

 local procedure GetTableNameFolder(TableID: Integer): Text[100]
    var
        TableName: Text;
    begin
        // Try to get table name from metadata, fallback to table ID if not available
        if not TryGetTableName(TableID, TableName) then
            TableName := 'Table_' + Format(TableID);

        // Replace invalid characters for folder names
        TableName := DelChr(TableName, '=', '<>:"/\|?*');
        TableName := ConvertStr(TableName, ' ', '_');

        exit(CopyStr(TableName, 1, 100));
    end;

New code:

procedure GetTableNameFolder(TableID: Integer): Text[100]
 var
     TableName: Text;
 begin
     // Try to get table name from metadata, fallback to table ID if not available
     if not TryGetTableName(TableID, TableName) then
         TableName := 'Table_' + Format(TableID);

     // Replace invalid characters for folder names
     TableName := DelChr(TableName, '=', '<>:"/\|?*');
     TableName := ConvertStr(TableName, ' ', '_');
     **TableName := DelChr(TableName, '>', '. ');**

     exit(CopyStr(TableName, 1, 100));
 end;

Dominant language
AL
Stars
683
Forks
459
Avg merge
2d 21h
Merged PRs (30d)
510

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/BCApps

All issues in microsoft/BCApps

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.