Created
March 26, 2024 14:47
-
-
Save BrianMRO/c4d35477fcad0dc064b8eca8b1bdb3d5 to your computer and use it in GitHub Desktop.
Update existing workflow example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using PX.Data; | |
using PX.Data.WorkflowAPI; | |
using SSCS; | |
namespace PX.Objects.PO | |
{ | |
using State = POOrderStatus; | |
using static PX.Data.WorkflowAPI.BoundedTo<POOrderEntry, POOrder>; | |
using static POOrder; | |
public class POOrderEntry_Workflow_SSCS : PXGraphExtension<POOrderEntry> | |
{ | |
public static bool IsActive() => | |
SSCSAccess.FeatureInstalled<SSCSFeaturesSet.main>(); | |
public override void Configure(PXScreenConfiguration config) => Configure(config.GetScreenConfigurationContext<POOrderEntry, POOrder>()); | |
protected virtual void Configure(WorkflowContext<POOrderEntry, POOrder> context) | |
{ | |
if (IsActive() == true) | |
{ | |
context.UpdateScreenConfigurationFor(screen => | |
{ | |
screen.StateIdentifierIs<status>() | |
.WithFlows(flow => flow | |
.Update<POOrderType.regularOrder>(flowRO => flowRO | |
.WithFlowStates(states => | |
{ | |
states.Update<State.pendingPrint>(flowState => flowState | |
.WithFieldStates(fields => | |
{ | |
fields.AddField<POOrderExt.usrSSConfirmationRequired>(); | |
fields.AddField<POOrderExt.usrSSConfirmed>(); | |
})); | |
states.Update<State.pendingEmail>(flowState => flowState | |
.WithFieldStates(fields => | |
{ | |
fields.AddField<POOrderExt.usrSSConfirmationRequired>(); | |
fields.AddField<POOrderExt.usrSSConfirmed>(); | |
})); | |
states.Update<State.open>(flowState => flowState | |
.WithFieldStates(fields => | |
{ | |
fields.AddField<POOrderExt.usrSSConfirmationRequired>(); | |
fields.AddField<POOrderExt.usrSSConfirmed>(); | |
})); | |
}) | |
)); | |
return screen; | |
}); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment