Personalized Community is here!
Quickly customize your community to find the content you seek.
Check out the latest Sales updates!Learn about the key capabilities and features of Dynamics 365 Sales and experience some of the new features.
Download overview guide | Watch Sales video
2020 Release Wave 2Discover the latest updates and new features to Dynamics 365 planned through March 2021.
Release overview guides and videos Release Plan | Preview 2020 Release Wave 2 TimelineWatch the 2020 Release Wave 1 virtual launch event
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Upcoming TechTalks
I need to get the sum of the cost of all quote products and use it to calculate the total margin and display on the quote form.I have created a custom field on the quote form, but the available metadata doesnt include the fields I need to get the calculated value.
Please I need help on how to get that form the databaseRegards
Could you tell me how the cost is calculated in your business environment? which entity fields are used?
In general, we can set the cost of each type of product based on the quote line entity, and then create a rollup field for the quote entity to summarize them.
Hi, thanks for the email.
Its the current cost from the Product entity (currentcost) field, there is no custom calculation
We can use calculated field, rollup field and business rule to implement it without code.
Since the relationship between the Quote line entity and the Product entity is N:1, and the relationship between the Quote line entity and the Quote entity is also N:1, we can
① create a calculated field for the Quote line to inherit the field 'current cost' of the Product.
② Then create a simple field to represent the total amount of the current cost of the quote line, calculated by business rule.
③ Finally, create a rollup field for the Quote to summarize the total amount of current cost for all Quote lines.
Here is a demo.
1. I created a calculated field 'Current cost of product' for the Quote line entity, the calculated action is Set Current cost of product to productid.currentcost.
Set Current cost of product to productid.currentcost
2. I created a simple field 'Current cost amount' for the Quote line entity and create a business rule, activate it.
If Current cost of product contains data,
Then set Current cost amount to Current cost of product * Quantity
3. I created a rollup field 'Current cost sum' for the Quote entity, set the RELATED ENTITY to Quote Lines (Quote), set AGGREGATION to SUM of Current cost amount.
Quote Lines (Quote)
SUM of Current cost amount
4. Add all three fields to the form of the respective entity. The effect is as follows.
I have two products ‘one can of cool drink’ and ‘One pack of cool drink’, and their field ‘Current Cost’ has values of 2 and 12. I added them to a quote as two quote lines.
Set its Quantity to 30 and 5, so the total cost should be 30*2+5*12=120.
5. The rollup field is not refreshed in real time. It defaults to refresh every 12 hours. You can also manually refresh it by clicking on the calculator icon on the left and clicking the Recalculate button.
We can set its automatic refresh interval to a minimum of 1 hour.
Please refer to this blog for the setup steps: https://community.dynamics.com/365/b/sachinbansalmicrosoft/posts/dynamics-365-rollup-fields-important-points
In addition, by customizing the workflow, the rollup field can be automatically refreshed whenever the quote is updated.
But writing a custom workflow requires coding, please refer to these two blogs for details.
Or you can download the workflow tool to use directly.
Please refer to this theme: https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/273683/word-template-sums-calculations
Don't forget to mark the verified answer by clicking Yes.
This will help other users quickly navigate to this post.
Business Applications communities