Quintiq file version 2.0
#parent: #root
Method RefreshData () id:Method_FormKpiSnapshots_RefreshData
{
  #keys: '[136398.1.792567524]'
  Body:
  [*
    // Refreshes all the data loaded on the form based on the current configuration.
    // This method is also called when the user clicks the Refresh button.
    
    maxitems       := this.GetMaxResults();
    timespanoption := this.RadioButtonGroupTimespan().BoundValue();
    
    set := GlobalStateKpiTracker.QueryDataFromServer( maxitems,
                                                      timespanoption,
                                                      DateTimeSelectorFrom.DateTime(),
                                                      DateTimeSelectorTo.DateTime(),
                                                      RadioButtonGroupTimeType.BoundValue() );
    
    DataHolderSnapshotSetData.Data( &set );
    
    // Refresh the UI timestamp
    Form.RefreshTimeType();
    
    // Refresh the UI label
    Form.RefreshSeries();
    
    // Refresh SnapshotData.Value.Is_Last()
    Form.RefreshUIIsLastAttribute();
    
    // Refresh FixedFilter for List 
    Form.FilterDataOnSelectedKpis();
    
    Form.AutoSelectAllSnapshots();
  *]
}
