web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Deactivation and elimination of a Sequence

(4) ShareShare
ReportReport
Posted on by 8
Hello!
 

I've created a Sequence on Sales Accelerator, adding email templates for sending emails. Unfortunately, I accidentally deleted one of the email templates I had set up, and now I'm unable to modify the Sequence or delete it and recreate it from scratch.

The error message I'm receiving is:

 
Business Process Error

There was an error calculating dependencies for this component. Missing component id {0}

How can I delete the Sequence?

Thanks

Screenshot 2024-10-15 121310.png
I have the same question (0)
  • Gus Profile Picture
    218 on at
    @Microsoft 365 Dynamics Same issue. Any help would be appreciated. Unable to delete the sequence or deactivate bc underlying email template was deleted while tied to the tile. 
  • Suggested answer
    Daivat Vartak (v-9davar) Profile Picture
    7,841 Moderator on at
    Hello CU15101006-0,
     

    That's a frustrating situation! The "Missing component id" error usually indicates that the Sequence is still referencing the deleted email template, creating a dependency that prevents modifications or deletion.

    Unfortunately, there isn't a direct "force delete" option within the Sales Accelerator UI for Sequences that have broken dependencies. You'll need to take a more direct approach using the underlying Dynamics 365 data.

    Here's a breakdown of the steps you can take to delete the Sequence:

    Warning: These steps involve interacting directly with the Dynamics 365 data. Incorrect modifications can lead to data inconsistencies or system instability. It is highly recommended to perform these actions in a non-production environment first and to have a backup of your system before proceeding.

     

    Method 1: Using the Web API (Recommended for Most Users)

    This method allows you to interact with the Dynamics 365 data programmatically without needing direct database access.

    1. Identify the Sequence Record ID:

      • Go to the Sales Accelerator.

      • Navigate to the list of Sequences.

      • Open the problematic Sequence.

      • Look at the URL in your browser. The Sequence record ID will be the value after main.aspx?etn=msdyn_sequencenew&id= and before any &histKey=. Copy this ID. 

    2. Open your Browser's Developer Tools:

      • In most modern browsers (Chrome, Edge, Firefox), you can open the developer tools by pressing F12. 

    3. Navigate to the "Console" Tab:

       

      • In the developer tools window, click on the "Console" tab.

    4. Execute Web API Calls to Break Dependencies and Delete:

       

      You'll need to execute a series of Web API calls. The exact entities and relationships involved might vary slightly, but the general idea is to find and remove references to the deleted email template within the Sequence and its steps.

      • Step 1: Find Sequence Steps: Execute the following Web API call to retrieve the steps within your Sequence. Replace <your_sequence_id> with the actual ID you copied in step 1.

        fetch(Xrm.Utility.getGlobalContext().getClientUrl() + "/api/data/v9.1/msdyn_sequencesteps?$filter=_msdyn_sequenceid_value eq '<your_sequence_id>'", {
            method: "GET",
            headers: {
                "OData-Version": "4.0",
                "Content-Type": "application/json",
                "Accept": "application/json",
                "Prefer": "odata.include-annotations=*"
            }
        }).then(response => response.json()).then(data => {
            console.log(data.value); // Inspect the steps to identify references to the deleted template
            // Proceed to the next step after examining the output
        }).catch(error => console.error("Error fetching sequence steps:", error));


      • Step 2: Identify and Potentially Update or Delete Problematic Steps: Examine the data.value in the console output. Look for steps that reference the deleted email template (you might see a null or incorrect _msdyn_emailtemplateid_value).

        • Attempt to Update (If Possible): If you can identify the problematic step and potentially link it to a different valid email template, you can try updating it using a PATCH request:

          fetch(Xrm.Utility.getGlobalContext().getClientUrl() + "/api/data/v9.1/msdyn_sequencesteps(<step_record_id>)", {
              method: "PATCH",
              headers: {
                  "OData-Version": "4.0",
                  "Content-Type": "application/json"
              },
              body: JSON.stringify({
                  "_msdyn_emailtemplateid_value": "<valid_email_template_id>" // Replace with a valid template ID or null to remove the link
              })
          }).then(response => {
              if (response.ok) {
                  console.log("Sequence step updated successfully.");
                  // Try deleting the sequence now
              } else {
                  console.error("Error updating sequence step:", response.status, response.statusText);
              }
          }).catch(error => console.error("Error updating sequence step:", error));

          Replace <step_record_id> with the msdyn_sequencestepid of the problematic step and <valid_email_template_id> with the ID of a valid email template or null to try and remove the association.


        • Attempt to Delete Problematic Steps (If Update Fails or Makes Sense): If updating isn't feasible or you want to remove the step entirely, you can try deleting it using a DELETE request:

          fetch(Xrm.Utility.getGlobalContext().getClientUrl() + "/api/data/v9.1/msdyn_sequencesteps(<step_record_id>)", {
              method: "DELETE",
              headers: {
                  "OData-Version": "4.0"
              }
          }).then(response => {
              if (response.ok) {
                  console.log("Sequence step deleted successfully.");
                  // Try deleting the sequence now
              } else {
                  console.error("Error deleting sequence step:", response.status, response.statusText);
              }
          }).catch(error => console.error("Error deleting sequence step:", error));

           

          Replace <step_record_id> with the msdyn_sequencestepid of the problematic step 


      • Step 3: Delete the Sequence: After attempting to update or delete the problematic steps, try deleting the Sequence again using a DELETE request. Replace <your_sequence_id> with the Sequence ID.

        fetch(Xrm.Utility.getGlobalContext().getClientUrl() + "/api/data/v9.1/msdyn_sequencenew(<your_sequence_id>)", {
            method: "DELETE",
            headers: {
                "OData-Version": "4.0"
            }
        }).then(response => {
            if (response.ok) {
                console.log("Sequence deleted successfully.");
            } else {
                console.error("Error deleting sequence:", response.status, response.statusText);
            }
        }).catch(error => console.error("Error deleting sequence:", error));



      •  

    Method 2: Using XrmToolBox (More User-Friendly but Requires Tool Installation)

    XrmToolBox is a powerful free tool for Dynamics 365.

    1. Download and Install XrmToolBox: You can find it at https://www.xrmtoolbox.com/.

    2. Connect to Your Dynamics 365 Environment: Use the Connection Manager within XrmToolBox to connect to your instance.

    3. Use the "Record Remover" Tool:

      • Open the "Record Remover" tool within XrmToolBox.

      • Select the Sequence (msdyn_sequencenew) entity.

      • Use the filtering options to find your problematic Sequence (you can filter by name).

      • Select the Sequence record.

      • Before deleting, ensure you understand the implications and have a backup.

      • Click the "Delete" button. XrmToolBox might be more resilient in deleting records with broken dependencies, but there's still a risk. 

    4. If "Record Remover" Fails, Try "FetchXML Builder" and "Dataverse REST Builder":

      • FetchXML Builder: Use this tool to build a FetchXML query to retrieve the related msdyn_sequencestep records for your Sequence. Examine these records for references to the deleted email template.

      • Dataverse REST Builder: This tool can help you generate the necessary Web API calls (similar to Method 1) to update or delete the problematic msdyn_sequencestep records. You can then use the "Execute FetchXML" tool in XrmToolBox to run the generated Web API calls. 

      •  

    5.  

    Important Considerations for Both Methods:

    • Backup: Always back up your Dynamics 365 environment before making direct data modifications.

    • Testing: Perform these steps in a non-production environment first.

    • Understanding Relationships: Be careful when deleting records, as it can have unintended consequences if you delete the wrong related entities.

    • Permissions: Ensure your user account has the necessary permissions to perform these actions.

    •  

    By using either the Web API directly or the XrmToolBox, you should be able to bypass the UI limitations and remove the broken dependency, allowing you to delete the Sequence. Remember to proceed with caution and test thoroughly.

     
    If my answer was helpful, please click Like, and if it solved your problem, please mark it as verified to help other community members find more. If you have further questions, please feel free to contact me.
     
    My response was crafted with AI assistance and tailored to provide detailed and actionable guidance for your Microsoft Dynamics 365 query.
     
    Regards,
    Daivat Vartak

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 128 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 95

#3
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 69 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans