updating metric instace when field value changes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2017 02:14 PM
I have a metric definition to capture the duration from an actual start to actual finish field. However, when these field are updated after the initial metric is captured, the metric does not update as well. Is there a way I can get the metric to update when someone updates one of these fields so it will recalculate the duration?
createMetric();
function createMetric() {
var mi = new MetricInstance(definition, current);
if (mi.metricExists())
return;
var gr = mi.getNewRecord();
gr.start = current.u_actual_start;
gr.end = current.u_actual_finish;
gr.duration = gs.dateDiff(gr.start.getDisplayValue(), gr.end.getDisplayValue());
gr.calculation_complete = true;
gr.insert();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2017 02:28 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 11:01 AM
I'm having a problem where the field value duration is not capturing the "end" date and therefore is not calculating. How can this be fixed?