| Quintiq file version 2.0 | 
| #parent: #root | 
| MethodOverride Execute | 
| { | 
|   Description: 'Find relevent dataset then export to demand planner' | 
|   TextBody: | 
|   [* | 
|     // OVERRIDE to set export in progress | 
|     opt := DatasetFindOptions::Construct( this.MacroPlanDatasetName() ); | 
|     mp := MDSMacroPlan::Find( opt ); | 
|      | 
|     opt := DatasetFindOptions::Construct(); | 
|     dfrepo := MDSLibDEF_DataRepository::Find( opt ); | 
|      | 
|     opt := DatasetFindOptions::Construct(); | 
|     db := MDSLibDEF_DataBroker::Find( opt ); | 
|      | 
|     this | 
|     ->SetStatusInProgress() | 
|     ->( streamExportSalesDemand ) | 
|     { | 
|       mp->ExportToDM( dfrepo, | 
|                       true, // true to export sales demand | 
|                       select( db, System.SetTypeMeta.SetMeta, sm, sm.Name() = this.SetMetaName() and sm.ChannelName() = LibDEC_ChannelManufacturingDemand::CHANNEL_NAME() ), | 
|                       this.IsNewSet(), | 
|                       this.NewSetName(), | 
|                       false, // false to export MPSPlan | 
|                       null( LibDEF_SetMeta ), // pass in null MPSPlan | 
|                       false, // false to create new MPSPlan | 
|                       '' ) // empty name for new mpsplan name | 
|     } | 
|     ->|this->SetStatusDone() | 
|     ->|mp->SetLastExportTime(); | 
|   *] | 
| } |