Quintiq file version 2.0
#parent: ButtonMatAttrSettingAndPlanStrategyImport
Response OnClick () id:Response_FormMatAttrSettingAndPlanStrategy_ButtonMatAttrSettingAndPlanStrategyImport_OnClick
{
  #keys: '[414384.0.772313506]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebButton_OnClick'
  QuillAction
  {
    Body:
    [*
      try {
        uploadJson := Application.GetFile();
        json := JSON::Parse( uploadJson );
        if( json.IsArray() or json.Size() = 0 ) {
          error( "please select one .xls or .xlsx file" ); 
        }
        name := json.Get( "name" ).GetString();
        base64Data := json.Get( "data" ).GetString();
        inputSource := MatAttrSettingAndPlanStrategyInputSource::Upload( GlobalOTDTable, name, base64Data, ApplicationMacroPlanner.GetUserName() );
        inputSource.ParseTable();
        inputSource.SaveData();
      } onerror {
        info( e.GeneralInformation() );
        info( e.DetailedInformation() );
        info( e.DeveloperInformation() );
        WebMessageBox::Error( e.GeneralInformation() );
      }
    *]
    GroupServerCalls: false
  }
}
