web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Using (Roll up field) SUM to calculate Unit cost on Order lines

(0) ShareShare
ReportReport
Posted on by 155

Hi Guys,

Just figuring out how i can make a roll up field that calculates the total cost for the products on the Order Lines, The rollup field will be placed on the Order and there is a relationship with the Order Lines and Order Entity.

Right now it is only able to see this fields here.

0728.pastedimage1594189838390v1.png

I am able to notice that those fields that are in there are all simple however the field that i am trying to get a sum of is a calculated field.

2063.pastedimage1594189890862v3.png

I have checked the Unit cost field and it is a calculated field that gets the value from the productID 

5153.pastedimage1594189945918v4.png

My question is how do you think can i achieve getting a roll up field that calculates the SUM of Unit cost of all products on the order line (of a specific order) ?

Do i have to use a custom plugin for this? or can this be achievable with the solutions in dynamics already?

Also do i need to add any other relationship at all from the order lines to order if i were to add a simple field and wanted it to show up on the roll up field for sum of?

Thanks.

I have the same question (0)
  • Verified answer
    LuHao Profile Picture
    40,892 on at

    Hi Jimmar,

    I would recommend you use flow to set the "Unit Cost" field of Order line instead of using calculated field.

    The advantage is that the field "Unit Cost" can be used in the rollup field.

    Delete the calculated field "Unit Cost" and new a simple field with same name.

    4861.pastedimage1594196136802v2.png

    Go to https://us.flow.microsoft.com/, select the D365 environment, click Solutions, select a custom solution, new a flow.

    6406.pastedimage1594196873146v4.png

    Set the first flow as follow.

    4670.pastedimage1594197275182v5.png

    Then go back to the solution, new the second flow.

    pastedimage1594259512247v1.png

    In this way, the "Unit Cost" field of Order Line will update when change the "Existing Product" field of Order Line and change the "Current Cost" field of Product.

    Finally, we can use this field in the "Hardware Total" rollup field of Order.

  • Suggested answer
    Jimmar Tangkia Profile Picture
    155 on at

    Thanks @Lu Hao this actually what I needed, appreciate the help.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Martin Dráb Profile Picture

Martin Dráb 46 Most Valuable Professional

#2
Pallavi Phade Profile Picture

Pallavi Phade 33

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 28 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans