In this blog we will tell you how you can create calculated type of fields in dynamics 365.
What is a calculated field?
Calculated fields are those type of fields that consist of calculations that make use of the fields from the current entity or other related entities. Means you don’t need to do the calculations manually.
You just have to prepare a formula for once according to your requirement which might include some branching or conditions which you will see later in this blog.
So now we will see how we can do so.
Example: So here we will create a field Total Net of calculated type in Costing entity.
Step 1: Go to Settings->RFQ(Solution)->Costing(Entity)->Fields->New
Step 2: Enter Display Name: Total Net, select Data Type: Currency, Field Type: Calculated
Step 3: Click on Edit button to add the formula for Total Net
You can see there are two things to do:
1) To add a condition: Checking if fields contains data or not.
2) To add an action: Adding an action means we have to set the formula for calculating the Total Net.
· If Condition
Here we are checking whether Cost Per Unit(from Pricing entity) and
Markup Amount field contains data or not.
Formula: ((Cost Per Unit * Quantity) + Markup Amount) + Delivery Charges
· Else If Condition: When the “If condition” is false then we are checking if the “Cost Per Unit” and “Mark-Up%” fields contains data or not.
Formula: (Cost Per Unit * Quantity) + ((Cost Per Unit * Quantity) + (Mark-Up% / 100)) + Delivery Charges
Step 5: Save and Close
Step 6: Go to CRM form, first we have to fill the details of RFQ entity.
Supplier Pricing (RFQ entity)
Supplier and Mark-up (RFQ entity)
After saving all these details, the Total Net is being calculated and populated automatically.
And all details of RFQ entity are saved in the Costing entity
Calculation for Total Net:
Quantity = 25
Cost Per Unit = 2000
Delivery Charges = 100
Mark Up% = 20
20% of 2000 = 400(markup amount = markup% of delivery charges)
25*400=10000(quantity * markup amount)
25 * 2000 = 50000(quantity * cost per unit)
Total Net = 50000 + 10000 + 100(Delivery Charges)