| Quintiq file version 2.0 | 
| #parent: #root | 
| Method OnConstructed | 
| { | 
|   Description: 'On constructed of this dataset, this method will be called when the dataset is constructed and we are not running conversion' | 
|   TextBody: | 
|   [* | 
|     // When a dataset is loaded, refresh the status of the scenari | 
|     // associated with the dataset | 
|     ScenarioManager::SetDatasetLoadedStatus( this.MDSID() ); | 
|      | 
|     // DataExchangeFramework | 
|     LibDEF_API::PlanningDatasetOnConstructed( this.MDSMacroPlan(), typeof( MacroPlan ).ShortName() ); | 
|      | 
|     // Recreate wizard if we are doing conversion | 
|     if( DMF_Utility::GetIsAutoConversion() | 
|         and not isnull( this.WizardManager() ) ) | 
|     { | 
|       this.CreateSupplyChainWizard(); | 
|     } | 
|      | 
|     // Update sizing parameter status | 
|     this.UpdateSizingParameterStatus(); | 
|      | 
|     // Refresh sizing parameters (in case global values changed while dataset is offline) | 
|     opt := DatasetFindOptions::Construct( GlobalParameters_MP::GetDatasetScenarioManager() ); | 
|     sm := MDSScenarioManager::Find( opt ); | 
|     this->UpdateSizingParameters( sm ); | 
|     sm->( scenariomanager ) | 
|     { | 
|       scenariomanager.CreateRetentionPeriodPolicy();   | 
|     } | 
|      | 
|     // create optimizers | 
|     this.InitializeOptimization(); | 
|      | 
|     // Find create dtd mpsplan | 
|     DataTransformationMP_Plan::Create( this.DataTransformationDefinition() ); | 
|     DataTransformationSC_MPSPlanParameters::Create( this.DataTransformationDefinition() ); | 
|     // advanced transformation true for sc plan because of the format of the data they sent | 
|     // there will be multiple instances of headers objects, we want to process them all in one go | 
|     // by default def process them one by one | 
|     DataTransformationSC_Plan::Create( this.DataTransformationDefinition() ).AdvancedTransformationMode ( true ); | 
|      | 
|     this.InitializeCalendarRegistry(); | 
|      | 
|     // Create QI object for QI related integration logic | 
|     QIntegration_MP::Create( this ); | 
|   *] | 
| } |