NewRecord Method for a Business Component
The NewRecord method adds a new record to a business component. This method does not return any information.
Format
BusComp.NewRecord(whereIndicator)
The following table describes the arguments for the NewRecord method.
Argument | Description |
---|---|
whereIndicator |
Predefined constant that configures where Siebel CRM must add the new record. You can use one of the following values:
For more information, see Use Constants to Standardize Code. If you use Siebel Java Data Bean, then you can use one of the following values:
|
Usage
If you use the NewRecord method to add a new record, then Siebel CRM does the following:
Places the new record before or after the current record, depending on the value you enter for the WhereIndicator argument.
Sets this new record as the current record.
You can use the NewRecord method to copy a record. To place the copy before the original record, you use the following command:
Object.NewRecord NewBeforeCopy
To place the copy after the original record, you use the following command:
Object.NewRecord NewAfterCopy
Performance with the NewRecord Method
In some situations, using the NewRecord method in a Server Script can result in this method performing slowly. In this situation, Siebel CRM does not display an error message. It creates the record but the reply time is not optimal. This situation is due to the expected behavior of the Siebel application when it creates a new record.
To position the new record in the record set, Siebel CRM gets the cursor for the record set. This record set must include data before Siebel CRM creates the new record. In the context of a script, Siebel CRM must run a query on the business component before it calls the NewRecord method. If the script does not explicitly run the query, then Siebel CRM runs a full table query. This situation can cause suboptimal performance. For more information, see Doc ID 477556.1 on My Oracle Support.
Used With
COM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script
Examples
The following example is in Siebel VB:
Dim oBusObj as BusObject
Dim oBC as BusComp
Set oBusObj = TheApplication.ActiveBusObject
Set oBC = oBusObj.GetBusComp("Action")
oBC.NewRecord NewAfter
oBC.SetFieldValue "Type", "To Do"
oBC.SetFieldValue "Description", "Find Decision Makers"
oBC.WriteRecord
set oBC = Nothing
set oBusObj = Nothing