Customer Engagement & Dynamics CRM Forum

Expand all | Collapse all

Inactivate notification when deleting service activity

  • 1.  Inactivate notification when deleting service activity

    Posted 4 days ago
    ​Hi!

    I have been trying to solve a problem regarding notifications to customers when deleting a service activity.
    Upon deletion of a service activity I want to set the notification related to the service activity to inactive, so that the customer wont be recieving a notification for a cancelled service activity.

    We have created a workflow that, upon deletion of the service activity, will start a child workflow for the (Regarding) Notification that will set the notification to the wished state.

    The workflow triggers as it should when the Service Activity is deleted, but the child workflow doesn't start and gives the following error message:

    "Cannot find record to be used for child workflow"

    Plugin Trace:

    [Microsoft.Xrm.Sdk.Workflow: Microsoft.Xrm.Sdk.Workflow.Activities.StartChildWorkflow]
    [ChildWorkflowStep1]

    Error Message:

    Unhandled Exception: Microsoft.Crm.CrmException: Cannot find record to be used for child workflow
       at Microsoft.Crm.Workflow.Services.ChildWorkflowActivityService.Execute(ActivityContext executionContext, StartChildWorkflow startChildWorkflow)
       at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
       at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

    However, the notification does still exist? Is it that Dynamics can't find it because of the deletion of the service activity?

    We are running Dynamics on premise, version 8.2.4

    ------------------------------
    Carl Johansson
    SEB
    Stockholm
    ------------------------------


  • 2.  RE: Inactivate notification when deleting service activity

    Posted 3 days ago
    Hi Carl,
    Can you please elaborate on "set the notification related to the service activity to inactive"? Is notification an own entity? If the child workflow is running on the service activity  entity as well, the error is expected because the record on which it started on is no longer there.
    Thank you


    ------------------------------
    Nikhil Rajendran
    Aha Apps
    Glen Allen VA
    ------------------------------



If you've found this thread useful, dive deeper into User Group community content by role