| Quintiq file version 2.0 | 
| #parent: #root | 
| Method JobUpdateCompany ( | 
|   ScenarioMP scenario | 
| ) | 
| { | 
|   Description: 'Update self with information from a scenario' | 
|   TextBody: | 
|   [* | 
|        // yew wayne Feb-19-2013 (created) | 
|         | 
|        scenario := select( scenario, ScenarioManager.ScenarioMP, s, not s.IsDeleted(), s.DatasetMDSID() = this.MDSID() ); | 
|         | 
|        if( not isnull( scenario ) ) | 
|        { | 
|          this.MDSMacroPlan().Description( scenario.Name() ); | 
|         | 
|          if( this.MDSMacroPlan().State() <> scenario.State() ) | 
|          { | 
|            mds := MDSEditor::Editor().ObjectInfo( scenario.DatasetMDSID() ); | 
|            MDSEditor::Editor().ChangeState( mds.MDSID(), scenario.State(), true ); | 
|          } | 
|         | 
|          scenarioname := scenario.Name(); | 
|          this.ScenarioName( scenarioname ); | 
|          this.MacroPlanKBName( scenario.ScenarioManager().CompanyKBName() ); | 
|          this.SystemMode( scenario.ScenarioManager().SystemMode() ); | 
|         | 
|          accounttemplates := selectset( scenario.ScenarioManager(), KPI.astype( Account ), accounts, true, true ); | 
|         | 
|          Account_MP::SynchronizeWithTemplate( this, accounttemplates ); | 
|           | 
|          // update sizing paremeters | 
|          resourcemanager_SM := scenario.ScenarioManager().ResourceManager_SM(); | 
|          if( not isnull( resourcemanager_SM ) ) | 
|          { | 
|            this.JobUpdateSizingParameters( resourcemanager_SM ); | 
|          } | 
|           | 
|     // update strategy details to globalprameter | 
|           strategies := selectset(  scenario, ScenarioManager.Strategy, strategy, true ); | 
|           this.UpdateStrategiesSettingsInGlobalParameter( strategies );  | 
|                                                                   | 
|          // Jian Giang June-28-2016 Synchrosize SanityCheckCategories KT | 
|          SanityCheckCategoryLevel::Synchronize( this ); | 
|        } | 
|   *] | 
| } |