Generate URL Deeplink to pass your screen to others
29. 10. 2021
In the praxis of contact center or daily work with Siebel CRM the agents and users need to pass the screen they see to colleague to consult or overtake the customer or case. In the contact center world it is often referred as a screen transfer. In this blog we will show how technically generate URL to pass the screen seen in the Siebel CRM to others.
With the version 21.X the URL format of current screen is like this :
https://yourhost/siebel/app/fins/deu?SWECmd=GotoView&SWEView=Visible+Contact+List+View&SWERF=1&SWEHo=&SWEBU=1&SWEApplet0=MOBI+Contact+List+Applet&SWERowId0=1-1693-2788
where SWEView refers to current View, SWEApplet to applet and SWERowId0 to current primary object id. We can also observe that SWECmd=GotoView is used.
This works fine and this url can be just passed and the view will have search specification on the record, which is highlighted. The other user will see in the list applet just the highlighted record. The problem is if we want to transfer a detail view where personal visibility is used.
In this case the other user will not be able to see the record in the detail view unless AllView View mode is configured. If we want to display to the other user who will receive the url all views customization is needed. We need customization in order to display all view also these with the personal visibility or my team visibility.
The solution for this is to create url, which is invoking with SWECmd=InvokeMethod a BusinessService and this BS is receiving all the metadata to perform GotoView operation with VieMode AllView to the captured view.
https://yoururl/siebel/app/cc/deu?SWECmd=InvokeMethod&SWEService=MOBIURLCall&SWEMethod=DeepLinkM24&BusComp=Action&BusObject=Action&SWEView=Activity+Attachment+View&SWERF=1&SWEHo=&SWEBU=1&SWEApplet0=Activity+Form+Applet&SWERowId0=1-WXUQQ4
We capture and synthetize the url within Open UI PR script. To perform the GotoView in the BS we need Business Component, Business Object and Id of a primary object. First we parse the URL and we try to get the SWEApplet0. We iterate within the applet map and based on a applet name we try to get the applet object to retrieve the primary BC. There is an issue if the applet in SWEApplet has a toggle. In this case AppletArray[0] to get the first applet and so find in applet map the first applet object and get the BC. The origin window.location.href will be modified with SWECmd=InvokeMethod, BS name and method and the input params BC, BO and row id is taken from SWERowId0. We have implemented button which is calling this MOBIDeepLinkOUI function and takes the synthetized URL into clipboard. User can then past the url into chat.
/*******************************************************************************
** Author: Martin Piekov
** Company: CCW, s.r.o. for Die Mobiliar
** Project: Mobi24
** Purpose: SIEB-7612
** Sets a url deeplink into clipboard
**
** Modification List
** Name Date Modification Description
** ---------- ---------- -----------------------------------------------
** Martin Piekov 12.10.2021 Created
********************************************************************************/
function MOBIDeepLinkOUI()
{
MOBIDeepLinkOUI.prototype.InvokeMethod=function(methodName, inputPropSet){
switch(methodName)
{
case "GetURLBookmarkM24":
this.GetURLBookmarkM24();
default:
return("Method Not defined");
}
}
MOBIDeepLinkOUI.prototype.GetURLBookmarkM24=function()
{
try
{
var sLink = window.location.href;
//------------------------------------Parse SWEApplet0-------------------------------------
var n0 = sLink.indexOf('SWEApplet0');
n0=n0+11;
var n1 = sLink.indexOf('&',n0);
if (n1 < 0) n1 = sLink.length;
var sApplet = sLink.substring(n0, n1);
sApplet = sApplet.replace(/\+/g,' ');
//-------------------------------------Get BC and BO ---------------------------------------
var sViewName = SiebelApp.S_App.GetActiveView().GetName();
var sBOActiveName = SiebelApp.S_App.GetActiveBusObj().GetName();
var activeView = SiebelApp.S_App.GetActiveView();
var oApplet, sAppletName, oAppletPM, sBCName,sAppletId;
sBCName = "";
let oAppletMap = activeView.GetAppletMap();
for (var applet in oAppletMap) { //loop through applet map
oApplet = oAppletMap[applet];
sAppletName = oApplet.GetName();
if (sAppletName === sApplet)
sBCName = oApplet.GetBusComp().GetName();
}
//Toggle applet workaround , we need to identify primary BC through first Applet
if ((sBCName === "")||(sBCName == null)) {
var sFirstAppletId = SiebelApp.S_App.GetActiveView().GetAppletArray()[0].id
let oAppletMap = activeView.GetAppletMap();
for (var applet in oAppletMap) { //loop through applet map
oApplet = oAppletMap[applet];
sAppletId = oApplet.GetFullId();
if (sFirstAppletId.indexOf(sAppletId) > 0 )
sBCName = oApplet.GetBusComp().GetName();
} //for
sFirstAppletId = null;
}
//if nothing found get the active Applet and its BC
if ((sBCName === "") || (sBCName == null)) {
oApplet = activeView.GetActiveApplet();
sBCName = oApplet.GetBusComp().GetName();
}
//-----------------------------------Prepare URL format----------------------------------------------------------------------------------
sBCName = sBCName.replace(/ /g,'+');
sBOActiveName = sBOActiveName.replace(/ /g,'+');
sViewName = sViewName.replace(/ /g,'+');
var sURLParams = 'SWECmd=InvokeMethod&SWEService=MOBIURLCall&SWEMethod=DeepLinkM24&BusComp='+sBCName+'&BusObject='+sBOActiveName;
//---------------------------------------------------------------------------------------------------------------------------------------
var sFinalLink = sLink.replace('SWECmd=GotoView',sURLParams);
//copy to clipboard
const el = document.createElement('textarea');
el.value = sFinalLink;
document.body.appendChild(el);
el.select();
document.execCommand('copy');
document.body.removeChild(el);
}catch(e){
alert(e.toString());
//SiebelApp.S_App.Write_To_Log( this.Name(), "Error setting Bookmark", "" , "Error", "n/a");
}
finally
{
sFinalLink = null;
sURLParams = null;
sBCName = null;
oAppletPM = null;
sAppletName = null;
oApplet = null;
activeView = null;
sBOActiveName = null;
sViewName = null;
sApplet = null;
sAppletId = null;
n1 = null;
n0 = null;
sLink = null;
}
}
}
Here is the e-script for the GotoView operation
function DeepLinkM24(Inputs, Outputs)
{
/***************************************************************************
** Author: Martin Piekov
** Company: CCW, s.r.o.
** Project: Mobiliar
** Purpose: This is for the deeplink processing stored in clipboard
** SIEB-7612
**
**
** Inputs/Outputs:
** Modification List
** Name Date Modification Description
** ------------------- ---------- -----------------------------
** Martin Piekov 15.10.2021 Created
*****************************************************************************/
try
{
TheApplication().SetProfileAttr("paCalledfromMOBIURLCallOpenView", "");
// get input parameters
var sViewName:chars = Inputs.GetProperty("SWEView");
var sId0:chars = Inputs.GetProperty("SWERowId0");
var sBusObject:chars = Inputs.GetProperty("BusObject");
var sBusComp:chars = Inputs.GetProperty("BusComp");
var destinationBO:BusObject;
var destinationBC:BusComp;
//Navigate to default view if SearchExpression is empty.
if (sViewName == "") {
if (TheApplication().GetProfileAttr("thisApp") == "VP") {
TheApplication().GotoView("MOBI Home Page View", '');
}
else {
TheApplication().GotoView("Home Page View (WCC)", '');
}
}
else {
destinationBO = TheApplication().GetBusObject(sBusObject);
destinationBC = destinationBO.GetBusComp(sBusComp);
with (destinationBC)
{
SetViewMode(AllView);
ClearToQuery();
SetSearchSpec("Id",sId0);
ExecuteQuery(ForwardOnly);
if(FirstRecord())
{
//Record has been found in business object -> jump to view and focus on selected row
TheApplication().SetProfileAttr("paCalledfromMOBIURLCallOpenView", "true");
TheApplication().GotoView(sViewName, destinationBO);
}
else
{
//raise error because input parameter SearchExpression was not valid
glRetCode = 3;
glRetMsg = "Invalid Id: " + sId0 + " did not return any records in the business component " + destinationBC + ".";
TheApplication().RaiseErrorText("Invalid SearchExpression: " + bcSearchExpr + " did not return any records in the business component " + destinationBC + ".");
}
}
}
return (CancelOperation);
}
catch (e){
if (glRetCode == 0)
{
glRetCode = 99;
var sGLOBAL_ErrId = TheApplication().Write_To_Log( this.Name(), " DeepLinkM24", e.toString(), "Error", "#ROW_ID#");
glRetMsg = "An error occured. Please contact the application support team. Log ID is: " + sGLOBAL_ErrId + ".";
sGLOBAL_ErrId = null;
}else{
TheApplication().Write_To_Log( this.Name(), "DeepLinkM24()", "#" + glRetCode + "#" + glRetMsg, "Error", "#ROW_ID#");
}
TheApplication().RaiseErrorText(glRetMsg);
}
finally{
destinationBC = null;
destinationBO = null;
sBusComp = null;
sBusObject = null;
sId0 = null;
sViewName = null;
}
}
Back to Blog