Quintiq file version 2.0
#parent: MatrixEditorTimeCapacities
Response OnUpdateValue (
  structured[UnitPeriodTime] cell,
  Number value
) id:Response_MatrixEditorTimeCapacities_OnUpdateValue_273
{
  #keys: '[154394.0.135564678]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebMatrixEditor_OnUpdateValue'
  QuillAction
  {
    Body:
    [*
      //Update Maintenance duration
      data := shadow( cell.Element( 0 ).UnitAvailability() );
      isnumberofunits := focusedattribute = attribute( UnitPeriodTime, NrOfOpen ).Name();
      if( isnull( data ) )
      {
        data := cell.Element( 0 ).Unit().UnitAvailability( relshadow );
      }
      UnitAvailability::CreateOrUpdateForUnitPeriodTimes( cell,
                                                          false,
                                                          data.TimeUnit(),
                                                          data.Maintenance(),
                                                          false,
                                                          data.Efficiency(),
                                                          false,
                                                          data.Allocation(),
                                                          false,
                                                          data.ShiftPattern(),
                                                          false,
                                                          data.MaximumLoadPercentage(),
                                                          isnumberofunits,
                                                          ifexpr( isnumberofunits, value, data.NrOfUnitsOpen() ),
                                                          false,
                                                          false,
                                                          data.MinimumLoadThreshold()
                                                        );
    *]
    GroupServerCalls: false
  }
}
