Microsoft Dynamics NAV Documentation

Sub Process Functionality

Sub Process Functionality supports calling another (sub) processes during the execution of the running (main) process. The Sub Process is nested into the Flow and will be seamlessly integrated into the main process, as it would be just another screen(s).

As an example the Move Inventory Process has been subject to this functionality, by excluding the Item selection from the Main Process. A new Process "SELECTITEM" will now be handling the selection of an item, by scanning, entering or looking up the number.

We have defined two screens; one card and one data grid screen. The Flow will link the individual screens, but in this case we only have a lookup screen, which is not part of the flow. The only additional flow that is necessary is to mark the end of a sub process, to return to the main process and that is by defining a flow line with an "End Process" type/Code.

The Sub Process will list a number of Parameters. These parameters are used to store values, but also to exchange information with the Main Process.

It can be decided that a Sub Process only displays info, but it can also request info from the user and to be shared with the Main Process. The setup of exchanging the Parameters is done in the Main Process.

The Flow of the Main Process contains the flow line(s) that interact with the Sub Process. The selected line in the screenshot above, shows that after the "02-BINFROM" screen, the flow will direct the user to the Sub Process "SELECTITEM". Make sure that a flow line has been configured that starts again from the Sub Process, in order to continue the Flow after the Sub Process is completed.

When selecting a Flow Line that will start a Sub Process on "True", it is possible to link the necessary Parameters from the Main Process to the Sub Process.

By selecting the appropriate Flow Line, the button "Subprocess Relation Mapping" will become enabled and by clicking on it, a new page will appear. All known Parameters from the Sub Process can now be linked to Parameters from the Main Process.

Three choices can be made regarding the Direction:

  1. If you only need to push the Parameter value into the Sub Process, but no need for a return value, the "Source->Target" can be used.

  2. If there is a need to receive the Parameter value from the Sub Process, the "Target->Source" is applied.

  3. If the Sub Process needs input from a specific Parameter, but also need to send an update for this Parameter, "Both" will be used.

If the Main Process doesn't have a value, but an initial value is expected, the "Expression" field can be used for a value.