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

Modifying Records


To successfully modify a record using XML, you must first navigate to a screen that allows records to be modified. Then, the following four requests must be sent separately to the SWE XML application:

  1. Activate a new query.
  2. Execute the query.
  3. Activate the edit record method.
  4. Write the record.

NOTE:  When modifying 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 update is not the one selected.

NewQuery

When you modify a record, you must first execute a query to find the record you want to modify. The records that are returned as a result of the query are then accessible through XML.

<?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 modify a record, you must include an <ARG> tag that identifies the primary key of the record you want to modify. This makes sure that the query returns only one record, which is automatically selected. You can then use the EditRecord command to update 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>

EditRecord

After executing the query the screen is populated with the record you want to modify. You use the EditRecord to access the record.

NOTE:  If you do not use a primary key to perform the query, several records may be returned in the response.

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

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

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

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

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

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

<ARG NAME="column name1">field value</ARG>

<ARG NAME="column name2">field value</ARG>

...

<ARG NAME="column nameN">field value</ARG>

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

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

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

</CMD>

</EXEC>

WriteRecord

In a WriteRecord command block, you must include an <ARG> tag for the row id of the record (SWERowID) and an argument to indicate the row id is required for the operation (SWEReqRowId).

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

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

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

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

<ARG NAME="SWEReqRowId">1</ARG>

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

<ARG NAME="SWERowId">row id of record to be saved</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