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

Notifications

Announcements

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
    942 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,488 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
    495 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard