Quintiq file version 2.0
#parent: #root
Method QueryDataFromServer (
  Number maxitems,
  String timespanoption,
  DateTime datetimeFrom,
  DateTime datetimeTo,
  String timetype
) as shadow[KpiSnapshotSetData] id:Method_GlobalStateKpiTracker_QueryDataFromServer
{
  #keys: '[146874.0.1589193446]'
  Body:
  [*
    // Queries the Kpi Tracker for the Kpi track data
    data           := null( NamedValueTree );
    
    if ( timespanoption = 'all' )
    {
      data     := KpiTracker.SnapshotRetrieval().GetLastSnapshotsNvt( maxitems );
    }
    else
    {
      from     := datetimeFrom;
      to       := datetimeTo;
      data     := KpiTracker.SnapshotRetrieval().GetSnapshotsNvt( from, to, timetype, maxitems );
    }
    
    return GlobalStateKpiTracker.ConvertNvtToShadowSnapshotSetData( data );
  *]
  ReturnsOwning: true
}
