Quintiq file version 2.0 
 | 
#parent: #root 
 | 
Method OnCreate 
 | 
{ 
 | 
  TextBody: 
 | 
  [* 
 | 
    this.DatasetName( this.MDSMacroPlan().Name() ); 
 | 
    //Create related object 
 | 
    // Initialize sanitycheck group 
 | 
    SanityCheckGroup::CreateSanityCheckGroups( this ); 
 | 
    //Initialize calendar registry 
 | 
    this.InitializeCalendarRegistry(); 
 | 
     
 | 
    /* isfromdb is set to true so that default objects are created with 
 | 
       IsManuallyConfigured = false 
 | 
    */ 
 | 
    isfromdb := true; 
 | 
     
 | 
    // Period parameters 
 | 
    start := DateTime::ActualTime().StartOfYear(); 
 | 
    PeriodParameter_MP::Create( '1', 
 | 
                                this, 
 | 
                                start, 
 | 
                                isfromdb ); 
 | 
     
 | 
    // GlobalParameters 
 | 
    this.GlobalParameters_MP( relnew, ID := '1', PeriodSpecificationForUnitActual := GlobalParameters_MP::GetDefaultPeriodSpecification() ); 
 | 
     
 | 
    // Create resource manager where it contains certain limit of data, applicable to 3ds cloud 
 | 
    this.ResourceManager_MP( relnew ); 
 | 
    this.UpdateSizingParameterStatus(); 
 | 
     
 | 
    this.SmartPlanSetting( relnew ); 
 | 
    this.IDHolder( relnew ); 
 | 
     
 | 
    // Create default sales segment 
 | 
    SalesSegment_MP::Create( this, null(SalesSegment_MP), GlobalParameters_MP::GetDefaultSalesSegment(), 0, isfromdb ); 
 | 
     
 | 
    // Create default period specification 
 | 
    PeriodSpecification_MP::Create( GlobalParameters_MP::GetDefaultPeriodSpecification(),  
 | 
                                    this, GlobalParameters_MP::GetDefaultPeriodSpecTimeUnit(),  
 | 
                                    1,  
 | 
                                    DateTime::Now().StartOfYear(), 12, 18, isfromdb, 
 | 
                                    true, 
 | 
                                    false ); 
 | 
     
 | 
    // Create dummy period specification for leading periods 
 | 
    PeriodSpecification_MP::Create( GlobalParameters_MP::GetDefaultPlanningPeriodSpecification(),  
 | 
                                    this, "",  
 | 
                                    0,  
 | 
                                    DateTime::Now().StartOfYear(), 0, 0, false, 
 | 
                                    false, 
 | 
                                    true ); 
 | 
     
 | 
    isproductcategory := false; 
 | 
    ProductLevel_MP::Create( GlobalParameters_MP::GetProductRoot(), isproductcategory, this, isfromdb ); 
 | 
    SalesLevel_MP::Create( GlobalParameters_MP::GetRegionRoot(), this, isfromdb ); 
 | 
     
 | 
    this.CreateDefaultPriority(); 
 | 
     
 | 
    this.MPVersion( DomainModel::Domain().Version().Version() ); 
 | 
     
 | 
    rcv := RoutingConfiguratorView::Create( this.IDHolder().GetRoutingConfiguratorViewID(), this ); 
 | 
    this.IDHolder().RoutingConfiguratorViewID( [Number]rcv.ID() ) 
 | 
     
 | 
    SCVConfiguration::Create( this ); 
 | 
     
 | 
    UnitOfMeasure_MP::CreateDefaultUOM( this ); 
 | 
    Currency_MP::CreateBaseCurrency( this ); 
 | 
     
 | 
    // Create account cost drivers 
 | 
    AccountCostDriver::CreateAccountCostDrivers( this ); 
 | 
     
 | 
    // Create default shiftpattern 
 | 
    ShiftPattern::CreateDefaultShiftPattern( this ); 
 | 
     
 | 
    // DataExchangeFramework 
 | 
    dtd := DataTransformationDefinition::Create( this ); 
 | 
    DataTransformationManufacturingDemand::Create( dtd ); 
 | 
     
 | 
    // Create MacroPlanPTF object 
 | 
    MacroPlanPTF::Create( this ); 
 | 
     
 | 
    // Create wizard manager 
 | 
    this.WizardManager( relnew, Id := "" ); 
 | 
     
 | 
    this.PreliminaryFeature( relnew ); 
 | 
     
 | 
    this.SetTime(); 
 | 
     
 | 
    // Create wizard for supply chain initialization 
 | 
    this.CreateSupplyChainWizard(); 
 | 
     
 | 
    // MEIO parameters 
 | 
    this.MEIO_Parameters( relnew ); 
 | 
     
 | 
    // Create World puzzle 
 | 
    this.FindCreateWorldPuzzle(); 
 | 
  *] 
 | 
  InterfaceProperties { Accessibility: 'Extensible' } 
 | 
} 
 |