Configuring Siebel Open UI > Customizing Siebel Open UI for Siebel Mobile Disconnected > Methods You Can Use to Customize Siebel Mobile Disconnected >

Methods You Can Use in the Business Component Class


This topic describes methods that you can use that reside in the Business Component class. It includes the following information:

ActivateField Method

The ActivateField method activates a business component field. It returns nothing. It uses the following syntax:

this.ActivateField(field_name);
bc.ActivateField("field_name");// calling from another JavaScript file

where:

  • field_name identifies the name of a business component field.

A field is inactive except in the following situations, by default:

  • The field is a system field, such as Id, Created, Created By, Updated, or Updated By.
  • The Force Active property of the field is TRUE.
  • The Link Specification property of the field is TRUE.
  • An active applet includes the field, and this applet references a business component that is active.
  • The field resides in an active list applet, and the Show In List property of the list column that displays this field in the applet is TRUE.

Note the following:

  • Siebel CRM calls the ActivateField method on the field, and then runs the ExecuteQuery method.
  • If Siebel CRM calls the ActivateField method after it calls the ExecuteQuery method, then the ActivateField method deletes the query context.
  • The ActivateField method causes Siebel CRM to include the field in the SQL statement that the ExecuteQuery method starts. If Siebel CRM activates a field, and if a statement in the GetFieldValue method or the SetFieldValue method references the file before Siebel CRM performs a statement from the ExecuteQuery method, then the activation has no effect.
Example

The following example uses the ActivateField method to activate the Login Name field that resides in the Contact business component:

