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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Prevent Deletion of Ch...
Power Apps
Answered

Prevent Deletion of Child Record if Certain Conditions in Parent Record are met

(0) ShareShare
ReportReport
Posted on by 305

I have a Parent Table called Items. And in it's Form I have a subgrid populated by it's child table , ItemSpecifications.

I want to prevent users from deleting Item Specifications, for those items for which Parent Record's (Item's) Choice Column = Approved.

 

Is there a way to disable delete option in the subgrid's context menu as well as on the ItemSpecifications Form conditionally.

 

Or is there an event that fires before delete to prevent delete

 

 

I have the same question (0)
  • Shashank Bhide Profile Picture
    946 Moderator on at

    You can register a pre event on Delete message and run the desired logic and control is centrally.

  • Verified answer
    Guido Preite Profile Picture
    1,490 Super User 2024 Season 1 on at

    what @shashankbhide suggested if I understood correctly is to write a plugin and registering it on the Delete message (I just write because I didn't read plugin and if you are not aware of what plugins are at least now you have all the terminology to search for)

    an alternative as you are checking the parent, can be a synchronous workflow, I didn't test your exact scenario but it should be possible (keep in mind that synchronous workflows are an old technology inside dataverse)

    don't know if can be done with low code plugins (using power fx) but they are on preview and between all the methods I personally prefer writing a plugin for this kind of logic as was suggested

  • pavanmanideep Profile Picture
    574 Power Up Champ - 2025 on at

    Hi @Rutu01 ,

     

    I agree with @shashankbhide@GuidoPreite.,but here is my take on this.

     

    You can register a Plugin on the child entity on Pre validation Step of Delete Message to perform your intended operation.

     

    If you want to disable the Delete button altogether, you need write a Display rule using Power Fx.

    Reference: https://dynamicsofdynamicscrm.com/2022/08/09/step-by-step-add-show-hide-visibility-rule-using-power-fx-to-a-command-button-using-new-command-designer/

     

    If I have answered your question, please mark your post as Solved.

    If you like my response or got a direction forward to proceed, please give it a Thumbs Up. Appreciate your Kudos. You can accept more than one post as a solution.

     

    If you were still facing any issue or challenge, please do let me know so that I can try to check for you. Happy to help you further.

     

    Blog:https://ecellorscrm.com

     

    Cheers,

    PMDY

     

     

     

     

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 Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard