How can I modify the icons and text of a plug-in tile?

You can implement a flexible flow for the buttons of a plugin on the Landing Page. You can change the icons on the buttons individually, or all at once. The icon can be changed when the Oracle Fusion Field Service Core Application is opened ('initEnd'), after plugin is closed ('close'), or when a plugin gets new data in the background mode (‘sleep’). See the Example of Changing Buttons in a Plug-in topic to understand how it works.

List of all buttons that are configured for a plugin is sent to the plugin in the 'buttons' field of the 'init' message. This field is a list of objects that contain 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.

The 'open' message contains the buttonId and openParams fields. buttonId is the 'context layout item id' of the button that the user clicks to open the plugin. openParams contains the parameters that are configured for this button.

If a plugin is opened by sending the backScreen: "plugin_by_label" from another plugin, the buttonId and openParams fields are sent in accordance with the backPluginButtonId param of the 'close' message. If the backPluginOpenParams field of the 'close' message contains the key, which is already configured for the button, the openParams field contains the value that's sent in backPluginOpenParams.

If backPluginButtonId was not set, the 'open' message doesn't contain the buttonId and openParams fields. This table shows the data in the 'init', ‘open’ and ‘close' messages that is used for changing appearances:
Message Type Field Description
init buttons List of objects that contain the 'buttonId' and 'params' fields.
  • buttonId: Context layout item id of the button.

  • params: Object that represents the parameters, configured for the corresponding context layout item.

open buttonId Context layout item id of the button that the user clicks to open the plugin.
openParams The parameters that are configured for this button.
close buttonId Context layout item id of the button that the user clicks to open the plugin.
openParams The parameters that are configured for this button.
backPluginButtonId
init Message
{
    "apiVersion": 1,
    "method": "init",
    "attributeDescription": {
        "aid": {
            "fieldType": "field",
            "entity": "ENTITY_ACTIVITY",
            "gui": "text",
            "label": "aid",
            "title": "Activity ID",
            "type": "string",
            "access": "READ_WRITE"
        }
    },
    "buttons": [
        {
            "buttonId": "17155",
            "params": {
                "defaultScreen": "order-part",
                "someOptions": "{showCart: true}"
            }
        },
        {
            "buttonId": "17156",
            "params": {
                "defaultScreen": "search-parts"
            }
        }
    ]
}
open Message
{
    "apiVersion": 1,
    "method": "open",
    "entity": "activityList",
    "resource": {
        "pid": 8100059
    },
    "activityList": {
        "4225376": {
            "aid": "4225376"
        }
    },
    "inventoryList": {},
    "buttonId": "17155",
    "openParams": {
        "defaultScreen": "order-part",
        "someOptions": "{showCart: true}"
    }
}
close Message: Navigate to Another Plug-in
{
    "apiVersion": 1,
    "method": "close",
    "backScreen": "plugin_by_label",
    "wakeupNeeded": false,
    "backPluginLabel": "sample_plugin",
    "backPluginButtonId": "17155",
    "backPluginOpenParams": {
        "someOptions": "{ anotherOption: 123 }",
        "thirdParam": null
    }
}
open Message: Navigated from Another Plug-In
{
    "apiVersion": 1,
    "method": "open",
    "entity": "activityList",
    "resource": {
        "pid": 3000001
    },
    "activityList": {},
    "inventoryList": {},
    "buttonId": "17155",
    "openParams": {
        "defaultScreen": "order-part",
        "someOptions": "{ anotherOption: 123 }",
        "thirdParam": null
    }
}
close Message: Update Icons
{
    "apiVersion": 1,
    "method": "close",
    "backScreen": "default",
    "wakeupNeeded": false,
    "buttonsIconData": {
        "17156": {
            "color": "highlight",
            "text": "123",
            "image": {}
        },
        "17155": {
            "color": "default",
            "text": null,
            "image": {}
        }
    }
}