Siebel Mobile Connector Guide > Working with the Siebel Mobile Connector > Real-Time Access to Data >

Retrieving Data


This section describes how to retrieve data from SWE by using the XML Web Interface. Included is an overview of navigating to a screen, navigating within a screen, as well as information about queries and updates.

Navigating to a Screen

Navigating to a screen is required to retrieve data about the screen's views and applets. The command GotoPageTab is used to go to a specific screen.

To navigate to a screen

  1. Log in to SWE. For more information, see Logging In.
  2. Navigate to the screen to which you want to go.
  3. In the following example you are navigating to the SMC Opportunity Screen:

    http://localhost/smc_enu/ start.swe?SWECmd=GotoPageTab&SWEScreen=SMC+Opportunity+Screen&SW EDataOnly=TRUE&SWESetMarkup=XML

NOTE:  GotoPageTab executes the default PDQ (predefined query) for that screen.

The following is a list of screens provided in the Siebel Mobile Connector application definition to which you can navigate.

Screen Name
Display Name
Accounts
Activities
Contacts
Opportunities
Service Requests
eService Requests
Service Orders
Branch Locator
Employees
Responsibilities

Navigating Within a Screen

Navigating within a screen is required to perform an action on data from a screen's views and applets. You can use to the GotoView command to go to a particular Siebel view, where you can access the applets available to that view. The GotoView command requires the name of the view to be passed in the SWEView parameter.

To navigate to a view or applet

  1. Log in to SWE and navigate to the screen to which you want to go. For more information, see Logging In and Navigating to a Screen.
  2. Navigate to the view and applet to which you want to go.
  3. Example (where you are navigating to the SMC Opportunity Detail - Contacts View):

    http://localhost/smc_enu/ start.swe?SWECmd=GotoView&SWEView=SMC+Opportunity+Detail+- +Contacts+View&SWENeedContext=false&SWEBID=- 1&SWEKeepContext=1&SWESetMarkup=XML

For a list of the view and applet names to which you can navigate, see SMC Application Definition Quick Reference.

Querying Items

To perform a query, you must navigate to the screen that allows queries and then you must send two separate requests to SWE.

The two requests are:

In the ExecuteQuery command block, you must specify a parameter to identify the column (the field you want to search) and a value to indicate the search criteria.

To perform a query

  1. Login to SWE and navigate to the screen, view and applet to which you want to go.
  2. For more information, see Logging In, Navigating to a Screen and Navigating Within a Screen.

  3. Invoke the NewQuery method.
  4. Example (where you want to query on a field in the SMC Opportunity View):

    http://localhost/smc_enu/ start.swe?SWECmd=InvokeMethod&SWEApplet=SMC+Opportunity+List+App let&SWEView=SMC+Opportunity+View&SWENeedContext=false&SWEReqRowI d=0&SWEBID=-1&SWEMethod=NewQuery&SWESetMarkup=XML

  5. Invoke the ExecuteQuery method and specify a value to indicate the search criteria.
  6. In the following example, query for a record name called IP_Webserver:

    http://localhost/smc_enu/ start.swe?SWECmd=InvokeMethod&SWEApplet=SMC+Opportunity+List+App let&SWEView=SMC+Opportunity+View&SWENeedContext=false&SWEReqRowI d=0&SWEBID=- 1&SWEMethod=ExecuteQuery&SWESetMarkup=XML&Name=IP_Webserver

For a list of the view anapplet names to which you can navigate, see SMC Application Definition Quick Reference.

Drilling Down on Items

You can drill down on a field by specifying the name of the applet field on which you want to drill down. The detailed information about the field is retrieved from the repository. In this way you can retrieve detailed information about specific items in applets on which you have queried.

To drill down on an item

  1. Login to SWE and navigate to the screen, view and applet to which you want to go.
  2. For more information, see Logging In, Navigating to a Screen and Navigating Within a Screen.

  3. Invoke the DrillDown method and pass the value of the field you want to drill down to in the SWEField argument.
  4. In the following example, drill down on the Account field:

    http://localhost/smc_enu/start.swe? SWECmd=InvokeMethod&SWEApplet=SMC+Opportunity+List+Applet&SWEVie w=SMC+Opportunity+View&SWERowId=99- 27NLD&SWENeedContext=true&SWEReqRowId=1&SWEMethod=Drilldown&SWEF ield=Account&SWESetMarkup=XML

    NOTE:  If you want to drill down into a specific record, then specify the SWERowId parameter of the row you want to drill down to. When the SWERowId parameter is not supplied in a drill down, then SWE returns the first record in the list.

For a list of the field names on which you can drill down, see SMC Application Definition Quick Reference.

Executing Pre-Defined Queries (PDQs)

You can execute pre-defined queries from your applications. You must invoke the ExecuteNamedQuery method and pass the name of the PDQ you want to apply.

To execute a PDQ

  1. Log in to SWE and navigate to the screen, view and applet to which you want to go.
  2. For more information, see Logging In, Navigating to a Screen and Navigating Within a Screen.

  3. Invoke the ExecuteNamedQuery method and pass the value of the PDQ you want to use.
  4. Example (to use the My Activities for the Week PDQ):

    http://localhost/smc_enu/ start.swe?SWECmd=ExecuteNamedQuery&SWEView=SMC+Activity+View&SWE NeedContext=false&SWEQueryName=My+Activities+for+the+Week&SWEBID =-1&SWESetMarkup=XML

