yanyuan
2023-11-10 143ef74e2eeee697ac8fda3d9032a790fbb4e146
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Quintiq file version 2.0
#parent: #root
Method BrowseFiles () id:Method_LibSOPImpExp_DialogExcelImport_BrowseFiles
{
  #keys: '[144528.1.509618324]'
  Body:
  [*
    // Prompt user to browse the files.
    webfiles := Application.GetFiles();
    
    if( webfiles <> '' )
    {
      jsonArray := JSON::Parse( webfiles );
      jsonArraysize := jsonArray.Size();
      
      filenames := construct( Strings );
      filedata := construct( Strings );
      for( i := 0; i < jsonArraysize; i := i + 1 )
      {
        json := jsonArray.Get( i );
        name := json.Get( "name" ).GetString();
        data := json.Get( "data" ).GetString();
    
        // Build up the array and send once to server (avoid one call per loop)
        filenames.Add( name );
        filedata.Add( data );
      }
      
      this.O_GetAppImportObject().astype( LibSOPImpExp_ImportExcel ).SaveUserUploadedExcels( filenames, filedata );
    }
  *]
}