Introduction
In this blog, you will learn about the marketing tools - Goal Metric and Rollup Fields.
Goal Metric and Rollup Fields
The goal metric entity (Metric) and the rollup field (RollupField) entity are used to specify the goal metric type, participating entities, and whether to track actuals, custom, or in-progress data. The goal metric and the rollup fields have a parental relationship in which all operations on the parent record are propagated to the child records.
All goals in the hierarchy must be based on the same goal metric and time period. If a child goal that is based on a different goal metric is created, an exception is thrown. If a different time period is specified for a child goal, the system will ignore the specified time period and use the parent goal time period. It is possible to associate a goal with a new metric, if the goal does not have a parent goal or a child goal. Otherwise, an exception is thrown when the goal record is updated.
Create a Goal Metric
Goal metric can be of two types:
- Amount
The Amount metric type is expressed as a money value, an integer, or a decimal number. - Count
The Count metric type is an integer.
To select Amount or Count, use the Metric.IsAmount attribute. Use the Metric.AmountDataType attribute to specify the Amount data type. The possible values for this attribute are defined in the Goal Type (metric_goaltype) global option set. To associate a goal with a metric, use the Goal.MetricId attribute. The following table lists the relationship between the goal metric type and the rollup fields available for each type.
| Goal metric type | Available rollup fields |
| Amount (money) | Goal.ActualMoney Goal.InProgressMoney Goal.CustomRollupFieldMoney |
| Amount (integer) or Count | Goal.ActualInteger Goal.InProgressInteger Goal.CustomRollupFieldInteger |
| Amount (decimal) | Goal.ActualDecimal Goal.InProgressDecimal Goal.CustomRollupFieldDecimal |

Join the conversation! Your thoughts help the community grow.