cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
raj7474
Frequent Visitor

I want to create a Business Rule based on a Child Table

I have a Parent Table named "Request" and a child table named "Tasks".  The relation is  1 Request : N Tasks.  There is a "Request Status" field in the Request table, on which I want to enforce a business rule as follows

=> If at least any one of the Tasks related to the request is  "Open", then "Request Status" cannot be "Completed" .

 

If this is not possible is there a work around?

 

I am unable to find a solution for this. Any help is much appreciated. 

 

Thanks...

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisPiasecki
Dual Super User
Dual Super User

Hi @raj7474,

 

One way to achieve your business logic is to add a whole number column to Requests that represents the Count of Open Tasks. A business rule can then check whether the value is greater than 0.

 

To keep the count up to date, you can use a Dataverse workflow on the Task table to increment or decrement the count on the Request table whenever the Task status changes.

 

Here is a similar example from CRM 2011 but still holds true today. 

 

---
Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

View solution in original post

2 REPLIES 2
ChrisPiasecki
Dual Super User
Dual Super User

Hi @raj7474,

 

One way to achieve your business logic is to add a whole number column to Requests that represents the Count of Open Tasks. A business rule can then check whether the value is greater than 0.

 

To keep the count up to date, you can use a Dataverse workflow on the Task table to increment or decrement the count on the Request table whenever the Task status changes.

 

Here is a similar example from CRM 2011 but still holds true today. 

 

---
Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

Hi @ChrisPiasecki,

 

Thank you so much, this is what I was looking for.

 

Regards,

Raj

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (3,116)