Quintiq file version 2.0
#parent: MatrixEditorProductPlanning
Response OnStartEdit (
  structured[ProductInStockingPointInPeriod] cell,
  structured[internal[MatrixEditorCell]] newvalue
) id:Response_FormProductPlanningMatrix_MatrixEditorProductPlanning_OnStartEdit
{
  #keys: '[132448.0.53411038]'
  Body:
  [*
    // Start edit
    this.StartEdit();
  *]
  CanBindMultiple: false
  DefinitionID => /Responsedef_FormProductPlanningMatrix_MatrixEditorProductPlanning_OnStartEdit
  Precondition:
  [*
    attributes := selectvalues( newvalue, Elements, e, true, e.AttributePath() );
    isSupply_o := false;
    cond := MacroPlan.CanPlan( feedback )
            and ProductInStockingPointInPeriod::CanEnterSupplyQuantity( feedback,
                                                                        cell,
                                                                        attributes,
                                                                        isSupply_o );
    
    if( cond )
    {
      if( isSupply_o )
      {
        periods := selectset( cell, Elements.Period_MP, period, true );
        cond := ScenarioManager::CanStartSmartPlan( ScenarioManager,
                                                    DataHolderActiveScenario.Data(),
                                                    true,
                                                    periods,
                                                    feedback );
      }
    }
    
    return cond;
  *]
}
