Business Rules in CRM 2013 is new feature and can help a non-developer background user to do some simple things, such as set Requirement fields, set Visibility, Set Enable or Disable, and Simple Calculation.
Sometimes, I am as developer also feel tempted to try this when I feel worth it to not use Javascript for every conditions I face.
But, for complex calculation or formula, Business Rules cannot support it by default since the formula can afford two fields as formula.
Now, I have this requirement :
To count the Total Food Claim, I have to calculate Breakfast, Lunch, and Dinner Expense, and also Snack Expense.
Means that Total Food Claim = Sum of (Breakfast Expense + Lunch Expense + Dinner Expense + Snack Expense).
Business Rules in CRM 2013 basically only can afford for simple calculation, 2 fields only as formula set field value.
So, it can be tricky, but it is possible!
Because, in the Action, you can have more than one action for each Business Rules, the actually we can take this advantage and need some trick and effort to do it gradually, action by action.
To achieve this without JavaScript, but using Workflow or Business Rules, you have to set the value gradually, step by step, and using multiple business rules for each condition.
Here is the guide.
1. Create first Business Rules with Field1 is contain data, in my case : Breakfast Expense :
2. Do it until your first Business Rules will become this :
Put your formula of calculation in Action gradually for each field
3. Create a new Business Rules based on this Business Rules as Template, utilize the Save As Button, now in this time attach to the contradict Condition:
Because Business is currently not supporting If Else Statement, and you want to calculate your fields, even though one of the field is not containing any data.
4. Repeat for your other fields, for Field2, Field3, etc. In my case : Lunch Expense, Dinner Expense, Snack Expense.
This is the key, do it gradually for each field in Action.
5. So finally, you will have 8 Business Rules, depends on your Total Fields, if you have 7 fields, then you might need 14 Business Rules.
6. Don't forget to activate all of them and then test them:
Fill in the fields
If no dinner (zero value or no data of dinner expense)
Hope it helps!
Why visitrs still use to read news papers when in this technological globe all is pesented on web?
ReplyDeleteHere is my website :: visit your url
your grandchildren may ask why you still read on web when we can transfer knowledge straight into brains
DeleteI found the post very useful as well as interesting. I am certainly happy with all the dazzling opinions you serve in a fantastic way.
ReplyDeleteFree Nifty Future Tips
there is one problem in this, that total will not work correctly except you have one filed with no data out of the 4 field.
ReplyDeleteif you have 2 fields without data (in case they are optional) total will not work.
to solve this
put one rule to initialize all the fields with data as zero.
and more over if you want to cover if the user clear one field from the data, during entry.
then put separate rule for each field to make it back to zero if there is no data.
this will work better if you have so many fields as 30 to add....
Very good post, I was really searching for this topic, as I wanted this topic to understand completely and it is also very rare in internet, that is why it was very difficult to understand.
ReplyDeleteCapital vraddhi
I’ve been absent for some time, but now I remember why I used to love this blog. Thank you, I will try and check back more frequently. How frequently you update your site?
ReplyDeleteamazon best sellers uk
This comment has been removed by the author.
ReplyDeleteoracle adf online training
ReplyDeleteoracle rac online training
msbi online training
"Employee empowerment leads to a more motivated and innovative workforce." Our team
ReplyDelete"I’ve always had a positive experience with your business. Keep shining!" https://vigiato.net/p/501905
ReplyDelete