Modify the Icons and Text of a Plug-In Tile

You can implement a flexible flow for the buttons of a plug-in 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 Field Service Core Application is opened ('initEnd'), after plug-in is closed ('close'), or when a plug-in 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 plug-in is sent to the plug-in 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 plug-in. openParams contains the parameters that are configured for this button.

If a plug-in is opened by sending the backScreen: "plugin_by_label" from another plug-in, 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 plug-in.
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 plug-in.
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": {}
        }
    }
}