| Quintiq file version 2.0 | 
| #parent: #root | 
| Method DeleteSoftDeletedData | 
| { | 
|   Description: 'Delete all data which are IsSoftDeleted, used to clean up data which is soft deleted.' | 
|   TextBody: | 
|   [* | 
|     // Delete all data which are IsSoftDeleted, used to clean up data which is soft deleted | 
|     // Delete Units | 
|     units := selectset( this, Unit, unit, unit.IsSoftDeleted() ); | 
|     Unit::Delete( units ); | 
|      | 
|     // Delete Operations | 
|     operations := selectset( this, Unit.Operation, rout, rout.IsSoftDeleted() ); | 
|     Operation::Delete( operations, true ); | 
|      | 
|     // Delete Lanes | 
|     lanes := selectset( this, Unit.Lane, lane, lane.IsSoftDeleted() ); | 
|     Lane::Delete( lanes ); | 
|      | 
|     // Delete LaneLegs | 
|     lanelegs := selectset( this, Unit.Lane.LaneLeg, ll, ll.IsSoftDeleted() ); | 
|     LaneLeg::Delete( lanelegs ); | 
|      | 
|     // Delete LaneCosts | 
|     lanecosts := selectset( this, Unit.Lane.LaneCost, lc, lc.IsSoftDeleted() ); | 
|     AccountCost::Delete( lanecosts ); | 
|      | 
|     // Delete LaneLegCosts | 
|     lanelegcosts := selectset( this, Unit.Lane.LaneLeg.LaneLegCost, llc, llc.IsSoftDeleted() ); | 
|     AccountCost::Delete( lanelegcosts ); | 
|      | 
|     // Delete OperationCosts | 
|     operationcosts := selectset( this, Unit.Operation.OperationCost, rc, rc.IsSoftDeleted() ); | 
|     AccountCost::Delete( operationcosts ); | 
|      | 
|     // Delete UnitCosts | 
|     unitcosts := selectset( this, Unit.UnitCost, uc, uc.IsSoftDeleted() ); | 
|     AccountCost::Delete( unitcosts ); | 
|      | 
|     // Delete CampaignType_MPs | 
|     campaigntypes := selectset( this, Unit.CampaignType_MP, camptyp, camptyp.IsSoftDeleted() ); | 
|     CampaignType_MP::Delete( campaigntypes ); | 
|      | 
|     // Delete Campaign_MPs | 
|     campaigns := selectset( this, Unit.CampaignType_MP.Campaign_MP, camp, camp.IsSoftDeleted() ); | 
|     Campaign_MP::Delete( campaigns ); | 
|      | 
|     // Delete OperationInCampaignTypes | 
|     operationincampaigntypes := selectset( this, Unit.Operation.OperationInCampaignType, rict, rict.IsSoftDeleted() ); | 
|     OperationInCampaignType::Delete( operationincampaigntypes ); | 
|      | 
|     // Delete StockingPointUnits | 
|     stockingpointunits := selectset( this, Unit.StockingPointUnit, spu, spu.IsSoftDeleted() ); | 
|     StockingPointUnit::Delete( stockingpointunits ); | 
|      | 
|     // Delete SupplySpecifications | 
|     supplyspecifications := selectset( this, Unit.SupplySpecification, ss, ss.IsSoftDeleted() ); | 
|     SupplySpecification::Delete( supplyspecifications ); | 
|      | 
|     // Delete TransportAvailabilities | 
|     transportcapacities := selectset( this, Unit.TransportAvailability, tc, tc.IsSoftDeleted() ); | 
|     TransportAvailability::Delete( transportcapacities ); | 
|      | 
|     // Delete UnitAvailabilities | 
|     unitavailabilities := selectset( this, Unit.UnitAvailability, ua, ua.IsSoftDeleted() ); | 
|     UnitAvailability::Delete( unitavailabilities ); | 
|      | 
|     // Delete UnitCalendarElements | 
|     unitcalendarelements := selectset( this, Unit.UnitCalendarElement, uce, uce.IsSoftDeleted() ); | 
|     UnitCalendarElement::Delete( unitcalendarelements ); | 
|      | 
|     // Delete UnitCapacities | 
|     unitcapacities := selectset( this, Unit.UnitCapacity, uc, uc.IsSoftDeleted() ); | 
|     UnitCapacity::Delete( unitcapacities ); | 
|      | 
|     // Delete Product_MPs | 
|     products := selectset( this, Product_MP, prod, prod.IsSoftDeleted() ); | 
|     Product_MP::Delete( products ); | 
|      | 
|     // Delete ProductInLanes | 
|     productinlanes := selectset( this, Product_MP.ProductInLane, pil, pil.IsSoftDeleted() ); | 
|     ProductInLane::Delete( productinlanes ); | 
|      | 
|     // Delete ProductInStockingPoint_MPs | 
|     pisps := selectset( this, Product_MP.ProductInStockingPoint_MP, pisp, pisp.IsSoftDeleted() ); | 
|     ProductInStockingPoint_MP::Delete( pisps ); | 
|      | 
|     // Delete InventorySpecifications | 
|     inventoryspecifications := selectset( this, Product_MP.ProductInStockingPoint_MP.InventorySpecification, is, is.IsSoftDeleted() ); | 
|     InventorySpecification::Delete( inventoryspecifications ); | 
|      | 
|     // Delete InventorySupplies | 
|     inventorysupplies := selectset( this, Product_MP.ProductInStockingPoint_MP.InventorySupply, is, is.IsSoftDeleted() ); | 
|     InventorySupply::Delete( inventorysupplies ); | 
|      | 
|     // Delete PostponedSalesDemandCosts | 
|     postponedsalesdemandcosts := selectset( this, Product_MP.ProductInStockingPoint_MP.PostponedSalesDemandCost, psdc, psdc.IsSoftDeleted() ); | 
|     PostponedSalesDemandCost::Delete( postponedsalesdemandcosts ); | 
|      | 
|     // Delete StockingPointCosts | 
|     stockingpointcosts := selectset( this, StockingPoint_MP.StockingPointCost, spc, spc.IsSoftDeleted() ); | 
|     AccountCost::Delete( stockingpointcosts ); | 
|      | 
|     // Delete PISPAccounts | 
|     pispaccounts := selectset( this, Account_MP.AccountAssignment.astype( PISPAccount ), pispacc, pispacc.IsSoftDeleted() ); | 
|     AccountAssignment::Delete( pispaccounts ); | 
|      | 
|     // Delete StockingPointAccounts | 
|     stockingpointaccounts := selectset( this, Account_MP.AccountAssignment.astype( StockingPointAccount ), spacc, spacc.IsSoftDeleted() ); | 
|     AccountAssignment::Delete( stockingpointaccounts ); | 
|      | 
|     // Delete UnitAccounts | 
|     unitaccount := selectset( this, Account_MP.AccountAssignment.astype( UnitAccount ), unitacc, unitacc.IsSoftDeleted() ); | 
|     AccountAssignment::Delete( unitaccount ); | 
|      | 
|     // Delete Currency_MPs | 
|     currencies := selectset( this, Currency_MP, curr, curr.IsSoftDeleted() ); | 
|     Currency_MP::Delete( currencies ); | 
|      | 
|     // Delete CurrencyRate_MPs | 
|     currencyrates := selectset( this, Currency_MP.CurrencyRate_MP, currate, currate.IsSoftDeleted() ); | 
|     CurrencyRate_MP::Delete( currencyrates ); | 
|      | 
|     // Delete Groups | 
|     groups := selectset( this, Group, group, group.IsSoftDeleted() ); | 
|     Group::Delete( groups ); | 
|      | 
|     // Delete Ingredients | 
|     ingredients := selectset( this, Ingredient, ingredient, ingredient.IsSoftDeleted() ); | 
|     Ingredient::Delete( ingredients ); | 
|      | 
|     // Delete PeriodSpecification_MPs | 
|     periodspecifications := selectset( this, PeriodSpecification_MP, ps, ps.IsSoftDeleted() ); | 
|     PeriodSpecification_MP::Delete( periodspecifications ); | 
|      | 
|     // Delete Priorities | 
|     priorities := selectset( this, Priority, prio, prio.IsSoftDeleted() ); | 
|     Priority::Delete( priorities ); | 
|      | 
|     // Delete ProductLevel_MPs | 
|     productlevels := selectset( this, ProductLevel_MP, plevel, plevel.IsSoftDeleted() ); | 
|     ProductLevel_MP::Delete( productlevels ); | 
|      | 
|     // Delete Recipes | 
|     recipes := selectset( this, Recipe, recipe, recipe.IsSoftDeleted() ); | 
|     Recipe::Delete( recipes ); | 
|      | 
|     // Delete BaseRecipeIngredients | 
|     recipeingredients := selectset( this, Recipe.BaseRecipeIngredient, ri, ri.IsSoftDeleted() ); | 
|     BaseRecipeIngredient::Delete( recipeingredients ); | 
|      | 
|     // Delete SalesDemands | 
|     salesdemands := selectset( this, SalesDemand, sd, sd.IsSoftDeleted() ); | 
|     SalesDemandBase::Delete( salesdemands ); | 
|      | 
|     // Delete SalesLevel_MPs | 
|     saleslevels := selectset( this, SalesLevel_MP, sl, sl.IsSoftDeleted() ); | 
|     SalesLevel_MP::Delete( saleslevels ); | 
|      | 
|     // Delete SalesSegment_MPs | 
|     salessegments := selectset( this, SalesSegment_MP, ss, ss.IsSoftDeleted() ); | 
|     SalesSegment_MP::Delete( salessegments ); | 
|      | 
|     // Delete ShiftPatterns | 
|     shiftpatterns := selectset( this, ShiftPattern, sp, sp.IsSoftDeleted() ); | 
|     ShiftPattern::Delete( shiftpatterns ); | 
|      | 
|     // Delete ShiftDays | 
|     shiftdays := selectset( this, ShiftPattern.ShiftDay, sd, sd.IsSoftDeleted() ); | 
|     ShiftDay::Delete( shiftdays ); | 
|      | 
|     // Delete StockingPoint_MPs | 
|     stockingpoints := selectset( this, StockingPoint_MP, sp, sp.IsSoftDeleted() ); | 
|     StockingPoint_MP::Delete( stockingpoints ); | 
|      | 
|     // Delete StockingPointCapacities | 
|     stockingpointcapacities := selectset( this, StockingPoint_MP.StockingPointCapacity, spc, spc.IsSoftDeleted() ); | 
|     StockingPointCapacity::Delete( stockingpointcapacities ); | 
|      | 
|     // Delete StockingPointInLanes | 
|     stockingpointinlanes := selectset( this, StockingPoint_MP.StockingPointInLane, spil, spil.IsSoftDeleted() ); | 
|     StockingPointInLane::Delete( stockingpointinlanes ); | 
|      | 
|     // Delete UnitOfMeasure_MPs | 
|     unitofmeasures := selectset( this, UnitOfMeasure_MP, uom, uom.IsSoftDeleted() ); | 
|     UnitOfMeasure_MP::Delete( unitofmeasures ); | 
|      | 
|     // Delete ConversionFactors | 
|     baseconversionfactors := selectset( this, UnitOfMeasure_MP.BaseConversionFactor, bcf, bcf.IsSoftDeleted() ); | 
|     ConversionFactor::Delete( baseconversionfactors ); | 
|   *] | 
| } |