Configuring Siebel Open UI > Customizing Siebel Open UI for Siebel Mobile Disconnected >

Customizing Siebel Pharma for Siebel Mobile Disconnected Clients


This topic includes an example of customizing Siebel Pharma in Siebel Open UI for display in a Siebel Mobile disconnected client. For more information about the functionality that these customizations modify, see the chapter that describes how to use the Siebel Mobile Disconnected Application for Siebel Pharma in Siebel Mobile Guide: Disconnected.

This topic customizes Siebel Pharma to submit a Pharma Call record depending on whether or not Siebel Open UI already submitted this call. It makes sure Siebel Open UI does not overwrite a call that it already submitted to the Siebel Server. To submit a call in Siebel Pharma, the user must do the following work:

  • Enter all information for the call.
  • Add at least one sample for the call.
  • Get the required signature for the samples that the call includes.
  • Set the status for the call to Planned or Signed.
  • Tap Submit.

Siebel Pharma locks a call after it submits this call, and then the user can no longer edit or update the call. You can modify some of this behavior. For more information about the work you do in this topic, see Process of Customizing Siebel Open UI for Siebel Mobile Disconnected. For more information about the methods that this example uses, see Methods You Can Use to Customize Siebel Mobile Disconnected.

To customize Siebel Pharma for Siebel Mobile Disconnected clients

  1. Create a new JavaScript file.

    You can use any file name that is meaningful to your deployment. For example, you can use a short name that indicates what the business service accomplishes. It is recommended that the file name end with svc.js or service.js. For example, callsvc.js. To get a copy of this file, see Article ID 1494998.1 on My Oracle Support. For more information about the folders you can use to store your customizations, see Organizing Files That You Customize.

  2. Add the following code:

    SiebelApp.pharmacallsvc = (function () {

    function pharmacallsvc(pm) {

    }

    SiebelJS.Extend(pharmacallsvc, SiebelApp.ServiceModel);

    This code adds the pharmacallsvc method to the pharmacallsvc business service.

  3. Specify the logic for your method.
  4. Add the following code immediately after the code you added in Step 3:

    pharmacallsvc.prototype.InvokeMethod = function (psInputArgs) {

    var currRetValue={err:false}, retObj;

    var svcMthdName = "";

    var psOutArgs = SiebelApp.S_App.NewPropertySet();

    svcMthdName = psInputArgs.GetProperty("MethodName").toString();

    if (svcMthdName === "Submit") {

    retObj=currRetValue=this.Submit();

    psOutArgs.SetProperty("Invoked", true);

    currRetValue={err: false, retVal: psOutArgs};

    }

    return currRetValue;

    };

    This code configures Siebel Open UI to run InvokeMethod on the business service if the svcMthdName variable that you defined in Step 3 contains a value of Submit.

  5. Define the method that includes your customization logic. You add the following code immediately after the code you added in Step 4:

    pharmacallsvc.prototype.Submit = function () {

    var currRetValue={err:false}, retObj;

    var model= SiebelApp.S_App.GetModel();

    var pBusObj = model.GetBusObject("boName");

    var pBusComp = pBusObj.GetBusComp("bcName");

    var now = new Date();

    var strStatusField = pBusComp.GetUserProperty("Status Field");

    var pickName = SiebelApp.S_App.GetActiveView().GetActiveApplet().GetControl("Status").GetPickApplet();

    retObj=currRetValue=pBusComp.SetFieldValue(strStatusField, "submit", true);

    retObj=currRetValue=pBusComp.WriteRecord();

    return currRetValue;

    }

    This code defines the Submit method. It sets the value for the Status field to Submitted. It uses the following methods:

  6. Test your modifications:
    1. Tap Calls on the application banner to display the Calls list.
    2. Tap a call in the list that you know you have not submitted, and then tap Submit to submit the call.
    3. Verify that Siebel Open UI does the following:
      • Modifies the call status to Submitted.
      • Locks the call
      • Decreases the sample inventory for the sales representative according to the samples and promotional items that the call dropped off
      • Closes the call.
      • Allows you to review, but not edit the call details.
    4. Tap a call in the list that you know you have already submitted, and then tap Submit to submit the call.

      Make sure Siebel Open UI does not overwrite this call. Make sure it displays a dialog box that describes that you have already submitted this call.

Configuring Siebel Open UI Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Legal Notices.