A key concept for UI extension in SAP Sales and Service Cloud V2 are UI Events. The Events are providing a capability to communicate between a extension running as mashup (iFrame) and the SAP Sales and Service Cloud V2 UI. Compared to deep-links, UI Events have the benefit, that they are not opening a new window or browser tab. Instead it is possible to open e.g. Quick Create or Detail Views directly inside the SAP Sales and Service Cloud V2 UI.
In this Blog post, we will discuss the basic concept of UI events and highlight a view special events.
UI Events are based on the window.postMessage() method. The Method allows the secure communication between frames. As the messages are processed inside the browser no network communication or server is involved. In SAP Sales and Service Cloud V2 UI events are following a standardized protocol.
{
operation:"navigation",
params: {
objectKey: "00163ea6-f284-1eda-b895-42c904e08752",
routingKey: "ticket",
viewType:"details"
}
}
operation: Type of action, which is triggered by the event.
params: Parameter as input to the operation
Details of the protocol can be found on help.sap.com.
The most common UI Events are used for navigation tasks. A navigation events requires at least a routingKey and a viewType in the parameter section of the event. If a specific object is targeted, the objectKey is also required.
// Open Case List View
function openNewCnsCaseList() {
var oCase = {operation: "navigation", params: {routingKey: "case", viewType: "list"}};
window.parent.postMessage(oCase, '*')
}
// Open specific Case
function openNewCnsCaseViewWithRoutingKey() {
var oCase = {operation: "navigation", params: {objectKey: "071cd754-bbb5-11ef-81f0-7540f83919fa", routingKey: "case"}};
window.parent.postMessage(oCase, '*')
}
// Open Case Quick Create view
function openNewCnsCaseCreate() {
var oCase={operation:"navigation", params: {routingKey: "case", viewType:"quickcreate"}};
self.window.parent.postMessage(oCase, '*')
}
Beside navigation events, other use-cases are currently developed. One scenario, which is already is available are search events in Agent Desktop. Use-case for this scenario is a mashup placed in Agent Desktop. At certain events the mashup should trigger automatically a search and open the related account or individual customer.
function triggerSearchEvent() {
var event = {event: "mashup100.magiccom.customExtendedSearch", operation: "search", params: {$search: "alex"}};
window.parent.postMessage(event, '*')
}
The code above, will place search term "Alex" in the search field of Agent Desktop and if only one object is found open it immediately.
A new feature currently under development are custom UI Events. The custom events can be mapped to certain actions, like UI Refresh during the placement of the mashup. Details are described in our sample-project.
UI Events are providing a great way to deeply integrate mashups with SAP Sales and Service Cloud V2. Due to the use of standard browser capabilities compatibility across browsers is ensured. Also no specific client libraries are required. Looking at existing customer projects, we can see the technology is used in many projects and it is amazing, what scenarios are build. If you have build a custom extension, we are keen to get to know about it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |