Step 2: Defining the Action That Opens the Workflow Dialog Box
In this step, you will add the Assign action to the
RSSVWorkOrderEntry graph and register the action in the screen
configuration. Do the following:
- In the
RSSVWorkOrderEntrygraph, define theAssignaction, as the following code shows.public PXAction<RSSVWorkOrder> Assign = null!; [PXButton] [PXUIField(DisplayName = "Assign", Enabled = false)] protected virtual IEnumerable assign(PXAdapter adapter) => adapter.Get(); - In the
RSSVWorkOrderEntry_Workflowclass, in the lambda expression for the WithActions method at the screen configuration level, add theAssignaction, as the following code shows.actions.Add(graph => graph.Assign, action => action .WithCategory(processingCategory) .WithForm(formAssign) .WithFieldAssignments(fields => { fields.Add<RSSVWorkOrder.assignee>(field => field.SetFromFormField(formAssign, "Assignee")); }));In the code above, you have added the
Assignaction to the screen configuration. You have specified the workflow dialog box for the action in the WithForm method and the DAC field that should be updated from the dialog box in the WithFieldAssignments method. - Save your changes.
