You've correctly added the existing SharePoint site to Dynamics 365, which is the first step. The default behavior of the "Files" tab creating a new folder is by design when SharePoint integration is enabled. It's geared towards automatically managing document storage within SharePoint for Dynamics records.
Unfortunately, there isn't a direct, out-of-the-box button or feature within the Dynamics 365 Sales interface to simply "link" an existing Dynamics 365 record (like an Account) to a specific, pre-existing folder within your already in-use SharePoint site.
However, you can achieve this connection through a few workarounds and configuration steps:
1. Manual Linking via URL (User-Driven, Less Integrated):
This is the simplest approach but requires users to manually navigate and might not be as seamlessly integrated.
- Get the SharePoint Folder URL: Navigate to the specific SharePoint folder you want to connect to for a particular Dynamics 365 record. Copy the URL of that folder from your browser's address bar.
- Add a Link in Dynamics 365:
- Open the Dynamics 365 Account record.
- You can add this link in a few ways:
- Notes: Add a new note to the record and paste the SharePoint folder URL into the note. Users can click this link to access the folder.
- Custom Attribute (Text Field): Create a new custom text field on the Account entity (e.g., "SharePoint Folder Link"). Populate this field with the SharePoint folder URL for each relevant Account record. You could then potentially create a view or a quick view form to easily access these links.
- iFrame (Less Recommended for Direct Linking): You could embed the SharePoint folder within an iFrame on the Account form. However, this can sometimes have display and performance issues and isn't a direct "linking" mechanism.
- Limitations: This method is manual, requires user effort to set up for each record, and doesn't provide the integrated "Files" tab experience.
2. Using Power Automate (More Automated, Requires Configuration):
You can create a Power Automate flow to automate the process of creating a link between a Dynamics 365 record and a specific SharePoint folder based on certain criteria (e.g., Account Name).
- Trigger: Set the trigger for your flow. This could be:
- When a record is created: To link to a folder created with the same name upon Account creation.
- When a record is updated: To link based on a specific field update.
- A scheduled flow: To process existing records in bulk.
- Action: Find or Create Folder in SharePoint:
- Use the "List folder" action in the SharePoint connector to check if a folder with a specific name (e.g., matching the Account Name) already exists in your desired SharePoint library.
- Use a "Condition" to check if the folder exists.
- If the folder doesn't exist, use the "Create folder" action.
- Action: Update Dynamics 365 Record:
- Add an action to update your Dynamics 365 Account record.
- Create a custom text field (as mentioned in option 1) to store the URL of the corresponding SharePoint folder.
- Populate this field with the URL of the found or created SharePoint folder.
- Limitations: This still relies on a custom field to store the link and doesn't directly integrate with the "Files" tab. It also requires a logical way to identify or create the corresponding SharePoint folder (e.g., naming convention).
3. Custom Code (Plugin or Web API - Most Integrated but Complex):
This is the most technically involved option but can provide a more integrated experience.
- Develop a Plugin or Use the Web API: You would need to write custom code that executes when a Dynamics 365 record is created or updated. This code would:
- Connect to SharePoint using the SharePoint API.
- Based on the Dynamics 365 record (e.g., Account Name), identify or create the corresponding folder in your existing SharePoint site.
- Potentially update a custom field on the Dynamics 365 record with the SharePoint folder URL.
- Crucially, to integrate with the "Files" tab, you would need to understand and potentially manipulate the underlying data structures that Dynamics 365 uses to manage the SharePoint document locations. This is not a well-documented or straightforward process and could be subject to change with platform updates.
- Consider a Custom PCF Control: You could potentially build a Power Apps Component Framework (PCF) control to embed on the Dynamics 365 form. This control could allow users to browse the existing SharePoint site and manually link to a folder for the current record.
- Limitations: This requires significant development effort and a deep understanding of both the Dynamics 365 and SharePoint APIs. Integrating directly with the "Files" tab's default behavior for existing folders is complex and not officially supported.
Key Considerations and Recommendations:
- Naming Convention: Establish a clear and consistent naming convention for your SharePoint folders that makes it easy to identify the folder corresponding to a Dynamics 365 record (e.g., using the Account Name or Account Number). This will be crucial for any automated or semi-automated linking approach.
- Information Architecture: Carefully plan your SharePoint site structure to ensure it's organized and manageable as you connect Dynamics 365 records.
- User Training: If you opt for a manual linking approach, provide clear instructions to users on how to find and add the SharePoint folder links.
- Start Simple: Begin with the manual linking approach (option 1) to understand the user needs and the scale of the linking required. Then, explore automation with Power Automate if the manual process becomes too cumbersome.
- Avoid Direct Manipulation of Dynamics' SharePoint Structures (if possible): Directly trying to modify the underlying way Dynamics 365 manages SharePoint locations can be risky and might break with future updates. Focus on linking via URLs or building custom UI elements.
In summary, while a direct "connect to existing folder" button doesn't exist in the Dynamics 365 interface, you can achieve this by manually adding links or by building automation with Power Automate to store SharePoint folder URLs on your Dynamics 365 records. For a more integrated experience with the "Files" tab, custom code or PCF controls would be necessary, but these are significantly more complex to implement and maintain.