lazhen
2025-01-09 8afe90b633046db39042aada36b88193062f8cff
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
33
34
35
36
37
38
39
40
Quintiq file version 2.0
#parent: #root
Method ImportAsIfFrom3DSpace (String dataTransformationID_i, Boolean doSynchronize_i) as Boolean id:Method_LibDIF_GlobalState_ImportAsIfFrom3DSpace
{
  #keys: '[131092.1.780824520]'
  Body:
  [*
    // Import data from JSON.
    success := false;
    
    // Ask the user for the JSON-file that contains the IDs of the objects that must be imported.
    fileRef := Application.GetOpenFileName( "json" );
    
    if( fileRef <> "" )
    {
      // Make sure that the Integration-dataset is selected.
      if( this.EnsureIntegrationDataset() )
      {
        // Call the QIntegrator to import the data as integration objects.
        // Synchronize the data if applicable.
        api := this.GetIntegrationAPI();
        if( not isnull( api ) )
        {
          if( doSynchronize_i )
          {
            api.ImportAsIfFrom3DSpaceAndSynchronize( fileRef, dataTransformationID_i );
          }
          else
          {
            api.ImportAsIfFrom3DSpace( fileRef, dataTransformationID_i );
          }
    
          success := true;
        }
      }
    }
    
    return success;
  *]
}