cancel
Showing results for 
Search instead for 
Did you mean: 
rampprakash

Error Handling in Canvas PowerApps with DataVerse Environment using If Error

Implementation Steps:

 

Consider a Scenario, we are having 2 tables one is with Account and another with Opportunity

 

How to Implement Restrict in Dataverse Environment. : https://microsoftcrmtechie.blogspot.com/2022/01/restrict-record-deletion-if-child.html

 

While Deleting Account if any Opportunity Contains Data then we need to Restrict in PowerApps.

 

This Restriction will work Perfectly in Dataverse 

rampprakash_0-1641546671931.png

 

In PowerApps Canvas if you tried to delete the system won't throw Error, lets see how to handle that

 

Open Canvas App then Click File then settings 

 

Click Upcoming Features and Toggle On --> Formula-level Error Management

 

rampprakash_0-1641562544250.png

 

 

Now Write below code in Delete Button

 

 

 

 

IfError(Remove([@Accounts], BrowseGallery1.Selected),Notify("Record Contains Child Record"),Notify("Deletion Success"))

 

 

 

 

Thats it 🙂 This will throw error if any error occurs 

 

rampprakash_3-1641547005068.png