Tuesday, February 24, 2015

All that basic concepts you want to know about Roll up fields in MS CRM 2015

here are the basic concepts that you want to know about roll up fields in MS CRM 2015...

In Microsoft Dynamics CRM, rollup fields are designed to help users obtain insights into data by monitoring key business metrics. A rollup field contains an aggregate value computed over the records related to a specified record, such as open opportunities of an account, or over the hierarchy of records in more complex scenarios. As an administrator or customizer, you can use the CRM user interface to define rollup fields.

The benefits and capabilities of rollup fields include the following:
• Visual editing is easy. You can create rollup fields by using the Field Editor, just like you do when you create a regular field.
• Wide selection of aggregate functions. You can aggregate data by using functions, such, as SUM, COUNT, MIN, or MAX.
• Full filter support for aggregation. You can set various filters for the source entity or related entity while setting multiple conditions.
• Seamless integration with the user interface. You can include the rollup fields in forms, views, charts and reports.
• Rollup fields are solution components. You can easily transport the rollup fields as components between organizations and distribute them in solutions.
• Rollup fields and the calculated fields are complementary to each other. You can use a rollup field as a part of the calculated field, and vice versa.

What happens when we cerate a roll up field?
Each Rollup field creates two accessory fields with <fieldname>_date and <fieldname>_state suffix pattern. The _date field is of the Datetime data type and _state field is of the integer data type. The _state field has the following values:
• 0 => NotCalculated. The field value is yet to be calculated.
• 1 => Calculated. The field value has been calculated per the last update time in _date field.
• 2 => OverflowError. The field value calculation resulted in overflow error.
• 3 => OtherError. The field value calculation failed due to an internal error. The following run of the calculation job will likely fix it.
• 4 => RetryLimitExceeded. The field value calculation failed because the maximum number of retry attempts to calculate the value was exceeded due to high number of concurrency and locking conflicts.
• 5 => HierarchicalRecursionLimitReached. The field value calculation failed because the maximum hierarchy depth limit for the calculation was reached.
• 6 => LoopDetected. The field value calculation failed because a recursive loop was detected in the hierarchy of the record.

Rollup calculations
The rollups are calculated by scheduled system jobs that run asynchronously in the background. You have to be an administrator to view and manage the rollup jobs. To view the rollup jobs go to Settings > System Jobs > View > Recurring System Jobs. To quickly find a relevant job, you can filter by the System Job type: Mass Calculate Rollup Field or Calculate Rollup Field.

• Mass Calculate Rollup Field is a recurring job, created per a rollup field. It runs once, after you created or updated a rollup field. The job recalculates the specified rollup field value in all existing records that contain this field. By default, the job will run 12 hours after you created or updated a field. After the job completes, it is automatically scheduled to run in the distant future, approximately, in 10 years. If the field is modified, the job resets to run again in 12 hours after the the update. The 12 hour delay is needed to assure that the Mass Calculate Rollup Field runs during the non-operational hours of the organization. It is recommended that an administrator adjusts the start time of a Mass Calculate Rollup Field job after the rollup field is created or modified, in such a way that it runs during non-operational hours. For example, midnight would be a good time to run the job to assure efficient processing of the rollup fields.
• Calculate Rollup Field is a recurring job that does incremental calculations of all rollup fields in the existing records for a specified entity. There is only one Calculate Rollup Field job per entity. The incremental calculations mean that the Calculate Rollup Field job processes the records that were created, updated or deleted after the last Mass Calculate Rollup Field job finished execution. The default maximum recurrence setting is one hour. The job is automatically created when the first rollup field on an entity is created and deleted when the last rollup field is deleted.
• Online recalculation option. If you hover over the rollup field on the form, you can see the time of the last rollup and you can refresh the rollup value by choosing the Refresh icon next to the field, as shown below:
 
Important things to consider (limitations)
◦ You have to have Write privileges on the entity and Write access rights on the source record on which you are requesting the Refresh. For example, if you are calculating the estimated revenue from the open opportunities of an account, you don’t have to have Write privileges on the opportunity entity, only on the account entity.
◦ This option is only available in the online mode. You can’t use it while working offline.
◦ The maximum number of records during the rollup refresh is limited to 50,000 records. In case of the hierarchical rollup, this applies to the related records across the hierarchy. If the limit is exceeded, you see an error message: “Calculations can’t be performed online because the calculation limit of 50,000 related records has been reached.” This limit does not apply when the rollup is automatically recalculated by the system jobs.
◦ The maximum hierarchy depth is limited to 10 for the source record. If the limit is exceeded, you see an error message: “Calculations can’t be performed online because the hierarchy depth limit of 10 for the source record has been reached.” This limit does not apply when the rollup is automatically recalculated by the system jobs.
NOTE:
As a system administrator, you can modify the rollup job recurrence pattern, postpone, pause or resume the rollup job. However, you can’t cancel or delete a rollup job. To pause, postpone, resume or modify the recurrence pattern, go to Settings > System Jobs. In View, select Recurring System Jobs. On the nav bar, choose Actions and select the action you want. For the Mass Calculate Rollup Field job, the available selections are: Resume, Postpone, and Pause. For the Calculate Rollup Field job, the available selections are: Modify Recurrence, Resume, Postpone, and Pause.
 
Regards,
Yes.Sudhnashu


4 comments:

  1. Wow! Great post! The content is very rich, and I really like it. It help me very much to solve some problems. It is very helpful for all the people on the web. Thanks a lot. ERP Software in Mumbai || MLM Software || MLM Software in Mumbai

    ReplyDelete
  2. Excellent post. I was checking constantly this blog and I am impressed! Extremely helpful info specially the last part :) I care for such information a lot. Thank you and best of luck. CRM Software || CRM Software in Mumbai || ERP Software

    ReplyDelete
  3. When I try to cancel the calculate rollup field job, it says that "The state transition requested is not valid for the current state. Current state: 3, current status: 32, target state: 1."
    I'm however able to do it in a vanilla environment. does this have something to do with sandbox?

    ReplyDelete
  4. Great blogpost and thanks for sharing such useful information about Microsoft Dynamics. If you are looking for the best Microsoft Dynamics Recruiters in USA then you should visit at Microsoft Dynamics jobs and recruitment.DFSM Recruitment provide various kinds of best Jobs hiring and Vacancies in the field of Microsoft Dynamics AX and CRM In USA.

    ReplyDelete