Describe the issue
When using an external SharePoint connection configured for Document Attachments in Business Central, deleting an attachment from a record correctly removes it within Business Central but does not delete the corresponding file from SharePoint—even though the Delete option is explicitly enabled for the scenario.
This results in inconsistencies between Business Central and SharePoint, leaving orphaned files in SharePoint.
Expected behavior
When a document attachment is deleted from Business Central:
- The file should be removed from:
- The customer record
- The Document Attachment overview
- The corresponding SharePoint folder
Steps to reproduce
- Configure a connection to an external SharePoint account.
- Ensure the account:
- Is set as default
- Has a file scenario assigned (e.g., Document Attachment)
- Open the scenario configuration and enable the “Delete” toggle (intended to delete files in SharePoint when deleted in Business Central).
- Attach a file to a customer record.
- Verify:
- The file appears on the record
- The file appears in the Document Attachment overview
- The file exists in the corresponding SharePoint folder
- Delete the file from the customer record.
- Observe behavior across systems.
Additional context
- The Delete toggle is enabled for the scenario
- Azure app API permissions are configured (see attached configuration/screenshots)
- Suspected that missing or incorrect API permissions may prevent deletion in SharePoint
I will provide a fix for a bug
Describe the issue
When using an external SharePoint connection configured for Document Attachments in Business Central, deleting an attachment from a record correctly removes it within Business Central but does not delete the corresponding file from SharePoint—even though the Delete option is explicitly enabled for the scenario.
This results in inconsistencies between Business Central and SharePoint, leaving orphaned files in SharePoint.
Expected behavior
When a document attachment is deleted from Business Central:
Steps to reproduce
Additional context
I will provide a fix for a bug