Skip to main content

Notifications

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Impossible to delete bookable resource

Posted on by 20
A user recently left us and they have been permanently removed on Entra ID. They can't however be removed as a bookable resource on dynamics as they're apparently referenced in project teams. I have however looked at the given projects and on project.microsoft.com they don't have a team assigned.

Also you can't delete from the msdyn_projectteam table directly.
Categories:
  • Suggested answer
    Amit Katariya007 Profile Picture
    Amit Katariya007 8,270 Super User 2024 Season 1 on at
    Impossible to delete bookable resource
    In this scenario, it seems like the user is still referenced in the Project Team records within Dynamics 365, even though their account has been removed from Entra ID. Since you're unable to delete the user from the msdyn_projectteam table directly, here are some steps you can follow to resolve this issue:
     
    1. Check for the User in Project Team Records
     
    Even though the user does not appear in the project in project.microsoft.com, the user might still be referenced in the msdyn_projectteam records in Dynamics 365. You need to check all the project teams where the user might still be associated, which could be done using a query or advanced find:
     
    Use Advanced Find in Dynamics 365 to search for records in the msdyn_projectteam entity where the Bookable Resource is still referencing the deleted user.
     
    Filter by the Bookable Resource field and search for any records where the user’s ID or name still appears.
     
     
    2. Manually Remove the User from Project Teams
     
    If you find project teams that reference the deleted user, you can manually update or delete the msdyn_projectteam records:
     
    Navigate to the Project Team: In Dynamics 365, go to the project record, find the Project Team subgrid, and manually remove the user from any associated teams.
     
    Direct Update in the UI: If the project team is still visible in the UI, go to the Project Team section within each project and manually remove the user from each team.
     
     
    3. Use Data Import/Export to Delete or Update Records
     
    If manually removing the user from the UI is not practical due to the volume of records, you can consider using a data export/import approach:
     
    Export Project Team Data: Export the msdyn_projectteam data to Excel (or use the Data Export Service) and remove the rows where the deleted user is still present.
     
    Re-import the Data: After making the necessary adjustments in the exported file, re-import the corrected data into Dynamics 365 to update the msdyn_projectteam table.
     
     
    4. Use Power Automate or Custom Workflow
     
    If the above manual methods are not feasible, you can create a Power Automate Flow or a custom workflow to:
     
    Identify and remove the user from all msdyn_projectteam records that are still referencing them.
     
    The flow or workflow could be triggered on a scheduled basis or whenever a user is removed from the system, ensuring no orphaned records remain.
     
     
    5. Check for User References in Other Tables
     
    The user might also be referenced in other tables, such as bookableresource, workassignments, or project tasks. Make sure you check the Bookable Resource and other related tables to ensure there are no lingering references:
     
    Use Advanced Find to search for the user in these tables.
     
    Remove or update references as necessary.
     
     
    6. Use the Web API to Clear References Programmatically
     
    If you're comfortable working with code, you can use the Dynamics 365 Web API to programmatically search and delete or update any references to the user in the msdyn_projectteam or related entities:
     
    Retrieve all project team records that reference the user.
     
    Update or delete the relevant records via the Web API.
     
     
    Example query using Web API:
     
    GET [Organization URI]/api/data/v9.1/msdyn_projectteams?$filter=bookableresourceid eq [User's GUID]
     
    Then, use a DELETE or PATCH request to clean up the records.
  • Suggested answer
    Amit Katariya007 Profile Picture
    Amit Katariya007 8,270 Super User 2024 Season 1 on at
    Impossible to delete bookable resource
    In this scenario, it seems like the user is still referenced in the Project Team records within Dynamics 365, even though their account has been removed from Entra ID. Since you're unable to delete the user from the msdyn_projectteam table directly, here are some steps you can follow to resolve this issue:
     
    1. Check for the User in Project Team Records
     
    Even though the user does not appear in the project in project.microsoft.com, the user might still be referenced in the msdyn_projectteam records in Dynamics 365. You need to check all the project teams where the user might still be associated, which could be done using a query or advanced find:
     
    Use Advanced Find in Dynamics 365 to search for records in the msdyn_projectteam entity where the Bookable Resource is still referencing the deleted user.
     
    Filter by the Bookable Resource field and search for any records where the user’s ID or name still appears.
     
     
    2. Manually Remove the User from Project Teams
     
    If you find project teams that reference the deleted user, you can manually update or delete the msdyn_projectteam records:
     
    Navigate to the Project Team: In Dynamics 365, go to the project record, find the Project Team subgrid, and manually remove the user from any associated teams.
     
    Direct Update in the UI: If the project team is still visible in the UI, go to the Project Team section within each project and manually remove the user from each team.
     
     
    3. Use Data Import/Export to Delete or Update Records
     
    If manually removing the user from the UI is not practical due to the volume of records, you can consider using a data export/import approach:
     
    Export Project Team Data: Export the msdyn_projectteam data to Excel (or use the Data Export Service) and remove the rows where the deleted user is still present.
     
    Re-import the Data: After making the necessary adjustments in the exported file, re-import the corrected data into Dynamics 365 to update the msdyn_projectteam table.
     
     
    4. Use Power Automate or Custom Workflow
     
    If the above manual methods are not feasible, you can create a Power Automate Flow or a custom workflow to:
     
    Identify and remove the user from all msdyn_projectteam records that are still referencing them.
     
    The flow or workflow could be triggered on a scheduled basis or whenever a user is removed from the system, ensuring no orphaned records remain.
     
     
    5. Check for User References in Other Tables
     
    The user might also be referenced in other tables, such as bookableresource, workassignments, or project tasks. Make sure you check the Bookable Resource and other related tables to ensure there are no lingering references:
     
    Use Advanced Find to search for the user in these tables.
     
    Remove or update references as necessary.
     
     
    6. Use the Web API to Clear References Programmatically
     
    If you're comfortable working with code, you can use the Dynamics 365 Web API to programmatically search and delete or update any references to the user in the msdyn_projectteam or related entities:
     
    Retrieve all project team records that reference the user.
     
    Update or delete the relevant records via the Web API.
     
     
    Example query using Web API:
     
    GET [Organization URI]/api/data/v9.1/msdyn_projectteams?$filter=bookableresourceid eq [User's GUID]
     
    Then, use a DELETE or PATCH request to clean up the records.

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 229,993 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans