Skip to main content

Notifications

Microsoft Dynamics CRM forum
Suggested answer

Calculated fields in Opportunity Line entity not visible in Opportunity entity Rollup Field query

Posted on by 16
Calculated fields in Opportunity Line (opportunityproduct) entity not visible in Opportunity entity Rollup Field query.
 
Product (product) entity has Product Type option set field with values License and Services.
 
When Product is added on an opportunity meaning an opportunity line is created I populate Calculated Currency field on Opportunity Line entity named License Amount and Service amount  based on Product Type option set. 
 
Now on Opportunity entity I want to create rollup field License Total and Service Total which will auto calculate by summation of License Amount and Service Amount of each Opportunity Line.
 
Unfortunately when I use rollup query to configure this I Select Opportunity Lines as related entity but the 2 amount fields License Amount and Service Amount are not present in list to be selected. 
 
what am I missing? 
 
 
  • dcrmconsultant Profile Picture
    dcrmconsultant 16 on at
    Calculated fields in Opportunity Line entity not visible in Opportunity entity Rollup Field query
    Yes I have been trying this but it doesnt work;
     
    1. Trigger -> Opportunity Line -> Added or Modified or Deleted  
    2. Update same Opportunity Line field 'License Amount' = same opportunity line 'Extended amount' 
     
    This doesnt result in any update the field License Amount is always 0.00 also a warning appears that since I am updating same entity that triggers the flow it may result in infinite loop. 
     
  • Suggested answer
    Leah Ju Profile Picture
    Leah Ju Microsoft Employee on at
    Calculated fields in Opportunity Line entity not visible in Opportunity entity Rollup Field query
    Hi,
    If you don't want to use Plugin or JS, you can consider that using power automate to create one automated flow.
     
     
  • dcrmconsultant Profile Picture
    dcrmconsultant 16 on at
    Calculated fields in Opportunity Line entity not visible in Opportunity entity Rollup Field query
    Leah Ju: Thank you!
     
    What is the best practice for this scenario to get the sum of License amount in Opportunity Line entity based on optionset in Product entity and rollup the License Amount data in License Total in Opportunity entity. 
     
    *No customization is preferred e.g. Plugin or JS unless it is the only way out. 
  • Suggested answer
    Leah Ju Profile Picture
    Leah Ju Microsoft Employee on at
    Calculated fields in Opportunity Line entity not visible in Opportunity entity Rollup Field query
    Hi,
    Probably because of the reference to 'Extend Amount', 
    Although its type is not a calculated field, but its value is automatically calculated by the system.
    I created three custom fields to test:
    1. calculated field, with Extend amount
    2. Calculated field without quoting Extend amount
    3. a normal currency field.
    The first field will not be displayed in the rollup field on the opportunity.
     
  • dcrmconsultant Profile Picture
    dcrmconsultant 16 on at
    Calculated fields in Opportunity Line entity not visible in Opportunity entity Rollup Field query
    @Leah Ju: 
     
    1. Product Type is an option set custom created field which holds values Licenses and Services.
     
    2 . Opportunity Line entity has calculated field License Amount as below
     
     
    3. Opportunity entity has rollup field License Total field but related entity Opportunity Line doesn't show License Amount field as below 
     
     
  • Leah Ju Profile Picture
    Leah Ju Microsoft Employee on at
    Calculated fields in Opportunity Line entity not visible in Opportunity entity Rollup Field query
    Hi,
    They are just set as extended amount when product type is License or Services respectively from product entity. 
    Can you share a screenshot of your calculated field settings?
    Which field value of the product was used? I'll see if I can reproduce it in my environment test.
  • dcrmconsultant Profile Picture
    dcrmconsultant 16 on at
    Calculated fields in Opportunity Line entity not visible in Opportunity entity Rollup Field query
    @Leah Ju: Thank you for your response. 
     
    I can confirm the 2 fields License Amount and Service Amount are calculated columns that don’t use another calculated column. 
     
    They are just set as extended amount when product type is License or Services respectively from product entity. 
  • Suggested answer
    Leah Ju Profile Picture
    Leah Ju Microsoft Employee on at
    Calculated fields in Opportunity Line entity not visible in Opportunity entity Rollup Field query
    Hi,
    Based on the documentation:
    Check if these two calculated fields reference another calculated field.
    As one workaround:
    1.Maybe you could consider creating two simple fields and then using other methods (workflow,js...) Calculate the amount to populate the fields.
    2.Then you can use them in the rollup field.

    I hope you can mark my answer verified if it answer your question! If you have any questions, please feel free to contact me.
    Regards,
    Leah
     

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

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,451 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,353 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans