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 CRM (Archived)

Re-calculate Roll-up field from JavaScript

(0) ShareShare
ReportReport
Posted on by

Hello Experts,

I kind of know it is not possible, but is there any supported / unsupported way to force the form to recalculate a roll-up field through JavaScript. If not possible through JS what about through a plugin?

Looking forward to hear

AbD

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Drew Poggemann Profile Picture
    4 on at

    Hi Abu,

    We have used the following in two customer implementations and it worked great!  

    calculaterollupfield.codeplex.com

    Hope this helps.

    Thanks,

  • Suggested answer
    Neil Parkhurst Profile Picture
    10,727 User Group Leader on at

    I have used the workflow tools below. (Maybe the same / similar to suggestion from Drew.)

    msdyncrmworkflowtools.codeplex.com

  • Community Member Profile Picture
    on at

    Thank you Drew & Neil, I will try this;

    the msdyncrmwokflowtools is for 2016 I guess

  • Drew Poggemann Profile Picture
    4 on at

    Please mark verified if you can.  Thanks much!

  • Suggested answer
    Yadnyesh Kuvalekar Profile Picture
    4,102 on at

    Using plugin code and CalculateRollupField message you can forcefully refresh rollup field.

    This is supported way and is documented by Microsoft on MSDN. Refer below link:

    [View:https://msdn.microsoft.com/en-in/library/dn817863.aspx:750:50]

    on-demand.png

  • Community Member Profile Picture
    on at

    Hello Drew,

    I was trying the codeplex solution and created a Synchronous WF, but getting the following error.

    Sync workflow failed with error message - Unhandled Exception: Microsoft.Crm.Workflow.Services.InvalidCustomActivityExecutionException: 'ops_item' (My Custom Entity which is Parent in this scenario) entity doesn't contain attribute with Name = '100.00' (This is, in fact, the current value of the roll-up fieldI am trying to recalculate).

    Have you encountered anything similar ?

    Thanks in advance.

    AbD

  • Yadnyesh Kuvalekar Profile Picture
    4,102 on at

    Can you provide screenshot of the workflow with propeties you are setting?

  • Community Member Profile Picture
    on at

    Abu, why via JS?

    You can modify the recurrence on the field to meet quick calculations. Let me know!

  • Community Member Profile Picture
    on at

    wfscr.png

    Please find the screen-shot of the WF.

    Item is the Parent entity which has a rollup field "Budget Allocation Percentage" which is an aggregate of all allocation percentages in the related child entity (ItemServices). This WF is written on-create event of the child entity, ItemServices

  • Verified answer
    Drew Poggemann Profile Picture
    4 on at

    Hi Abu,

    The field name is just a text area to fill in the field name.  Do not have this be dynamic because it is actually pulling the value that way.  Example is if my field was new_budget_allocation_percentage, that is what you should put there as the value for the FieldName.

    Thanks!

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 CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans