Navigation with the close Method

After a plug-in page is closed, you can open the page of another or even of the same plug-in. This allows you to implement complex business flows using several different plug-ins, or update Oracle Field Service entities without exiting the plug-in's page. From the current plug-in, you can redirect only to those plug-ins that use the Plugin API. The value of the Disable Plugin in offline option is not taken into account, so the plug-in must handle the offline mode properly.

Additional Parameters for Plug-in on Redirection

List of all buttons that are configured for a plug-in is sent to the plug-in in the 'buttons' field of the 'init' message. This field is a list of objects that contains the 'buttonId' and 'params' fields. buttonId is the 'context layout item id' of the button. 'params' is an object that represents the parameters that are configured for the corresponding context layout item.

You can send additional parameters on redirection to a plug-in using the backScreen param of the close message. With this, you can open the plug-in in various states or show different pages of the plug-in depending on the context. You can also use redirection to implement strict business flows using several plug-ins. Here are some examples:
  • The plug-in navigates to one of the many different plug-ins according to some business logic.

  • The plug-in shows some data only if it receives correct parameters from another plug-in. It does not show the data if it's opened directly from a button, to force the user to follow business process.

  • The plug-in implements some business logic that is based on the data from another plug-in, without the need to store this data in the entities' properties or the browser's local storage.

Navigation flow from plug-in A to plug-in B when sending parameters

The navigation flow is as follows:
  • Plug-in A sends the close message with the backpluginLabel and backpluginOpenParams fields. backpluginLabel equals to the label of plug-in B. backpluginOpenParams is an object, which contains the data needed by plug-in B.

  • After successful processing of the close message, plug-in A is closed.

  • Plug-in B is opened immediately and is shown on the page after the ready message is received.

  • Plug-in B receives the open message, which contains the openParams field. The value of this field equals to the value of backpluginOpenParams sent by plug-in A.

Requirements for the "backPluginOpenParams" Field

The requirements are as follows:
  • backPluginOpenParams is a plain object.

  • The maximum number of the object's fields is 20.

  • Each field of the object has a scalar value (string, number, bool, null, undefined). Nested objects are forbidden.

  • The size is limited to 5 KB and includes JSON structure overhead. That is, the limit is applied to the length of the serialized JSON string.

Example of the close message sent by plug-in A

{
    "apiVersion": 1,
    "method": "close",
    "entity": "activity",
    "backScreen": "plugin_by_label",
    "backPluginLabel": "plugin_b",
    "backPluginOpenParams": {
        "foo": "bar"
    }
}  

Example of the open message received by plug-in B

{
    "apiVersion": 1,
    "method": "open",
    "entity": "activity",
    "openParams": {
        "foo": "bar"
    }
    ...
}