Skip to main content

Notifications

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

Workflow to set older record inactive when a new record for the same account is created

Posted on by 55

Hi Community,

I come across this requirement and wonder how a workflow can make this happen, or if workflow is not the right approach, is there any idea recommended?

There is a custom "Application" entity with Id, Account, Created by, Created on, and Status columns. The requirement is that, for each Account, we want to keep only the latest record active.

For instance, Account ABC and XYZ each has one active record on August 1st 2020.

Application id Account Created by Created on Status
1 ABC Jimmy August 1st 2020 Active
2 XYZ Jimmy August 1st 2020 Active


On September 1st, 2020, Matthew creates a new record for Account ABC. So when this new record arrives, it will set Jimmy's ABC application record inactive.

Application id Account Created by Created on Status
1 ABC Jimmy August 1st 2020 Inactive
2 XYZ Jimmy August 1st 2020 Active
3 ABC Matthew September 1st 2020 Active

Hope I explained myself well. Thank you in advance.

Jimmy

  • Suggested answer
    LuHao Profile Picture
    LuHao 40,872 on at
    RE: Workflow to set older record inactive when a new record for the same account is created

    Hi partner,

    We will use Power automate to do it.

    Go to https://make.powerapps.com/, click Flows, new a automated flow.

    8468.pastedimage1598595887527v1.png

    Set the flow as follow.

    6366.screencapture_2D00_make_2D00_powerapps_2D00_environments_2D00_fe5eb9f0_2D00_75a3_2D00_4247_2D00_a5f7_2D00_42fce82eb346_2D00_logicflows_2D00_2020_2D00_08_2D00_28_2D00_15_5F00_41_5F00_02.png

    Filter Query of "List records" is _new_account_value eq @{triggerOutputs()?['body/_new_account_value']} and statecode eq 0 and new_applicationid ne @{triggerOutputs()?['body/new_applicationid']}

    Test successfully.

    5353.pastedimage1598600349498v2.png

  • scr1pt Profile Picture
    scr1pt 130 on at
    RE: Workflow to set older record inactive when a new record for the same account is created

    Hi,

    You cannot do this via workflow.

    You have to develop a plugin, or use Power Automate to do it.

    Smth like When new Application is created, find all active applications with the same account. If found, deactivate them.

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!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans