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 :
Service | Customer Service, Contact Center, Fie...
Suggested Answer

Changing Child Activity State Before Parent Record

(1) ShareShare
ReportReport
Posted on by 4

Hi,

I have a campaign that has a campaign activity underneath it.

When the campaign is marked inactive I want it to deactivate the child campaign activity record and then deactivate itself.

I have created a workflow that triggers based on a change in campaign status and should trigger BEFORE the campaign state changes so that I change the campaign activity first and then do the campaign.

I believe I'm hitting some kind of race condition as sometime this works and sometimes it doesn't.

What I would like to see happen;

User clicks "DEACTIVATE" from campaign, campaign activity is set to INACTIVE (via my real-time workflow), CAMPAIGN updates its status accordingly.

User clicks "ACTIVATE" from campaign, campaign activity is set to ACTIVE (via my real-time workflow), CAMPAIGN updates its status accordingly.

Am I missing something?  I would have thought the real-time workflow would have blocked the campaign status change from completing before campaign activity workflow would have changed.

I'm trying to avoid writing a plugin or my own code to handle this.

Thanks - Greg

I have the same question (0)
  • Community Member Profile Picture
    on at

    Hi IAmGreg,

    Unfortunately, real-time workflow can’t change child status before changing parent status if you set trigger based on parent status change.

    Setting trigger based on parent status change means that the parent record status must have changed if the child record status changes, otherwise, the child record status does not change.

    In other words,Changing the parent record state is a prerequisite for changing the child record state, which is irreversible.

    But if you insist that change child status before parent status, you can create a new field in the campaign form, set trigger based on the new field change, change child campaign activity status firstly, then you can change campaign status by using workflow or clicking button manually.

    But the way can just for active record to inactive record, because inactive record form is read-only, you can’t change field value in the page.

    In summary, parents status change should not be set as a trigger if you want to change child activity state before parent record.

    Regards,

    Leah Ju

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

  • Suggested answer
    prt33k Profile Picture
    6,907 on at

    Hi Greg,

    I am not sure what will deactivating child record before parent achieve - since once parent deactivation is 'committed' only then it make sense to deactivate child. Otherwise in cases where deactivation of parent fail - you will end up with all child record deactivated but parent active.

    However, one way you can achieve this via a pre update plugin. Retrieve the child record and deactivate them inside plugin.

    Other option will be to write custom action and use custom deactivate button which call this action. In this custom action you can first deactivate all the child record and then the parent record itself.

    Both of these require custom coding - I don't think the OOB workflow or power automate can help here since these run only after deactivation of parent is committed.

    Thanks,

    Prateek

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 March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
FSRon Profile Picture

FSRon 60

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 32 Most Valuable Professional

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 29 Most Valuable Professional

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans