WriteRecord Method

The WriteRecord method writes any modifications that the user makes to the current record. If you use this method with:

  • A connected client. WriteRecord writes these modifications to the Siebel Database that resides on the Siebel Server.

  • Siebel Mobile Disconnected.

  • WriteRecord writes these modifications to the local database that resides on the client.

The WriteRecord method returns one of the following values:

  • error:false. WriteRecord successfully wrote the modifications to the local database.

  • error:true. WriteRecord did not successfully write the modifications to the local database.

The WriteRecord method uses the following syntax:

buscomp.writerecord(bAddSyncQ)

where:

  • bAddSyncQ is an optional argument that specifies to synchronize the modification that WriteRecord makes to the Siebel Server. You can set this argument to one of the following values:

    • true. Siebel Open UI synchronizes the modification. This is the default setting.

    • false. Siebel Open UI does not synchronize the modification.

For examples that use the WriteRecord method, see the following topics:

Example

You must first configure Siebel Open UI to create new records and set values for fields. You can then use the following code to call the WriteRecord method to save the new record to the offline database:

var currRetValue={err:false}, retObj;
var model= SiebelApp.S_App.GetModel();
var bo = model.GetBusObject("Opportunity ");
var bc = bo.GetBusComp("Opportunity");
varstrDEANumber = 9089;
var strDEAExpDate = 02/12/2013;
currRetValue=bc.SetFieldValue("DEA#", strDEANumber);
retObj=currRetValue;
if (!retObj.err) {
  currRetValue=bc.SetFieldValue("DEA Expiry Date", strDEAExpDate);
  retObj=currRetValue;
  if (!retObj.err) {
    currRetValue=bc.SetFieldValue("DEA Expiry Date", strDEAExpDate);
    retObj=currRetValue;
    if (!retObj.err) {
      currRetValue=bc.WriteRecord();
    }
  }
}