Retrieving Large Data Sets

It may be necessary for an application to retrieve a very large set of data, or to obtain all the records in a set. You can retrieve large data sets by using the SWESetRowCnt parameter in your request to SWE.

Set the parameter to a large number such as 100 to obtain up to 100 records. If you set the SWESetRowCnt parameter to a large number, it will take longer to get a response back from SWE and the performance may not be acceptable to your end user if this is a real-time action taken on their behalf. You can set the SWESetRowCnt parameter to a smaller number to improve performance, but check the results to see if there are additional records.

If there are:

To retrieve all the records in a large set

  1. Login to SWE and navigate to the screen, view and applet to which you want to go.
  2. For more information, see Logging In and Navigating to a Screen.

  3. Navigate within the screen to which you want to query.
  4. If there are more than 100 records, you can set the row count to 100 to get the first set of 100 records.

    In the following example, you are navigating to the Contact Attachment View:

    http://localhost/smc_enu/ start.swe?SWECmd=GotoPageTab&SWEScreen=SMC+Account+Screen&SWENee dContext=false&SWEBID=-1&SWESetMarkup=XML&SWESetRowCnt=100

  5. Examine the XML page that is returned from SWE.
  6. NOTE:  The APPLET tag contains the ROW_COUNTER attribute that indicates whether there are additional records.

    In the following example, the ROW_COUNTER indicates that there are additional records by containing a plus sign (+):

    <APPLET MODE="Edit" ROW_COUNTER="1 of 100+" NO_INSERT="FALSE" ACTIVE="FALSE" CLASS="CSSFrameBase" TITLE="Account" ID="1" NO_MERGE="FALSE" NO_DELETE="FALSE" NO_UPDATE="FALSE" NO_EXEC_QUERY="FALSE" NAME="Account Form Applet">

  7. Query again, this time invoking the GoToNextSet method to obtain the next set of records.
  8. Example:

    http://localhost/smc_enu/ start.swe?SWECmd=InvokeMethod&SWEApplet=SMC+Account+List+Applet& SWEView=SMC+Account+View&SWENeedContext=false&SWEReqRowId=0&SWEB ID=-1&SWEMethod=GotoNextSet&SWESetMarkup=XML

  9. Again, examine the XML page that is returned from SWE.
  10. NOTE:  The APPLET tag contains the ROW_COUNTER attribute that indicates whether there are additional records.

    In the following example the ROW_COUNTER indicates that there are additional records by containing a plus sign (+):

    <APPLET MODE="Edit" ROW_COUNTER="101 of 200+" NO_INSERT="FALSE" ACTIVE="FALSE" CLASS="CSSFrameBase" TITLE="Account" ID="1" NO_MERGE="FALSE" NO_DELETE="FALSE" NO_UPDATE="FALSE" NO_EXEC_QUERY="FALSE" NAME="Account Form Applet">

  11. To get all the records in this set, continue querying in this way until there are no additional records returned (that is, when the ROW_COUNTER attribute does not contain a "+" sign).

Parsing Dates on Records

Applications may need to parse the dates and times on records to perform operations on the data. Many fields contain date stamp information according to formats specified in the Siebel application definition. Your application must read the format specified in the FORMAT attribute to parse dates on records.

In the following examples the date format is M/D/YYYY hh:mm:ss p and M/D/YYYY hh:mm p:

<CONTROL HTML_TYPE="Field" CAPTION="Created" SCALE="0" DATATYPE="utcdatetime" HIDDEN="TRUE" NUMBER_BASED="FALSE" ID="1310" TYPE="TextBox" REQUIRED="TRUE" TEXT_BASED="FALSE" FORMAT="M/D/YYYY hh:mm:ss p" CALCULATED="FALSE" ENABLED="TRUE" MAX_LENGTH="32" NAME="Created">12/31/1979 04:00:00 PM</CONTROL>

<CONTROL HTML_TYPE="Field" CAPTION="Start" SCALE="0" DATATYPE="utcdatetime" HIDDEN="FALSE" NUMBER_BASED="FALSE" ID="1801" TYPE="TextBox" REQUIRED="FALSE" TEXT_BASED="FALSE" FORMAT="M/D/YYYY hh:mm p" CALCULATED="FALSE" ENABLED="TRUE" MAX_LENGTH="32" NAME="Planned">8/12/1999 03:00 PM</CONTROL>

NOTE:  The FORMAT attribute uses the standard Siebel date format specification. For example, to indicate the month of March, a single capital M indicates that the month is represented by "3"; MM indicates "03"; MMM indicates "Mar"; and MMMM indicates "March."

Retrieving Data from Hidden Fields

In Siebel application definitions, some form applets are not entirely visible by default. On the user interface, the user must click the toggle button to switch between views of the form applet. When retrieving data from these forms, by default SWE will only return data from the visible fields. If you want data from the hidden fields, use the ToggleLayout command.

The following example shows a SWE request for toggling the layout:

http://localhost/ start.swe?SWECmd=InvokeMethod&SWEApplet=Account+Entry+Applet&SWEVi ew=Account Attachment+View&SWERowId=99- 28B1T&SWENeedContext=true&SWEReqRowId=0&SWEMethod=ToggleLayout&SWE SetMarkup=XML


 Siebel Mobile Connector Guide 
 Published: 18 April 2003