Skip to content

Error when deleting target record in plugin #303

@Aagaard00

Description

@Aagaard00

Describe the bug
This issue happens when trying to delete the target record in a plugin, in my case i tested for post-sync and post-async on the update event.

The usecase was to delete the record from the system if it fulfilled certain requirements after the update.

To Reproduce
Steps to reproduce the behavior:

  1. Register a plugin on an update event post sync/async
  2. Make the plugin delete the target record
  3. Write a test for the plugin, where you create and update an instance of your chosen record
  4. See error akin to:
failed to Update(445f90a2-3dbd-402c-8f15-b96a853692e7) 'email' with data 'activityid; statuscode' 
Unknown WCF exception thrown. 
  - e.Message = The record of type 'email' with id '445f90a2-3dbd-402c-8f15-b96a853692e7' does not exist.

Expected behavior
I tested this plugin in a DEV environment and it worked as expected for both post-sync and post-async the record was deleted.

OBS: I have not registered any other plugins on the same record type, so i can't really speak to what happens to the remaining steps.

Screenshots
Works in environment:

Image

Environment

  • CRM/D365/CDS version: 9.2.25
  • Tool version: 1.14.1
  • Using XrmBedrock

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions