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

Business Rules on an Entity

I have an CDS entity which represents a percentage breakout across 5 attributes, where each attribute is limited from 0 to 100. I need the total sum of the attributes to equal 100 and would like to create a business rule, but am having trouble getting my head wrapped around how. Here is an example: 

 

(one instance)

value 1: 30

value 2: 0

value 3: 40

value 4: 15

value 5: 15

(total = 100, so valid record)

 

(another instance)

value 1: 30

value 2: 10

value 3: 40

value 4: 15

value 5: 15

(total = 110, so NOT valid record)

 

seems simple enough, but I don't see a way to test this. All examples are dumbed down to not be much help (like account name = "Jones" or type = "apple"). The Rules engine seems to be [field] [test] [value] where [value] can be a formula. I need the formula to be on the field side. 

 

one thought I had is to create a total field, which is the sum of the others, and then the test can be if total = 100 then valid record. but.. then I would need a total field and sort out its value being auto updated as other fields are completed. Is this the only way?  

2 REPLIES 2
coupster
Frequent Visitor

I tried creating a calculated field which was the sum of the 5 attributes, and then applied the business rule against this. Challenge with this is the calculated field is post-save calculated, where as the business rule is pre-save applied, so that approach doesn't appear to work. 

vikulkar
Community Support
Community Support

Hello @coupster ,

 

Business Rules comes under Dynamics Support.

Can you please use https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/312424/dynamics-365---business-rul... for asking the above query. As this will be looked by the right experts and they can assist with this scenario.

 

Thanks and Regards,

  Vikas K

 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (60,186)