Workflow API: Dialog Box Enhancements

This topic describes how to configure new enhancements in dialog boxes by using Workflow API.

Addition of Rich Text Editor Fields

To add to a dialog box a field with rich text editor support, when adding the dialog box field to the configuration of a dialog box, a developer needs to call the WithRichTextEditorField() method. For example, suppose that the developer wants to display a rich text box in the dialog box. The code for adding the field to the configuration of the dialog box is shown in the following example.

.WithFields(fields => 
{
  fields.Add(_fieldReason, field => field
    .WithRichTextEditorField()    
    .Prompt("Reason")
    .DefaultValue(defaultValue));
}
Note: The WithRichTextEditorField method must be placed first in the list of configuration methods. Also, when the WithRichTextEditorField method is used, the WithSchemaOf method cannot be used.

Support of Conditions for Required Fields

In MYOB Acumatica 2023 R1 and earlier versions, a developer could mark fields in dialog boxes as required by calling the IsRequired() method when adding the field to the configuration of the dialog box.

In MYOB Acumatica 2024.1, the developer can also specify a condition that causes a field to be required if it is met. To do this, the developer can call the IsRequiredWhen() and provide the condition as a parameter.

For example, suppose that the developer wants to display the box that corresponds to the CRCase.resolution field only when the IsCaseClosed condition is true. The following code shows an example in which this field is added to the dialog box configuration.

.WithFields(fields => 
{
  fields.Add(_fieldReason, field => field
    .WithSchemaOf<CRCase.resolution>()
    .Prompt("Reason")
    .DefaultValue(defaultValue)
    .IsRequiredWhen(IsCaseClosed));
}