Navigation to Order by Plugin Initiative (Continuation)

Tags: v8

In the V8 API, a second step has been made towards the ability to show dialog windows and navigate to an order by plugin initiative from different screens.

In one of the previous news articles we discussed ways to navigate to an order via plugin buttons or from the order editing screen. Now such navigation is also supported from other screens:

To understand that we are on a screen that supports UI operations, you need to subscribe to the event ScreenChanged.

If the screen received in the event is one of the screens listed above, you can call the new method TryExecuteUiOperation, to which you need to pass a reference to a callback that SyrveFront will call as soon as the opportunity arises. If idle, this will happen immediately, but if other operations are being executed at that moment, the callback will be called right after they finish. In any case, the TryExecuteUiOperation method will return control after the callback is invoked. If the callback throws an exception, it will propagate out of TryExecuteUiOperation. If at the time of calling TryExecuteUiOperation another operation was being executed that ultimately led to exiting the current screen, the callback will not be called either immediately or deferred, and the TryExecuteUiOperation method will generate an OperationCanceledException.

During the execution of the callback, a progress bar is displayed. The callback will receive an IViewManager with the ability to show dialog windows and change the text on the progress bar, as well as the ability to navigate to the order.

Navigation is only possible to an open order. When calling the method, the corresponding rights of the currently logged-in employee on the front are checked. The same rights that are checked when navigating by pressing buttons on the front itself. Navigation to a delivery order is currently not possible.