Siebel Portal Framework Guide > Delivering Content to External Web Applications > Common Operations >

Deleting Records


To successfully remove a record from the database, you must first navigate to a screen that allows records to be deleted. Then, the following three requests must be sent separately to the SWE XML application:

  1. Activate a new query.
  2. Execute the query.
  3. Delete the selected record.

NOTE:  When deleting a record, you should use a primary key (such as a row ID) as the parameter for the query. This makes sure that only one record is returned and selected in the response. If you do not use a primary key to perform the query, several records may be returned in the response. There is a chance that the record you want to delete is not the one selected.

NewQuery

When you delete a record, you must first execute a query to find the record you want to delete. You should use search criteria, such as a primary key, to make sure that the query returns only one record.

<?xml version="1.0" encoding="UTF-8"?>

<EXEC PATH="/callcenter/start.swe">

<CMD NAME="SWECmd" VALUE="InvokeMethod">

<ARG NAME="SWEMethod">NewQuery</ARG>

<ARG NAME="SWEView">view name</ARG>

<ARG NAME="SWEApplet">applet name</ARG>

<ARG NAME="SWESetMarkup">XML</ARG>

<ARG NAME="SWEDataOnly">TRUE</ARG>

<ARG NAME="SWESetNoTemp">TRUE</ARG>

</CMD>

</EXEC>

ExecuteQuery

When you use the ExecuteQuery command block in an effort to delete a record, you must include an <ARG> tag that identifies the primary key of the record you want to delete. This makes sure that the query returns only one record, which is automatically selected. You can then use the DeleteRecord command to delete the selected record.

<?xml version="1.0" encoding="UTF-8"?>

<EXEC PATH="/callcenter/start.swe">

<CMD NAME="SWECmd" VALUE="InvokeMethod">

<ARG NAME="SWEMethod">ExecuteQuery</ARG>

<ARG NAME="SWEView">view name</ARG>

<ARG NAME="SWEApplet">applet name</ARG>

<ARG NAME="primary key column name">primary key value</ARG>

<ARG NAME="SWESetMarkup">XML</ARG>

<ARG NAME="SWEDataOnly">TRUE</ARG>

<ARG NAME="SWESetNoTemp">TRUE</ARG>

</CMD>

</EXEC>

DeleteRecord

You use <ARG> tags to indicate the view and applet that contain the selected record you want to delete.

<?xml version="1.0" encoding="UTF-8"?>

<EXEC PATH="/callcenter/start.swe">

<CMD NAME="SWECmd" VALUE="InvokeMethod">

<ARG NAME="SWEMethod">DeleteRecord</ARG>

<ARG NAME="SWEView">view name</ARG>

<ARG NAME="SWEApplet">applet name</ARG>

<ARG NAME="SWESetMarkup">XML</ARG>

<ARG NAME="SWEDataOnly">TRUE</ARG>

<ARG NAME="SWESetNoTemp">TRUE</ARG>

</CMD>

</EXEC>

Siebel Portal Framework Guide Copyright © 2006, Oracle. All rights reserved.