Quintiq file version 2.0
#parent: lstSnapshots
Response OnClick (structured[shadow[KpiSnapshotData]] selection) id:Response_lstSnapshots_MenuSaveAsCSV_OnClick
{
  #keys: '[146450.0.1733285062]'
  Body:
  [*
    //Export to CSV file
    nvt := Kpi_GlobalState.ConvertShadowSnapshotDataToNvt( selection );
    csv := KpiCsvConverter::CreateCsvFromNvtContainingMultiple( nvt, KpiTracker );
    
    filename := this.Application().GetSaveFileName( "KpiSnapshot", "csv", "Comma-separated values workbook (.csv)" );
    if( filename <> '' )
    {
      Application.WriteTextFile( filename, csv );
    }
  *]
  CanBindMultiple: false
  DefinitionID => /lstSnapshots/Responsedef_lstSnapshots_Menu_OnClick
  Initiator: 'MenuSaveAsCSV'
}