var model= SiebelApp.S_App.GetModel();
var boContact = model.GetBusObject("Contact");
var bcContact = boContact.GetBusComp("Contact");
bcContact.ClearToQuery();
bcContact.ActivateField("Login Name");
var sLoginName = "SPORTER";
bcContact.SetSearchSpec("Login Name", sLoginName);
bcContact.ExecuteQuery();
$.callback(this, function () {
if (!retObj.err) {
  model.ReleaseBO(boContact);
}
}

ActivateMultipleFields Method

The ActivateMultipleFields method activates more than one field. It returns nothing. It uses the following syntax:

BusComp.ActivateMultipleFields(SiebelPropertySet);

where:

  • SiebelPropertySet is a property set that identifies a collection of properties. These properties identify the fields that Siebel CRM must activate.
Example 1

The following example uses the ActivateMultipleFields method to activate all the fields that the property set contains, including the Account Products, Agreement Name, Project Name, Description, and Name fields:

var ps = SiebelApp.S_App.NewPropertySet();
ps.setProperty("Account Products","");
ps.setProperty("Agreement Name","");
ps.setProperty("Project Name","");
ps.setProperty("Description","");
ps.setProperty("Name","");
BusComp.ActivateMultipleFields(ps);

Example 2

The following example in Siebel eScript queries the Contact business component and returns the First Name and Last Name of the first contact that it finds:

var model= SiebelApp.S_App.GetModel();
var ContactBC = model.GetBusObject("Contact");
var ContactBC = boContact.GetBusComp("Contact");
if (ContactBC)
  {
  var fieldsPS = SiebelApp.S_App.NewPropertySet();
  var valuesPS = SiebelApp.S_App.NewPropertySet();
  fieldsPS. SetProperty("Last Name", "");
  fieldsPS.SetProperty("First Name", "");
  ContactBC.ActivateMultipleFields(fieldsPS);
  ContactBC .ClearToQuery();
  ContactBC .ExecuteQuery();
  $.callback(this, function () {
  if (!retObj.err) {
    ContactBC .FirstRecord();
    $.callback(this, function () {
  if (!retObj.err) {
    ContactBC .GetMultipleFieldValues(fieldsPS, valuesPS);
    var slName = valuesPS.GetProperty("Last Name");
    var sfName = valuesPS.GetProperty("First Name");
  }
}
}
}

Associate Method

The Associate method adds an association between the active record that resides in the child association business component and the parent business component. You can customize or override this method. It returns the retObj object with err set to one of the following values:

  • true. The Associate method successfully added the record.
  • false. The Associate method did not successfully add the record.

It uses the following syntax:

BusComp. Associate()

where:

  • BusComp identifies an instance of the child business component.

For example:

SiebelApp.S_App.FindApplet(appletName).BusComp().Associate();

It includes no arguments.

An association business component is a type of business component that includes an intertable. For more information, see GetAssocBusComp Method.

ClearToQuery Method

The ClearToQuery method clears the current query. It returns nothing. It uses the following syntax:

BusComp.ClearToQuery();

It includes no arguments.

Note the following:

  • The ClearToQuery method does not clear the sort specification that Siebel Open UI defines in the Sort Specification property of a business component.
  • You must use the ActivateField method to activate a field before you can use the ClearToQuery method. For more information see ActivateField Method.
  • Any search specifications and sort specifications that Siebel Open UI sends to a business component are cumulative. The business component performs an AND operation for the queries that accumulate since the last time Siebel CRM performed the ClearToQuery method. An exception to this configuration occurs if Siebel Open UI adds a new search specification to a field, and if this field already includes a search specification. In this situation, the new search specification replaces the old search specification.
Example

The following example uses the ClearToQuery method:

var model= SiebelApp.S_App.GetModel();
var oEmpBusObj= model.GetBusObject("Employee");
var oEmpBusComp = oEmpBusObj.GetBusComp("Employee ");
var sLoginName;
oEmpBusComp.ClearToQuery();
oEmpBusComp.SetSearchSpec("Login Name", sLoginName);
oEmpBusComp.ExecuteQuery();

For another example usage of the ClearToQuery method, see CountRecords Method.

CountRecords Method

The CountRecords method returns the number of records that a business component contains according to the search specification and query specification that Siebel Open UI runs on this business component. It uses the following syntax:

BusComp.CountRecords();

It includes no arguments.

Example

The following example uses the CountRecords method:

var model= SiebelApp.S_App.GetModel();
var bo = model.GetBusObject("Opportunity ");
var bc = bo.GetBusComp("Opportunity");
if (bc)
  {
  bc .ClearToQuery();
  bc .SetSearchSpec ("Name", "A");
  bc .ExecuteQuery();
  $.callback(this, function () {
  if (!retObj.err) {
    var count = bc .CountRecords();
    $.setReturnValue({err:false,retVal:count});
    }
  }
}

For more information, see ClearToQuery Method.

DeactivateFields Method

The DeactivateFields method deactivates fields from the SQL query statement of a business component. It deactivates fields that are currently active. DeactivateFields applies this behavior except in the following situations:

  • The Force Active property is TRUE.
  • A link requires the field to remain active.
  • A business component class requires the field to remain active.

The DeactivateFields method returns nothing.

It uses the following syntax:

BusComp.DeactivateFields()

For example:

SiebelApp.S_App.FindApplet(appletName).BusComp().DeactivateFields();

It includes no arguments.

You must use the ActivateField method to activate a field before you configure Siebel Open UI to perform a query for a business component. After Siebel Open UI deactivates a field, you must configure it to query the business component again or the Siebel application fails.

DeleteRecord Method

The DeleteRecord method deletes the current record from the local database. It returns one of the following values:

  • error:false. DeleteRecord deleted the record.
  • error:true. DeleteRecord did not delete the record.

It uses the following syntax:

buscomp.DeleteRecord(psInputArgs);

ExecuteQuery Method

The ExecuteQuery method runs a query according to the current value of the Search Specification property, the current value of the Sort Specification property, or according to both of these properties. The business component contains these properties. ExecuteQuery runs this query on the local database. It returns one of the following values:

  • If an error occurs, then it returns err with an error message. For example:

    {err: "Error Message",retVal: ""}

  • If an error does not occur, then it returns an empty err message. For example:

    {err: "",retVal: ""}

It uses the following syntax:

busComp.ExecuteQuery();

where:

FirstRecord Method

The FirstRecord method moves the record pointer to the first record in a business component, making this record the current record. It uses the following syntax:

BusComp.FirstRecord();

For example:

SiebelApp.S_App.FindApplet(appletName).BusComp().FirstRecord();

GetAssocBusComp Method

The GetAssocBusComp method returns an instance of the association business component. It uses the following syntax:

BusComp.GetAssocBusComp();

It includes no arguments.

For more information, see Associate Method.

You can use an association business component to manipulate an association. You can use the GetAssocBusComp method and the Associate method only with a many-to-many relationship that uses an intersection table. For example, with accounts and contacts.

Note the following:

  • To associate a new record, you add it to the child business component.
  • To add a record, you use the GetAssocBusComp method and the Associate method.

If a many-to-many link exists, and if Siebel CRM defines an association applet for the child applet, then you can use the GetAssocBusComp method with the child business component of a parent-child view.

Example of Using the GetAssocBusComp Method

The following example associates a contact that includes the ContactID Id with an account that includes the AccountId Id:

var Model = SiebelApp.S_App.GetModel()
var account BO = Model.GetBusObj("Account");
var accountBC = accountBO.GetBusComp("Account");
var contactBC = accountBO.GetBusComp("Contact");
accountBC.SetSearchSpec("Id",[AccountId]);
accountBC. ExecuteQuery ();
$.callback(this,function(){
accountBC.FirstRecord();// positions on the account record
$.callback(this,function(){
  contactBC. ExecuteQuery ();
  $.callback(this,function(){
    contactBC.FirstRecord();
    $.callback(this,function(){
      var assocBC = contactBC.GetAssocBusComp();
      assocBC.SetSearchSpec("Id",[ContactID]);
      assocBC. ExecuteQuery ();
      $.callback(this,function(){

        assocBC.FirstRecord();// positions on the contactbc
        $.callback(this,function(){
          contactBC.Associate() // adds the association
          })
        })
      })
    });
  });
});

GetFieldValue Method

The GetFieldValue method returns the value of a field for the current record or for the record object that Siebel Open UI examines. It uses the following syntax:

Buscomp.GetFieldValue("field_name",pRecord)

where:

  • field_name is a string that contains the name of a field. Siebel Open UI returns the value that this field contains.
  • pRecord is an optional argument that returns the entire record that Siebel Open UI examines. If you do not specify pRecord, or if it is empty, then GetFieldValue returns only a value in field_name of the active record.

For example, the following code returns the value of the Account Name field from the current record of the business component:

Buscomp.GetFieldValue("Account Name")

For another example, the following code returns the field value of the Account Name field. A business component can include more than one record, but only one of these records is the active record. You can use pRecord to get the value of a field from a record that is not the active record:

Buscomp.GetFieldValue("Account Name",recordObject)

The GetFieldValue method returns an object that includes an error code and a return value. For more information, see Configuring Error Messages for Disconnected Clients and SetErrorMsg Method.

For more examples that use the GetFieldValue method, see the following topics:

You can configure Siebel Open UI to override the GetFieldValue method.

GetLinkDef Method

The GetLinkDef method returns the link definition of the child business component. This business component is the child in the parent and child relationship of a link. It returns this definition after Siebel Open UI processes data for the child business component. This definition includes values for the following properties:

  • Name
  • RecordNum
  • childBusCompName
  • destFieldName
  • interChildColName
  • interParentColName
  • interTableName
  • parentBusCompName
  • primeIdFieldName
  • searchSpec
  • sortSpec
  • srcFieldName
  • NoDelete
  • NoInsert
  • NointerDelete
  • NoUpdate
  • SrcFieldValue

If the value of a property is empty, then GetLinkDef does not return this property in the return object.

The GetLinkDef method uses the following syntax:

linkdef = busComp.GetLinkDef();
var sourcefieldName = linkdef.srcFieldName;

GetLastErrCode Method for Business Components

The GetLastErrCode method returns the error code for the most recent error that the disconnected client logged. It uses the following syntax:

BusComp.GetLastErrCode()

For example:

SiebelApp.S_App.FindApplet(appletName).BusComp().GetLastErrCode();

This method includes no arguments.

The error code that this method returns is a short integer. An error code of 0 (zero) indicates no error occurred.

GetLastErrText Method for Business Components

The GetLastErrText method returns a string that contains the text message for the most recent error that the disconnected client logged. It uses the following syntax:

BusComp.GetLastErrText()

For example:

ActiveBusObject().GetLastErrText();

This method includes no arguments.

GetMultipleFieldValues Method

The GetMultipleFieldValues method returns a value for each field that a property set specifies. It uses the following syntax:

BusComp.GetMultipleFieldValues(fieldNamesPropSet, fieldValuesPropSet)

where:

  • fieldNamesPropSet is a property set that identifies a collection of fields.
  • fieldValuesPropSet is a property set that includes values for the fields that the fieldNamesPropSet argument specifies.

If an error occurs, then GetMultipleFieldValues returns err with an error message. For example:

{err: "Error Message",retVal: ""}

If an error does not occur, then GetMultipleFieldValues returns an empty err message. For example:

{err: "",retVal: ""}

You cannot use the same instance of a property set for the fieldNamesPropSet argument and for the fieldValuesPropSet argument.

Example of Using the GetMultipleFieldValues Method

The following example uses the GetMultipleFieldValues method:

var oPsDR_Header = SiebelApp.S_App.NewPropertySet();
// Cannot use the same property set in GetMultipleFieldValues, must use a different
// one for the values. The process will not error, but Siebel Open UI will not place
// the values in the property set.
var lPS_values = SiebelApp.S_App.NewPropertySet();
oPsDR_Header.SetProperty("Last Name","");
oPsDR_Header.SetProperty("First Name","");
oPsDR_Header.SetProperty("Middle Name","");
var model= SiebelApp.S_App.GetModel();
var boContact = model.GetBusObject("Contact");
var bcContact = boContact.GetBusComp("Contact");
bcContact.ActivateMultipleFields(oPsDR_Header);
bcContact.SetSearchSpec("Last Name", "Mead*");
ExecuteQuery();
$.callback(this,function(){
  FirstRecord();
  $.callback(this,function(){
    // Use a different property set for the values. If you use the same one
    // for arguments you get no values back.
    GetMultipleFieldValues(oPsDR_Header, lPS_values);
    // Get the value from the output property set.
    $.callback(this,function(){
      SiebelJS.Log("FullName is " +lPS_values.GetProperty("First Name") + lPS_values.GetProperty("Middle Name")+ lPS_values.GetProperty("Last Name"));
    });
  });
});

GetPicklistBusComp Method

The GetPicklistBusComp method returns a pick business component that Siebel CRM associates with a field that resides in the current business component. If no picklist is associated with this field, then this method returns an error. It uses the following syntax:

BusComp.GetPicklistBusComp(FieldName)

You can use the GetPicklistBusComp method to manipulate a picklist, and you can use the name of the pick business component that the GetPicklistBusComp method returns.

How Siebel Open UI Uses the GetPickListBusComp Method With Constrained Picklists

If Siebel CRM uses the GetPickListBusComp method or the Pick method to pick a record that resides in a constrained picklist, then the constraint is active. The pick business component that these methods return contains only the records that meet the constraint.

Configuring Siebel Open UI to Pick a Value from a Picklist

This topic describes how to configure Siebel Open UI to pick a value from a picklist.

To configure Siebel Open UI to pick a value from a picklist

  1. Use a JavaScript editor to open the JavaScript file that you must modify. This file resides on the client.
  2. Add code that uses the Pick method to pick the value.

    For example, add the following code to the method that Siebel Open UI uses to register the service:

    this.GetFieldValue("City")
    $.callback(this,function(retObj){
    if(retObj.retVal === "San Mateo")
    {
      var oBCPick = this.GetPicklistBusComp("State");
      oBCPick.SetSearchSpec("Value", "CA");
      oBCPick.ExecuteQuery(ForwardOnly);
      $.callback(this,function(){
      oBCPick.FirstRecord();
        $.callback(this,function(){
          if(oBCPick.CheckActiveRow()){
            oBCPick.Pick();
          }
        });
      });
    }

    This code configures Siebel Open UI to use the GetPicklistBusComp method to create an instance of the picklist business component. For more information, see Pick Method.

GetSearchExpr Method

The GetSearchExpr method returns a string that contains the current search expression that Siebel Open UI defines for a business component. The following search expression is an example of a string that GetSearchExpr might return:

[Revenue] > 10000 AND [Probability] > .5

The GetSearchExpr method uses the following syntax:

BusComp.GetSearchExpr();

For example:

SiebelApp.S_App.FindApplet(appletName).BusComp().GetSearchExpr();

The GetSearchExpr method includes no arguments.

If an instance of the business component does not exist, then the GetSearchExpr method returns nothing.

GetSearchSpec Method

The GetSearchSpec method returns a string that contains the search specification that Siebel Open UI defines for a business component field in. For example, it might return the following search specification:

> 10000

The GetSearchSpec method uses the following syntax:

BusComp.GetSearchSpec(FieldName);

For example:

SiebelApp.S_App.FindApplet(appletName).BusComp().GetSearchSpec (FieldName);

GetUserProperty Method

The GetUserProperty method gets the value of a business component user property. It uses the following syntax:

BusComp.GetUserProperty(business_component_user_property)

where:

  • business_component_user_property is a string that identifies the name of a business component user property.

For example, the following code gets the value of the Deep Copy business component user property:

SiebelApp.S_App.FindApplet(appletName).BusComp().GetUserProperty ("Deep Copy");

GetViewMode Method

The GetViewMode method returns a Siebel ViewMode constant or the corresponding integer value for this constant. This constant identifies the current visibility mode of a business component. This mode determines the records that a query returns according to the visibility rules.

The GetViewMode method uses the following syntax:

BusComp. GetViewMode()

It includes no arguments.

For example:

SiebelApp.S_App.FindApplet(appletName).BusComp().GetViewMode();

InvokeMethod for Business Components

The InvokeMethod method that you can use with business components works the same as the InvokeMethod method that you can use with applets. For more information about the InvokeMethod method that you can use with applets, see InvokeMethod Method for Applets.

Name Method for Business Components

The Name method returns the name of a business component. It uses the following syntax:

SiebelApp.S_App.FindApplet(appletName).BusComp()

It includes no arguments.

NextRecord Method

The NextRecord method moves the record pointer to the next record that the business component contains, making this next record the current record. It adds the next record that the current search specification and sort specification identifies, and then sets the active row to this record. It adds this record to the current set of records. It does this work only if the current set of records does not already contain this next record. It returns this next record. It uses the following syntax:

BusComp.NextRecord()

For example:

SiebelApp.S_App.FindApplet(appletName).BusComp().NextRecord();

It includes no arguments.

ParentBusComp Method

The ParentBusComp method returns the parent business component of a business component. It uses the following syntax:

BusComp. ParentBusComp()

It includes no arguments.

For example:

SiebelApp.S_App.FindApplet(appletName).BusComp().ParentBuscomp()

Pick Method

The Pick method places the currently chosen record that resides in a pick business component into the appropriate fields of the parent business component. It uses the following syntax:

BusComp.Pick()

The Pick method includes no arguments.

You cannot use the Pick method to modify the record in a picklist field that is read-only.

For usage information, see Configuring Siebel Open UI to Pick a Value from a Picklist. For more information about pick business component, see Configuring Siebel Business Applications.

RefreshBusComp Method

The RefreshBusComp method runs the current query again for a business component and makes the record that was previously active the active record. The user can view the updated view, but the same record remains highlighted in the same position in the list applet. This method returns nothing.

It uses the following syntax:

BusComp.InvokeMethod("RefreshBusComp")

For example:

"buscomp. InvokeMethod("RefreshBusComp") $.callback(this, function (retObj) {
if (!retObj.err) {}});"

It includes no arguments.

RefreshRecord Method

The RefreshRecord method updates the currently highlighted record and the business component fields in the Siebel client. It positions the cursor on the highlighted record. It does not update other records that are currently available in the client. This method returns nothing.

It uses the following syntax:

BusComp.InvokeMethod("RefreshRecord ")

For example:

"buscomp. InvokeMethod("RefreshRecord") $.callback(this, function (retObj) {
if (!retObj.err) {}});"

It includes no arguments.

SetFieldValue Method

The SetFieldValue method sets a field value in a record. It returns one of the following values depending on whether it successfully set the field value:

  • Successfully set the field value. Returns an empty error code.
  • Did not successfully set the field value. Returns an error code.

It uses following syntax.

SetFieldValue(fieldName, fieldValue);

where:

  • fieldName is a string that contains the name of the field that SetFieldValue updates.
  • fieldValue is a string that contains the value that SetFieldValue uses to update the field.

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

SetMultipleFieldValues Method

The SetMultipleFieldValues method sets new values in the fields of the current record of a business component. It uses the following syntax:

BusComp.SetMultipleFieldValues (oPropertySet)

The FieldName argument that the property set contains must match the field name that Siebel Tools displays. This match must be exact, including upper and lower case characters.

In the following example, the FieldName is Name and the FieldValue is Acme:

oPropertySet.SetProperty ("Name","Acme")

Note the following:

  • If an error occurs in the values of any of fields that the property set specifies, then Siebel Open UI stops the process it is currently running.
  • You can use the SetMultipleFieldValues method only on a field that is active.
  • You must not use the SetMultipleFieldValues method on a field that uses a picklist.
Example

The following example in Siebel eScript uses the SetMultipleFieldValues method to set the values for all fields that the property set identifies, including the Name, Account, and Sales Stage:

var model = SiebelApp.S_App.GetModel();
var bo = model.GetBusObj("Opportunity");
var bc = bo.GetBusComp("Opportunity");
var ps = SiebelApp.S_App.NewPropertySet();
ps.SetProperty ("Name", "Call Center Opportunity");
ps.SetProperty ("Account", "Marriott International");
ps.SetProperty ("Sales Stage", "2-Qualified");
bc.ActivateMultipleFields(ps);
bc.NewRecord();
$.callback(this,function(){
  bc.SetMultipleFieldValues(ps);
  $.callback(this,function(){
    ps = null;
    bc.WriteRecord;
  });
});;

SetSearchSpec Method

The SetSearchSpec method sets the search specification for a business component. It returns nothing. It uses the following syntax:

BusComp.SetSearchSpec(FieldName, searchSpec);

For example:

SiebelApp.S_App.FindApplet(appletName).BusComp().SetSearchSpec("Id", strCallId);

where:

  • FieldName is a string that identifies the name of the field where Siebel Open UI sets the search specification.
  • searchSpec is a string that contains the search specification.

You must configure Siebel Open UI to call the SetSearchSpec method before it calls the ExecuteQuery method. To avoid an unexpected compound search specification on a business component, it is recommended that you configure Siebel Open UI to call the ClearToQuery method before it calls the SetSearchSpec method.

SetViewMode Method

The SetViewMode method sets the visibility type for a business component. It returns nothing. It uses the following syntax:

BusComp.SetViewMode(inMode);

where:

  • inMode identifies the view mode. It contains one of the following integers:
    • 0. Sales Representative.
    • 1. Manager.
    • 2. Personal.
    • 3. All.
    • 4. None.
    • 5. Organization.
    • 6. Contact.

For example:

SiebelApp.S_App.FindApplet(appletName).BusComp().SetViewMode(inMode);

UndoRecord Method

The UndoRecord method reverses any unsaved modifications that the user makes on a record. This includes reversing unsaved modifications to fields, and deleting an active record that is not saved. It returns one of the following values:

  • true. UndoRecord successfully deleted the record.
  • false. UndoRecord did not successfully delete the record.

It uses the following syntax:

BusComp.UndoRecord();

It includes no arguments.

For example:

SiebelApp.S_App.FindApplet(appletName).BusComp().UndoRecord();

You can use the UndoRecord method in the following ways:

  • To delete a new record. Use it after Siebel CRM calls the NewRecord method and before it saves the new record to the Siebel database.
  • To reverse modifications that the user makes to field values. Use it before Siebel CRM uses the WriteRecord method to save these changes, or before the user steps off the record.

UpdateRecord Method

The UpdateRecord method places the current record in the commit pending state so that Siebel Open UI can modify it. It returns the retObj object with retVal set to one of the following values:

  • true. The UpdateRecord method successfully placed the current record in the commit pending state.
  • false. The UpdateRecord method did not successfully place the current record in the commit pending state.

It uses the following syntax:

this.UpdateRecord();

where:

  • this identifies a business component instance.

For example, the following code calls the CanUpdate method. If CanUpdate indicates that Siebel Open UI can update the active row, then this code places the current record in the commit pending state for the business component that this specifies:

this. UpdateRecord(false)

The UpdateRecord method can run in a Siebel Mobile disconnected client.

For more information, see CanUpdate Method.

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 model= SiebelApp.S_App.GetModel();
var bo = model.GetBusObject("Opportunity ");
var bc = bo.GetBusComp("Opportunity");
var strDEANumber = 9089;
var strDEAExpDate = 02/12/2013;
bc.SetFieldValue("DEA#", strDEANumber);
$.callback(this, function () {
if (!retObj.err) {
  bc.SetFieldValue("DEA Expiry Date", strDEAExpDate);
  $.callback(this, function () {
if (!retObj.err) {
  bc.SetFieldValue("DEA Expiry Date", strDEAExpDate);
  $.callback(this, function () {
if (!retObj.err) {
  bc.WriteRecord();
}
}
}
}

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