Skip to content

Instantly share code, notes, and snippets.

@BrianMRO
Last active March 3, 2022 15:22
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save BrianMRO/82b7c5075ef046207406857bd13116e4 to your computer and use it in GitHub Desktop.
Workflow - Disable or Hide Actions
#region Actions - Hide (Pre-Defined Action)
screen
.WithActions(action =>
{
action.Add(removeHold);
action.Add(putOnHold);
action.Add(complete);
action.Add(reopen);
action.Add(g => g.schedule, a => a
.WithCategory(processingCategory)
.IsHiddenWhen(conditions.IsScheduled)
);
});
#endregion
#region Actions - Disable (Workflow Defined Action)
var complete = context.ActionDefinitions
.CreateNew(_actionComplete, a => a
.WithCategory(processingCategory)
.PlaceAfter(putOnHold)
.IsDisabledWhen(!conditions.IsScheduled)
);
#endregion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment