标准行为是在报价未暂停时禁用对某些机会字段的修改。 我在源代码中没有找到这个规则在哪里,也不知道如何改变这个行为。
尝试这个工作流程扩展,您可能需要将其编译成DLL。
using PX.Data;
using PX.Data.WorkflowAPI;
using PX.Objects.CR;
using PX.Objects.CR.Workflows;
namespace Customization;
public class OpportunityWorkflowExt :
PXGraphExtension<OpportunityWorkflow, OpportunityMaint>
{
public override void Configure(PXScreenConfiguration config)
{
var context = config.GetScreenConfigurationContext<OpportunityMaint, CROpportunity>();
context.UpdateScreenConfigurationFor(screen =>
screen
.UpdateDefaultFlow(flows =>
flows.WithFlowStates(flowStates =>
{
flowStates.Update<OpportunityStatus.won>(state =>
state.WithFieldStates(fs =>
fs.AddField<CROpportunity.stageID>()));
flowStates.Update<OpportunityStatus.lost>(state =>
state.WithFieldStates(fs =>
fs.AddField<CROpportunity.stageID>()));
})));
}
}