Quintiq file version 2.0 #parent: pnlActions/btnOk Response OnClick () id:Response_pnlActions_btnOk_OnClick { #keys: '[414702.1.84941735]' DefinitionID: 'Responsedef_WebButton_OnClick' Precondition: [* flag := not isnull( GlobalOTDTable ) and not isnull( GlobalOTDLog ); activeScenario := DataHolderActiveScenario.Data(); currentScenario := DataHolderScenario.Data(); if ( activeScenario = currentScenario ) { flag := false; feedback := "无法对当前选中场景进行分发"; } isExists := exists( GlobalOTDLog, DataDistributionLog, tempDD, tempDD.ExecuteStatus() = "Running" and tempDD.MacroPlanMDSID() = currentScenario.DatasetMDSID() ); if ( flag and isExists ) { flag := false; feedback := "当前场景正在进行分发"; } return flag; *] QuillAction { Body: [* Form.ApplyChanges(); businessType := select( GlobalOTDTable, BusinessType, b, b.ScenarioName() = dropDownStringListGeneral.Text() ); DataDistributionLog::Create( GlobalOTDLog, ApplicationMacroPlanner.GetUserName(), DataHolderScenario.Data().DatasetMDSID(), DataHolderScenario.Data().Name() ); MacroPlan::DoASync( DataHolderScenario.Data(), businessType.BusinessTypeName(), checkboxIsKeyProduct.Checked(), checkboxCreatePurchaseSupplyProduct.Checked(), GlobalOTDTable ); Form.Close(); *] GroupServerCalls: false } }