| Quintiq file version 2.0 | 
| #parent: #root | 
| Method UpdateForDM ( | 
|   Unit unit | 
| ) | 
| { | 
|   Description: 'This update method is created purposely for DM integration that accept the unit with new value' | 
|   TextBody: | 
|   [* | 
|     // soh yee Jan-7-2015 (created) | 
|      | 
|     // unit is the incoming unit from DMIS that has new value | 
|     // Only perform necessary search for performance propose | 
|     parentunit := ifexpr( this.ParentUnitID() = unit.ParentUnitID(), | 
|                           this.Parent(), | 
|                           Unit::FindUnitTypeIndex( unit.ParentUnitID() ) ); | 
|      | 
|     uom := ifexpr( this.UnitOfMeasureName() = unit.UnitOfMeasureName(), | 
|                    this.UnitOfMeasure_MP(), | 
|                    UnitOfMeasure_MP::FindUnitOfMeasureTypeIndex( unit.UnitOfMeasureName() ) ); | 
|      | 
|     currency := ifexpr( this.CurrencyID() = unit.CurrencyID(), | 
|                         this.Currency_MP(), | 
|                         Currency_MP::FindCurrencyTypeIndex( this.CurrencyID() ) ); | 
|      | 
|     group := ifexpr( this.GroupName() = unit.CurrencyID(), | 
|                      this.Group(), | 
|                      Group::FindGroupTypeIndex( unit.GroupName() ) ); | 
|      | 
|     this.Update( unit.ID(), unit.Name(), parentunit, unit.CapacityType(), | 
|                  group, uom, currency, | 
|                  unit.StartDate(), unit.EndDate(), unit.CampaignTypeDuration(), | 
|                  unit.IsPlannedInfinite(), | 
|                  unit.MinimumQuantity(), unit.HasMaximumQuantity(), unit.MaximumQuantity(), | 
|                  unit.LotSize(), unit.IconName(), | 
|                  unit.QuantityToProcess(), | 
|                  unit.GISCountryCode(), unit.GISCity(), unit.GISPostalCode(), | 
|                  unit.Notes(), unit.HasCapacitySmoothing(), unit.IsSmoothCapacityOverAllPeriods(), | 
|                  unit.UserCapacitySmoothingLength(), unit.CapacitySmoothingPercentageDelta(), | 
|                  unit.IsOverlapCapacitySmoothing(), unit.IsIncludedInSupplySpecification(), unit.IsSupplier(), | 
|                  unit.HasUserFrozenFutureDuration(), unit.UserFrozenFutureDuration(), | 
|                  unit.UseShiftOptimization(), | 
|                  false ); | 
|      | 
|     this.UpdateIsSoftDeleted( unit.IsSoftDeleted() ); | 
|   *] | 
| } |