Friday, January 7, 2022

Error Handling in Canvas PowerApps with DataVerse Environment using IfError


Introduction:

In this Blog we will see how to Handle error in Canvas PowerApps with DataVerse Environment using IfError


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

 



 

Now Write below code in Delete Button

 

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

 

Thats it :slightly_smiling_face: This will throw error if any error occurs 

 

rampprakash_3-1641547005068.png

 

No comments:

Post a Comment

How to Import Data from Excel to Multiple tables in PowerApps

Introduction:   I have created a view on how to import data from excel to multiple tables in Canvas PowerApps   Implemented Steps: ...