Search This Blog

Apr 23, 2015

Enable/Disable Export on Applets


Scenario:
We want to enable the account export functionality to selected list of responsibility, we should be able to control the number of responsibility to add or remove.
Solution:
  1. We will be using the LOV framework to define the list of responsibilities and tag each one of them with different display value, here the challenge is to write a responsibility name in the display value of LOV as it limits the 30 characters. We can use Language-Independent code as to write a responsibility name as we have 50 character limit.
  2. Then we can write a script on applet Pre-Invoke method to get the LOV details and implement a logic to control the export enable or disable.
Here is the Code.
List down the responsibilities and applets which you want to give access and disable the export functionality. Define them in the in the LOV framework.
  1. Site Map – Administration – Data – LOV Explorer.
Create a New LOV Type (EXPORT_STATUS_DE)
  1. Site Map – Administration – Data – List of Values.
TYPE
Display Value
Language Independent Code
Active
EXPORT_STATUS_DE
EXP1
Resp_Name_1
TRUE
EXPORT_STATUS_DE
EXP2
Resp_Name_2
TRUE
EXPORT_STATUS_DE
EXP3
Resp_Name_3
TRUE

  1. Now implement a script on the applet where you want to disable the export based on the responsibility.
  2. Query the Applet Name in Siebel tools and Right click on it and Edit Server script and write a below script.
function WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)
{
   if(MethodName =="ExportQuery")
   {
                                try
        {
                                var primaryResp = TheApplication().GetProfileAttr("Primary Responsibility Name");
                                                var vDisplayValue = TheApplication().InvokeMethod("LookupValue"," EXPORT_STATUS_DE ", primaryResp);
                                vDisplayValue = vDisplayValue.substring(0,3);
                                        if(vDisplayValue == "EXP")
                                        {
                                                CanInvoke = "TRUE";
                        return (CancelOperation);
                                        }
                                        else
                                        {
                                                CanInvoke = "FALSE";
                        return (CancelOperation);
                                        }
                                        return (CancelOperation);
                                  }
                                  catch(e)             
                      {
                            throw(e);              
                      }
                      finally
                                  {
                                                                vDisplayValue = null;
                                  }
   }
   return (ContinueOperation);
}

Now Compile the object and test it.

Siebel IP 2017 - Web Tool Development Steps

Siebel IP 2017 Development and Deployment Steps : 1. Click on the Workspace Icon in Siebel Web Tools application. 2. Create a New work s...