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 :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Need to calculate value of Opportunity Product

(0) ShareShare
ReportReport
Posted on by 65

i need to calculate sum of all TCV  on opportunity form. 

pastedimage1616692481334v1.png

TCV is "Estimated revenue * deal term ( where license is PS or support). Any help will be highly appreciated.

I have the same question (0)
  • Suggested answer
    Marco.P Profile Picture
    2,405 on at

    Hi,

    Have you tried a rollup field ?

    www.encorebusiness.com/.../

    community.dynamics.com/.../how-can-i-sum-total-price-from-subgrid-opportunity-product-on-opportunity-form-because-i-have-runout-of-roll-up-fields

    Hope It helps,

    M


    If you found the answer helpful for you or other readers, please mark as Verified.

  • Community Member Profile Picture
    on at

    You get to create a plugin that runs on Create/Update/Delete of Opportunity inline Product.

    The plugin will retrieve all the Opp. Product’s with TCV field and sum all the total. Update the total in Opportunity (Parent of retrieve record)

    You can refer “CRM Plugins for Related Entities” Answer for reference.

    On Delete, you should use Pre-Image of parent Opportunity.

     targetEntity = (Entity)pluginContext.PreEntityImages["TargetImg"];

    For Older records, you can create an On-Demand workflow for the user to Update the TCV data.

  • Ravinder Singh Jamwal Profile Picture
    65 on at

    Unfortunately am no good with writing plugins. Thanks

  • Ravinder Singh Jamwal Profile Picture
    65 on at

    Rollup field will not show custom field for summing the amount but only the system one. So its no good for me as I need to have a sum of custom field in the grid.

  • Suggested answer
    LuHao Profile Picture
    40,892 on at

    Hi Ravinder,

    It's not that Rollup fields can't sum custom fields, but it can only apply filters to the source entity or related entities, simple fields or non-complex calculated fields.

    More information: https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/customize/define-rollup-fields#rollup-field-considerations

    The TCV field is a complex calculated field here, which is why you cannot find the TCV field in the Rollup field. We have to recreate the TCV field to make it available for Rollup field.

    So I would recommend you create a simple field for TCV, and use Power Automate to calculate it, instead of use calcultated field.

    Step 1. Create a new simple field.

    pastedimage1617359662851v1.png

    Step 2. Create the first flow - automate cloud flow.

    pastedimage1617356655507v2.png

    pastedimage1617356678402v3.png

    mul(outputs('Get_a_row_by_ID')?['body/estimatedvalue'],triggerOutputs()?['body/new_dealterm'])

    After saving this flow, the TCV field value will be calculated when "deal term" field changes.

    Step 3. Create the second flow - automate cloud flow.

    Overview:

    pastedimage1617357626817v4.png

    Details:

    pastedimage1617357658061v5.png

    pastedimage1617357697372v6.png

    pastedimage1617357726443v7.png

    mul(outputs('Get_a_row_by_ID')?['body/new_dealterm'],triggerOutputs()?['body/estimatedvalue'])

    After saving this flow, the TCV field value will be calculated when "Estimated revenue" field changes.

    Step 4. Create an instant cloud flow.

    Overview:

    screencapture_2D00_make_2D00_powerapps_2D00_environments_2D00_380abc80_2D00_dfb5_2D00_45ad_2D00_a12a_2D00_9b9a244e1e7a_2D00_logicflows_2D00_2021_2D00_04_2D00_02_2D00_18_5F00_27_5F00_35.png

    Details:

    pastedimage1617359361857v8.png

    pastedimage1617359378065v9.png

    pastedimage1617359394320v10.png

    pastedimage1617359419563v11.png

    After runing this flow, the TCV field value of all existing Opportunity Products will be calculated.

    Step 5. Create a Rollup field using the new simple TCV field.

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 81 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

#3
#ManoVerse Profile Picture

#ManoVerse 40

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans