Bookshelf Home | Contents | Index | PDF |
Siebel Object Interfaces Reference > Siebel Object Interfaces Reference > Object Interfaces Reference > Business Component MethodsThis topic describes business component methods. It includes the following topics:
The oBusComp and BusComp variables that this topic describes refer to an instance of a business component. ActivateField Method for a Business ComponentThe ActivateField method activates a field. This method does not return any information. You must use the ActivateField method to activate a field before you can perform a query for the business component. For more information, see DeactivateFields Method for a Business Component. CAUTION: Do not use the ActivateField method to activate a field in a UI context business component. This technique might cause unexpected Siebel application behavior. For more information about UI context objects, see Doc ID 477419.1 on My Oracle Support. Format for the ActivateField MethodBusComp.ActivateField(FieldName) Table 55 describes the arguments for the ActivateField method.
You must enclose the FieldName argument in double quotes. The value you enter for the FieldName argument must match exactly the field name that displays in Siebel Tools, including the same case. For example:
Usage for the ActivateField MethodBy default, a field is inactive except in the following situations:
Avoiding a Corrupted DatabaseIf Siebel CRM does not activate a field before it performs a WriteRecord command, then it writes data to the Siebel database, but a corruption problem might occur if a mobile user synchronizes. This situation applies only to mobile users.
Using this sequence makes sure Siebel CRM writes the field correctly to the transaction log. During synchronization, it saves any modifications that the mobile user makes back to the Siebel database correctly. Used WithCOM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script ExamplesThe following example is in Siebel VB. For an equivalent Siebel eScript example, see ClearToQuery Method for a Business Component: Dim oEmpBusObj As BusObject ActivateMultipleFields Method for a Business ComponentThe ActivateMultipleFields method activates multiple fields. This method returns one of the following values: FormatBusComp.ActivateMultipleFields(SiebelPropertySet) Table 56 describes the arguments for the ActivateMultipleFields method.
Used WithCOM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script ExamplesThe following example is for Siebel Java Data Bean: import com.siebel.data.*; The following Siebel eScript example queries the Contact business component and returns the First Name and Last Name of the first contact that it finds: var ContactBO = TheApplication().GetBusObject("Contact"); Related TopicsFor more information, see the following topics:
Associate Method for a Business ComponentThe Associate method creates a new many-to-many relationship for the parent object through an association business component. This method does not return any information. For more information, see GetAssocBusComp Method for a Business Component. FormatBusComp.Associate(whereIndicator) Table 57 describes the arguments for the Associate method.
UsageTo set field values on a child record that is associated with a parent record, use the context of the multivalue group business component. Used WithCOM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script ExamplesThe following VB example updates the Opportunity Assignment Type field. The parent business component can be any business component that includes the Sales Rep multivalue group: Dim oParentBC as BusComp The following Siebel eScript example finds a contact when the Last Name is Abanilla, and then adds a new organization named CKS Software to the Organization multivalue group: var ok = 0; // Searches by Last Name // Instantiates Organization MVG // Checks if the Organization was found // Organization was found catch (e) oAssocBC = null; ContactBC = null; Related TopicsFor more information, see the following topics:
BusObject Method for a Business ComponentThe BusObject method returns the name of the business object that the business component references. For more information, see ActiveBusObject Method for an Application. FormatUsed WithBrowser Script, COM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script ExamplesFor an example, see SetViewMode Method for a Business Component. ClearToQuery Method for a Business ComponentThe ClearToQuery method clears the current query but does not clear sort specifications on a business component. This method does not return any information. For more information, see RefineQuery Method for a Business Component. FormatUsageYou must use the ActivateField method to activate a field before you can use the ClearToQuery method. For more information, see ActivateField Method for a Business Component. Search and sort specifications sent to a business component are cumulative. The business component retains and logically performs an AND operation for the queries that accumulate since the last time Siebel CRM performed the ClearToQuery method. This situation is true except if there is a new search specification on a field, and if that field already included a search specification. In this situation, the new search specification replaces the old search specification. Used WithCOM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script ExamplesThe following example is in Siebel eScript. var oEmpBusObj = TheApplication().ActiveBusObject(); oEmpBusComp.ClearToQuery(); oEmpBusComp = null; For more examples, see the following:
CountRecords Method for a Business ComponentThe CountRecords method returns the number of records that the most recent call to the ExecuteQuery method returned. FormatUsed WithExamplesThe following example is in Siebel eScript: function Service_PreInvokeMethod (MethodName, Inputs, Outputs) DeactivateFields Method for a Business ComponentThe DeactivateFields method deactivates fields from the SQL query statement of a business component. It deactivates fields that are currently active. This situation is true except in the following situations:
This method does not return any information. FormatUsageYou must use the ActivateField method to activate a field before you perform a query for a business component. For more information, see ActivateField Method for a Business Component. After you deactivate a field, you must query the business component again or the Siebel application fails. Used WithCOM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script ExamplesThe following example is for the Component Object Model (COM): Dim oBO As BusObject Set oBO = SiebelApplication.GetBusObject("Account", errCode) oBC.DeactivateFields errCode The following example is in Siebel eScript: oBO = TheApplication().GetBusObject("Account"); oBC.DeactivateFields(); The following example is in Siebel VB: Dim oBO As BusObject Set oBO = TheApplication.GetBusObject("Account") oBC.DeactivateFields DeleteRecord Method for a Business ComponentThe DeleteRecord method removes the current record from a business component. This method does not return any information. FormatUsed WithCOM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script ExamplesThis Siebel VB example deletes accounts with a status of Inactive: Sub DeleteInactiveAccounts() Set objBO = TheApplication.GetBusObject("Account") Siebel CRM moves the cursor to the next record after it runs the DeleteRecord method. Do not use the NextRecord method after you use the DeleteRecord method in a loop because this configuration causes Siebel CRM to skip deleting the last record in the loop. If you use the DeleteRecord method on the last record, then the cursor points to nothing. ExecuteQuery Method for a Business ComponentThe ExecuteQuery method uses criteria form another method, such as the SetSearchSpec method, to return a set of business component records. This method allows you to specify the order that Siebel CRM uses to process records. FormatBusComp.ExecuteQuery ([cursorMode]) Table 58 describes the arguments for the ExecuteQuery method.
UsageTo achieve maximum performance, use ForwardOnly. If you use ForwardOnly, make sure that your Siebel application code does not use PreviousRecord or FirstRecord to navigate backward without a requery. Do not use ForwardOnly with a UI business component unless the Siebel application code performs a requery with the cursorMode argument set to ForwardBackward. A UI business component is a type of business component that Siebel CRM is actively using in the Siebel client. You can write a script that creates a UI business component that does not reference the data the user manipulates. A user might scroll up and down a record set, so you must use ForwardBackward. You Must Activate Fields Before You Can Query ThemBefore you can query a business component, you must use the ActivateField method to activate all fields that are involved in the query. If you write an event handler on a business component, then you must use the ForceActive user property on the control to make sure the field is activate. Reducing a Large Query SetIf you use ForwardBackward, and if the query matches over 10,000 records, then the object manager returns an error message that is similar to the following: There were more rows than could be returned. Refine your query to bring back fewer rows. To reduce the number of queries, you can use a parent-child relationship between business components that the business object establishes. For example, the Opportunity business object establishes a parent-child relationship between the Opportunity business component and the Contact business component. If you instruct Siebel CRM to query the Opportunity business component, then it can read values from the corresponding records in the Contact business component without performing another query. You must instruct Siebel CRM to query the parent business component first, and then to query the child business component. If you query the child business component first, then Siebel CRM returns no records. How Siebel CRM Handles Duplicate Records with the ExecuteQuery MethodA faulty join configuration or duplicate data in joined tables might cause a business component to return duplicate records. If Siebel CRM detects duplicate records when it executes the ExecuteQuery method, then it does the following work depending on the value of the cursorMode argument:
Used WithCOM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script ExamplesThis Siebel VB example sets up and runs a query that locates the primary on the account team. Only the primary can modify the primary address. (general) For other examples, see the following topics:
Related TopicsFor more information, see the following topics:
ExecuteQuery2 Method for a Business ComponentThe ExecuteQuery2 method uses criteria form another method, such as SetSearchSpec, to return a set of business component records. Allows you to control the number of records Siebel CRM returns. FormatBusComp.ExecuteQuery2 ([cursorMode], ignoreMaxCursorSize) Table 59 describes the ignoreMaxCursorSize argument for the ExecuteQuery2 method. For the cursorMode argument, see Table 58. Used WithCOM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script FirstRecord Method for a Business ComponentThe FirstRecord method moves the record pointer to the first record in a business component, making that record the current record. It also calls any associated script events. This method returns the following information:
If you issue a query on a business component, then Siebel CRM creates SQL for any child business component that is active. Calling the FirstRecord method starts the BusComp_ChangeRecord event and causes Siebel CRM to run the same SQL for the child business component again. For more information, see NextRecord Method for a Business Component. FormatUsed WithCOM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script ExamplesTo determine if an account displayed in a child applet includes a service request, the following examples use the FirstRecord method. The outcome of this query can determine if Siebel CRM must run other code for this account record. In this example, the Account List Applet is a child applet in the Contact Detail - Accounts View. The following example is in Siebel eScript: function BusComp_PreInvokeMethod (MethodName) with (oBC) else The following example is in Siebel VB: Function BusComp_PreInvokeMethod (MethodName As String) As Integer ''CheckSR' method called from a custom button On 'Account List Applet - child' Applet. Set oBO = TheApplication.ActiveBusObject With oBC Set oBC = Nothing BusComp_PreInvokeMethod = iRtn FirstSelected Method for a Business ComponentThe FirstSelected method makes the first record of the multiple selection in a business component active. It also calls any associated events. It returns the same information as the FirstRecord method. For more information, see FirstRecord Method for a Business Component. FormatUsed WithCOM Data Server, Server Script ExamplesThe following examples use the FirstSelected method and the NextSelected method to allow you to customize multirecord deletion. If the user clicks a custom button in an applet, then Siebel CRM can call this code and it can call the Delete Selected custom method. The following example is in Siebel eScript: function BusComp_PreInvokeMethod (MethodName) while (iRecord) The following example is in Siebel VB: Function BusComp_PreInvokeMethod (MethodName As String) As Integer iRtn = ContinueOperation With me While iRecord BusComp_PreInvokeMethod = iRtn GetAssocBusComp Method for a Business ComponentThe GetAssocBusComp method returns a string that contains the name of the association business component. You can use the association business component to manipulate the association. FormatUsage for the GetAssocBusComp MethodIt is appropriate to use the GetAssocBusComp method and the Associate method only with a many-to-many relationship that uses an intersection table. For example, account and industry. In the context of a many-to-many relationship, you can use Siebel VB to do the following:
If a many-to-many link exists, and if an association applet is defined for the child applet, then you can use the GetAssocBusComp method with the child business component of a parent-child view. You can use this technique instead of modifying the multivalue group business component. Used WithCOM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script ExamplesThe following example is in Siebel VB. It uses the GetAssocBusComp method to add a new industry to an account: Dim oAssocBC As BusComp If .FirstRecord Then .Associate NewBefore The following is the same example in Siebel eScript: //get the business Object and the business component Related TopicsFor more information, see the following topics: GetFieldValue Method for a Business ComponentThe GetFieldValue method returns one of the following items:
The GetFieldValue method uses the MM/DD/YYYY format when it returns a date field regardless of what format the local date uses. To return the date in the same format that the local date uses, you can use the GetFormattedFieldValue method. For more information, see GetFormattedFieldValue Method for a Business Component. In Browser Script, you can use the GetFieldValue method only if the field is available in the applet and for system fields. FormatBusComp.GetFieldValue(FieldName) The arguments you can use in this format are the same as the arguments that are described in Table 55. Usage for the GetFieldValue MethodIf you require a value from a business component that is a parent of the current business component, then you must make sure the Link Specification property for that field is set to TRUE in Siebel Tools. If it is not, then the child business component cannot access the value in the parent business component. For more information, see Siebel Object Types Reference. Used WithBrowser Script, COM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script ExamplesThe following example is in Siebel VB: Function BusComp_PreSetFieldValue (FieldName As String, FieldValue As String) As Integer Dim bcOppty As BusComp Set bcOppty = Nothing The following example is in Siebel eScript: function BusComp_PreSetFieldValue (FieldName, FieldValue) var boBusObj = TheApplication().GetBusObject("Opportunity"); with (bcOppty) bcOppty = null; GetFormattedFieldValue Method for a Business ComponentThe GetFormattedFieldValue method returns the following information:
FormatBusComp.GetFormattedFieldValue(FieldName) The arguments you can use in this format are the same as the arguments that are described in Table 55. UsageYou can use the GetFormattedFieldValue method with code that your implementation uses in multiple countries that use different formats for currency, date, or numbers. Usage with Phone Data and Date DataThe following behavior exists for phone data and date data:
Table 60 describes the formats that the GetFieldValue method and the SetFieldValue method use. If you attempt to use the SetFieldValue method, and if the Regional Setting format is different, the Siebel CRM displays an error that is similar to the following: Error: The value '31-Dec-99' can not be converted to a date time value. To avoid this error, use the GetFormattedFieldValue format or the SetFormattedFieldValue method. Used WithBrowser Script, COM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script ExamplesThe following Siebel VB example uses the GetFormattedFieldValue method and calculates the number of days between two dates: Sub Button_Click Related TopicsFor more information, see the following topics:
GetLastErrCode Method for a Business ComponentThe GetLastErrCode method returns the error code for the error that Siebel CRM logged most recently. This code is a short integer. 0 (zero) indicates no error. FormatUsageFor more information, see Usage for the GetLastErrCode Method. Used WithCOM Data Control, Mobile Web Client Automation Server GetLastErrText Method for a Business ComponentThe GetLastErrText method returns a string that contains the text message for the error that Siebel CRM logged most recently. FormatUsageFor more information, see Usage for the GetLastErrText Method. Used WithCOM Data Control, Mobile Web Client Automation Server GetMultipleFieldValues Method for a Business ComponentThe GetMultipleFieldValues method returns a value for each field specified in a property set. It also returns the following information: For more information, see SetMultipleFieldValues Method for a Business Component. FormatBusComp.GetMultipleFieldValues(fieldNamesPropSet, fieldValuesPropSet) Table 61 describes the arguments for the GetMultipleFieldValues method.
UsageYou cannot use the same instance of a property set for the fieldNamesPropSet argument and for the fieldValuesPropSet argument. Used WithCOM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script ExamplesThe following example is in Siebel eScript: var oPsDR_Header:PropertySet = TheApplication().NewPropertySet(); // Cannot use the same property set in GetMultipleFieldValues, must use a different // one for the values. The process will not error, but the values will not be placed // in the property set. var lPS_values:PropertySet = TheApplication().NewPropertySet(); oPsDR_Header.SetProperty("Last Name",""); oPsDR_Header.SetProperty("First Name",""); oPsDR_Header.SetProperty("Middle Name",""); var boContact = TheApplication().GetBusObject("Contact"); var bcContact = boContact.GetBusComp("Contact"); ActivateMultipleFields(oPsDR_Header); SetSearchSpec("Last Name", "Mead*"); // 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. TheApplication().Trace("Last Name = " + TheApplication().Trace(e.toString()); GetMVGBusComp Method for a Business ComponentThe GetMVGBusComp method returns the multivalue group business component that is associated with a business component field. FormatBusComp.GetMVGBusComp(FieldName) The arguments you can use in this format are the same as the arguments that are described in Table 55 except the GetMVGBusComp method uses the FieldName argument to identify the multivalue group business component. UsageA multivalue group is a set of detail records attached to the current record in a business component that holds the corresponding multivalue field. After you run the GetMVGBusComp method, it is recommended that you set the multivalue group business component to one of the following: Used WithCOM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script ExamplesThe following example Siebel VB code uses the GetMVGBusComp method to add a new address to the Hong Kong Flower Shop account: Dim AccntBO as BusObject With AccntBC With AddrBC Set AddrBC = Nothing For more examples, see the following topics: For more information about inserting records, see Usage for the GetAssocBusComp Method: GetNamedSearch Method for a Business ComponentThe GetNamedSearch method returns a string that contains the name of a search specification. FormatBusComp.GetNamedSearch(searchName) Table 62 describes the arguments for the GetNamedSearch method.
UsageThe search specification uses the same format that a predefined query uses. Used WithCOM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script Related TopicsFor more information, see the following topics: GetPicklistBusComp Method for a Business ComponentThe GetPicklistBusComp method returns the name of the pick business component that is associated with a field in the current business component. If there is no picklist associated with this field, then this method returns an error. FormatBusComp.GetPicklistBusComp(FieldName) The arguments you can use in this format are the same as the arguments that are described in Table 55, except the GetPicklistBusComp method uses the FieldName argument to identify the pick business component. UsageTo manipulate a picklist, you can use the name of the pick business component that the GetPicklistBusComp method returns. After you run the GetPickListBusComp method, it is recommended that you set the pick business component to one of the following: Picking a Record on a Constrained PicklistIf Siebel CRM uses the GetPickListBusComp method or the Pick method to pick a record on a constrained picklist, then the constraint is active. The pick business component that these methods return contains only those records that fulfill the constraint. To Pick a Value From a Picklist in Siebel VBYou can pick a value from a picklist in Siebel VB. To pick a value from a picklist in Siebel VB
Used WithCOM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script ExamplesThe following example is in Siebel eScript: if (this.GetFieldValue("City") == "San Mateo") The following example is for Siebel Java Data Bean. It chooses a product from a picklist: Sieb_busObject = Sieb_dataBean.getBusObject("Service Request"); SiebelBusComp productBusComp = Sieb_busComp.getPicklistBusComp("Product"); catch (SiebelException e) The following example is in Siebel VB: If Me.GetFieldValue("City") = "San Mateo" Then Related TopicsFor more information, see the following topics: GetSearchExpr Method for a Business ComponentThe GetSearchExpr method returns a string that contains the current search expression that is defined for a business component. For example: [Revenue] > 10000 AND [Probability] > .5 If an instance of the business component does not exist, then the GetSearchExpr method returns nothing. If you use the GetSearchExpr method in Browser Script with the Applet_PreInvokeMethod event, then it returns a null value even if you add a query filter. FormatUsed WithBrowser Script, COM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script Related TopicsFor more information, see the following topics:
GetSearchSpec Method for a Business ComponentThe GetSearchSpec method returns a string that contains the search specification that is defined for a business component. For example, > 10000. FormatBusComp.GetSearchSpec(FieldName) The arguments you can use in this format are the same as the arguments that are described in Table 55, except the GetSearchSpec method uses the FieldName argument to identify the search specification. Used WithBrowser Script, COM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script Related TopicsFor more information, see the following topics:
GetSortSpec Method for a Business ComponentThe GetSortSpec method returns the sort specification for a business component. FormatUsed WithCOM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script Related TopicsFor more information, see the following topics: GetUserProperty Method for a Business ComponentThe GetUserProperty method returns the value of a user property. FormatBusComp.GetUserProperty(propertyName) Table 63 describes the arguments for the GetUserProperty method. Usage for the GetUserProperty MethodA user property is similar to an instance variable of a business component. You can use the GetUserProperty method to access a user property from anywhere in the code, even from another application through COM. An instance variable is a type of variable that is defined at the top level of the business component in the general declarations section. You can access an instance variable only in Siebel VB, and in the same object where you declare the instance variable. For more information, see SetUserProperty Method for a Business Component. Siebel CRM resets the value of a user property every time you create a business component instance. The GetUserProperty method does not interact directly with user properties that you define in Siebel Tools. Used WithCOM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script GetViewMode Method for a Business ComponentThe GetViewMode returns a Siebel ViewMode constant or the corresponding integer value for this constant. This constant identifies the current visibility mode for a business component. This mode effects the records that queries return according to the visibility rules. For more information, see SetViewMode Method for a Business Component and Use Constants to Standardize Code. FormatUsageThe GetViewMode method returns NoneSetView mode until one of the following situations is true:
The NoneSetViewMode value indicates that no visibility rules are applied to the business component. If Siebel CRM creates a business component through a call to the GetBusComp method, then the value for that business component is NoneSetViewMode. If you require a specific view mode, then you must use the SetViewMode method to set this view mode. If you do not use the SetViewMode method, then Siebel CRM sets the view mode according to the most restrictive visibility mode that is defined for that business component. It does this the first time that it creates a business component instance. Used WithCOM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script InvokeMethod Method for a Business ComponentThe InvokeMethod method calls a method. It returns a string that contains the result of the method. For more information, see About Specialized and Custom Methods. Siebel VB FormatBusComp.InvokeMethod methodName, methArg1, methArg2, methArgN Table 64 describes the arguments for the Siebel VB format of the InvokeMethod method.
Siebel eScript FormatBusComp.InvokeMethod(methodName, methArg1, methArg2, ..., methArgn); The arguments you can use in this format are the same as the arguments that are described in Table 22. UsageYou can use the InvokeMethod method to call a method on a business component object that is not available directly through the object interface. For more information, see Caution About Using the InvokeMethod Method. Used WithCOM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script ExamplesFor examples of using the InvokeMethod method, see the following topics:
LastRecord Method for a Business ComponentThe LastRecord method moves the record pointer to the last record in a business component. It returns one of the following items: For more information, see FirstRecord Method for a Business Component and NextRecord Method for a Business Component. FormatUsed WithCOM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script ExamplesThe following example is for the Mobile Web Client Automation Server: Private Sub LastRecord_Click() Dim errCode As Integer Status.Text = SiebelApplication.GetLastErrText Name Method for a Business ComponentThe Name method returns a string that contains the name of a business component. FormatUsed WithBrowser Script, COM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script ExamplesThe following example is in Browser Script: function BusComp_PreSetFieldValue (fieldName, value) NewRecord Method for a Business ComponentThe NewRecord method adds a new record to a business component. This method does not return any information. FormatBusComp.NewRecord(whereIndicator) Table 65 describes the arguments for the NewRecord method.
UsageIf you use the NewRecord method to add a new record, then Siebel CRM does the following:
You can use the NewRecord method to copy a record. To place the copy before the original record, you use the following command: Object To place the copy after the original record, you use the following command: Performance with the NewRecord MethodIn 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 WithCOM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script ExamplesThe following example is in Siebel VB: Dim oBusObj as BusObject Set oBusObj = TheApplication.ActiveBusObject set oBC = Nothing NextRecord Method for a Business ComponentThe NextRecord method moves the record pointer to the next record in a business component, making that record the current record. This method returns the following information:
FormatUsed WithCOM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script, Browser Script ExamplesThe following example is in Siebel eScript: ClearToQuery(); // do some record manipulation For a similar Siebel VB example, see FirstRecord Method for a Business Component. NextSelected Method for a Business ComponentThe NextSelected method makes the next record of the current multiple selection the active record. It returns the same information as the NextRecord method. For more information, see NextRecord Method for a Business Component. FormatUsed WithExamplesFor examples, see FirstSelected Method for a Business Component. ParentBusComp Method for a Business ComponentThe ParentBusComp method returns the name of the parent business component of a link. FormatUsageThe ParentBusComp method allows you to write code in the child business component that can access a field value or perform actions in the parent business component. To use this method, it might be necessary to set the Link Specification property. For more information, see Usage for the GetFieldValue Method. Used WithCOM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script ExamplesThe following example is in Siebel VB. For another example, see ExecuteQuery Method for a Business Component: Dim strParentName as String Pick Method for a Business ComponentThe Pick method places the currently chosen record in a pick business component into the appropriate fields of the parent business component. This method does not return any information. You cannot use the Pick method to modify the record in a read-only picklist field. FormatUsageFor more information, see Picking a Record on a Constrained Picklist. Used WithCOM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script ExamplesThe following Siebel VB example sorts the values in the Sales Stage field: Sub BusComp_NewRecord With oBC The following is the equivalent example in Siebel eScript: function BusComp_NewRecord () PreviousRecord Method for a Business ComponentThe PreviousRecord method moves the record pointer to the previous record in a business component, making that record the current record. This method returns one of the following values:
FormatUsageYou can use the PreviousRecord method only on a business component that Siebel CRM has queried with the CursorMode mode argument set to ForwardBackward. For more information, see ExecuteQuery Method for a Business Component. Used WithCOM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script ExamplesThe following Siebel eScript example locates the next-to-last record in a query and then manipulates it: ExecuteQuery(ForwardBackward); // do some record manipulation nextToLastRecord = PreviousRecord(); if (nextToLastRecord) // verify that there is a penultimate record // do some more record manipulation that applies only to next-to-last record For more information, see ExecuteQuery Method for a Business Component. RefineQuery Method for a Business ComponentThe RefineQuery method refines a query. This method does not return any information. FormatUsageUnlike the ClearToQuery method, the RefineQuery method retains the existing query specification and allows you to add search conditions that include those fields that Siebel CRM has not set through a previous search expression. The RefineQuery method is most useful if you use it with the GetNamedSearch method. For more information, see ClearToQuery Method for a Business Component and GetNamedSearch Method for a Business Component. Used WithCOM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script ExamplesThe following Siebel VB code uses RefineQuery: me.SetSearchSpec "Status", "Open" Release Method for a Business ComponentThe Release method releases a business component and the resources for this business component that exist on the Siebel Server. This method does not return any information. FormatUsed WithExamplesThe following example is for Siebel Java Data Bean: import com.siebel.data.*; The following example logs in to a Siebel Server. It then creates an instance for each of the following items: It then releases each of these items in reverse order: import com.siebel.data.*; public class JDBReleaseDemo public static void main(String[] args) public JDBReleaseDemo() // instantiate the Siebel Java Data Bean // login to the Siebel Servers // get the business object // get the business component // get the business service //release the business service //release the business component System.out.println("BC released "); //release the business object // logoff catch (SiebelException e) For more information, see Logoff Method for an Application. SetFieldValue Method for a Business ComponentThe SetFieldValue method sets a new value for a field in the current record of a business component. This method does not return any information. FormatBusComp.SetFieldValue FieldName, FieldValue Table 66 describes the arguments for the SetFieldValue method. The format for the FieldName argument uses the same format that is described in Format for the ActivateField Method. The length of the FieldValue argument must not exceed the length of the field. For example, if you pass a 20 character string to a field that is defined as 16 characters in length, then Siebel CRM creates a run-time error that is similar to the following: Value too long for field 'xxxxx' (maximum size nnn). You must make sure the length of the string you pass is no longer than the length of the destination field. UsageYou can use the SetFieldValue method only on a field that is active. For more information, see ActivateField Method for a Business Component. If the Siebel application runs in standard interactivity mode, then call the WriteRecord method and write the record immediately after you use the SetFieldValue method. You cannot use the SetFieldValue method with a calculated field. You cannot use the SetFieldValue method recursively. Used WithBrowser Script, COM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script ExamplesThe following example is in Siebel VB: If Val(Me.GetFieldValue("Rep %")) < 75 Then The following is the equivalent example in Siebel eScript: if (ToInteger(this.GetFieldValue("Rep %")) < 75) { The following Siebel VB example sets a field to null: oBC.SetFieldValue "FieldName", "" SetFormattedFieldValue Method for a Business ComponentThe SetFormattedFieldValue method sets a new value in a field in the current record of a business component. It accepts the field value in the current local format. This method does not return any information. FormatBusComp.SetFormattedFieldValue FieldName, FieldValue The arguments you can use this format are the same as the arguments described in Table 66. UsageThe SetFormattedFieldValue method is useful if you write code for a Siebel application that you deploy in multiple countries that use different currency, date, and number formats. You can use the SetFormattedFieldValue method only on a field that is active. For more information, see ActivateField Method for a Business Component. Used WithBrowser Script, COM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script ExamplesThe following Siebel VB example is a fragment from a program that tracks the progress of an opportunity through sales stages: Function BusComp_PreWriteRecord As Integer Dim OpportunityBO as BusObject, StageBC as BusComp Set OpportunityBO = TheApplication.GetBusObject ("Opportunity") With SalesStageBC 'Instantiate stage BC 'Check that we do not already have a record for the stage With StageBC If (.FirstRecord = 0) Then Set SalesStageBC = Nothing SetMultipleFieldValues Method for a Business ComponentThe SetMultipleFieldValues method sets new values in the fields of the current record of a business component. This method does not return any information. FormatBusComp.SetMultipleFieldValues oPropertySet Table 67 describes the arguments for the SetMultipleFieldValues method.
The FieldName argument in the property set must match exactly the field name in Siebel Tools, including the correct case. In the following example, the FieldName is Name and the FieldValue is Acme: oPropertySet.SetProperty "Name","Acme" UsageYou can use the SetMultipleFieldValues method only on a field that is active. Do not use the SetMultipleFieldValues method on a field that uses a picklist. Used WithCOM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script ExamplesThe following example is in Siebel eScript: var bo = TheApplication().GetBusObject("Opportunity"); with (ps) bc.ActivateMultipleFields(ps); ps = null; The following Siebel Java Data Bean example sets multiple fields: SiebelDataBean Sieb_dataBean = null; Sieb_dataBean = new SiebelDataBean(); setProperty("Name", "Frank Williams Inc"); Sieb_busComp.activateField ("Name"); Sieb_busComp.newRecord(true); system.out.println("Error : " + e.getErrorMessage()); ps.release(); Related TopicsFor more information, see the following topics:
SetNamedSearch Method for a Business ComponentThe SetNamedSearch method sets the named search specification on a business component. This method does not return any information. FormatBusComp.SetNamedSearch searchName, searchSpec Table 68 describes the arguments for the SetNamedSearch method.
The searchSpec argument works in the same way as the argument you use after the equal sign in a predefined query. For more information, see SetSearchExpr Method for a Business Component and SetSearchSpec Method for a Business Component. UsageA named search specification is a type of search specification that Siebel CRM applies in conjunction with the existing search specification. It applies the named search specification every time it calls the ExecuteQuery method. For example, with a predefined query or with the search specification on a business component. You can only modify a named search specification programmatically. You cannot use the administrative interface to modify a named search specification. The ClearToQuery method does not clear the named search specification. To clear it, you must explicitly set the searchSpec argument to "". If Siebel CRM creates a new instance of a business component, then it clears the named search specification. Using the SetNamedSearch method to define a search does not create a predefined query. You specify this search only in script. To return this search specification, you can use the GetNamedSearch method. To return the values of an attribute in a user profile, Personalization uses the GetProfileAttr method. Used WithCOM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script ExamplesThe examples in this topic set a named search specification for a business component depending on the position of the current user. The following example is in Siebel eScript: function BusComp_PreQuery () The following example is in Siebel VB: Function BusComp_PreQuery () As Integer BusComp_PreQuery = ContinueOperation SetSearchExpr Method for a Business ComponentThe SetSearchExpr method sets a search expression for a business component. This method does not return any information. FormatBusComp.SetSearchExpr searchSpec Table 69 describes the arguments for the SetSearchExpr method. UsageYou can call the SetSearchExpr method after you call the ClearToQuery method and before you call the ExecuteQuery method. It is not necessary to use the ActivateField method on a field that you specify in the SetSearchExpr method. The maximum length of a predefined query is 2000 characters. The searchSpec argument works in the same way as the argument you use after the equal sign in a predefined query. For example, consider the following predefined query:
You can use the following equivalent search specification in various interface methods:
In this example, Name is a field in a business component. You must enclose it in square brackets, [ ]. To create a query that includes a sort specification, use the SetSortSpec method. You cannot use the SetSearchExpr method to set a sort specification. Do not use the SetSearchExpr method and the SetSearchSpec method together. These methods are mutually exclusive. Any date you use with the SetSearchExpr method must use the MM/DD/YYYY format, regardless of the Regional control panel settings on the Siebel Server or the Siebel client. Using the SetSearchExpr Method with a KeywordIf a field value contains a search keyword, then you must use two pairs of double quotes around the field value. Example keywords include NOT, AND, or OR. For example, if the Sub-Status field includes the string Not an Issue as a field value, then you must use the following Siebel VB format to avoid an SQL error:
The following Siebel VB format creates an SQL error:
Used WithBrowser Script, COM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script ExamplesThe following example in Siebel eScript demonstrates how to log the current search specification to a file: var Ob = TheApplication().ActiveBusObject(); Related TopicsFor more information, see the following topics:
SetSearchSpec Method for a Business ComponentThe SetSearchSpec method sets the search specification for a business component. This method does not return any information. CAUTION: Do not use the SetSearchExpr method and the SetSearchSpec method together. They are mutually exclusive. FormatBusComp.SetSearchSpec FieldName, searchSpec Table 70 describes the arguments for the SetSearchSpec method.
UsageYou must call the SetSearchSpec method before you call the ExecuteQuery method. To avoid an unexpected compound search specification on a business component, it is recommended that you call the ClearToQuery method before you call the SetSearchSpec method. It is not necessary to use the ActivateField method on a field that you reference in the SetSearchSpec method. Making Multiple Calls to the SetSearchSpec MethodIf you instruct Siebel CRM to make multiple calls to the SetSearchSpec method for a business component, then it handles the multiple search specifications in the following ways:
Combining Declarative and Scripted Search SpecificationsIf you define a search specification declaratively in Siebel Tools, and if you use the SetSearchSpec method to define another search specification in script, then Siebel CRM creates a search specification that is a logical AND of the declarative search specification and the scripted search specification. For example, consider the following scripted search specification: myBusComp.SetSearchSpec("Status", "<> 'Cancelled'") Consider the following declarative search specification: [Type] <> 'Renewal' AND [Status] <> 'Sold' When Siebel CRM creates a logical AND between these search specifications, the following WHERE clause results: WHERE Type <> 'Renewal' AND (Status <> 'Sold' AND Status <> 'Cancelled') Using Logical and Comparison Operators in a Search SpecificationYou can use logical operators and comparison operators. Consider the following example, in Siebel VB:
Using Special Characters in a Search SpecificationThe search specification can contain any of the following special characters:
You must enclose each of these special characters in quotes. This rule applies to operators that are part of the search expression and to the search text. Using Quotes and Other Characters in a Search SpecificationIf the search expression contains quotes or another special character, then you must enclose the entire search specification in double quotes. An apostrophe is an example of a special character. If the search object includes a special character, then you must double that character. For example, assume your specification must search for text that contains a single double quote: In this situation, you must do the following work:
In another example, assume your search specification must search for the following text in the Name field: In this situation, you must use the following search specification: SetSearchSpec "Name", "'Phillie''s Cheese Steaks'" Using Quotes and Other Characters in a Search Specification in Siebel eScript or Browser ScriptTo mark a special character in Siebel eScript or Browser Script, you must use a backslash instead of a double quote. For example:
For more information, see Using Quotes and Other Characters in a Search Specification. Using a Search Specification to Search Text in a Nontext FieldIf any of the following situations are true, then you must use double quotes to enclose the text you use in a search specification:
Using a Search Specification to Return All RecordsTo return all records, use the ClearToQuery method and then the ExecuteQuery method. Do not use the SetSearchSpec method. For more information, see ClearToQuery Method for a Business Component and ExecuteQuery Method for a Business Component. Using a Search Specification to Search for a Null FieldTo search for a null field, use the following form: SetSearchSpec "Account", "is NULL" If your search specification requests an empty string, then the search returns every record. For example: Used WithCOM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script ExamplesThe following Siebel VB code searches for a contact by name, and then navigates to a view that displays this record: (general) TheApplication.GotoView TargetView , NewBusObj For other Siebel VB examples, see FirstRecord Method for a Business Component, SetFormattedFieldValue Method for a Business Component, and BusComp_PreQuery Event. The following example is in Siebel eScript: var oAccntBO = TheApplication().GetBusObject("Account"); oAddrBC = GetMVGBusComp("Street Address"); oAddrBC = null; For another Siebel eScript example, see ClearToQuery Method for a Business Component. SetSortSpec Method for a Business ComponentThe SetSortSpec method sets the sort specification for a business component. This method does not return any information. FormatTable 71 describes the arguments for the SetSortSpec method. The sortSpec argument uses the following format:
You must enclose the entire string in double quotes. To sort on various fields in different orders, you can use a comma to separate field names and order specifications. UsageIf you use the SetSortSpec method, then you must call it after you call the ClearToQuery method and before you call the ExecuteQuery method. The SortSpec argument works in the same way as the equal sign in a predefined query. For example, consider the following predefined query:
You can use the following equivalent search specification in various interface methods:
Note that Name is the value in the Name property of the business component field. This example queries the Name field. Any date you use with the SetSortSpec method must use the MM/DD/YYYY format, regardless of the Regional control panel settings of the Siebel Server or Siebel client. Used WithCOM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script ExamplesThe Siebel VB example in this topic sorts the Opportunity list first by Account in reverse order, and then in alphabetical order by Site. Note that the column names in the Opportunity list applet are not the same as the names in the underlying business component. For demonstration purposes, this example sorts in ascending and descending order. In actual practice, do not sort in two directions in a single sort specification because this type of sorting can significantly degrade performance. Function BusComp_PreQuery As Integer With Me The following is the equivalent example in Siebel eScript: with (this) Related TopicsFor more information, see the following topics:
SetUserProperty Method for a Business ComponentThe SetUserProperty method sets the value of a user property in a business component. A user property is similar to an instance variable of a business component. This method does not return any information. FormatBusComp.SetUserProperty propertyName, newValue Table 72 describes the arguments for the SetUserProperty method. UsageUsage for the SetUserProperty method is similar to the usage for the GetUserProperty method. For more information, see Usage for the GetUserProperty Method. Used WithCOM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script ExamplesThe following example is in Siebel VB: Sub BusComp_SetFieldValue (FieldName As String) The following is the equivalent example in Siebel eScript: function BusComp_SetFieldValue (FieldName) SetViewMode Method for a Business ComponentThe SetViewMode method sets the visibility type for a business component. This method does not return any information. For more information, see GetViewMode Method for a Business Component. FormatTable 73 describes the arguments for the SetViewMode method.
Siebel ViewMode constants correspond to applet visibility types. For more information about applet visibility types, see Siebel Security Guide. Constants You Can Use with the SetViewMode MethodTable 74 describes the constants you can use with the SetViewMode method. The Owner Type column indicates the value that must be set in the Owner Type property of the BusComp view mode object of the business component. For more information, see Use Constants to Standardize Code. Used WithCOM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script ExamplesThe following example is in Siebel VB. For another example, see BusComp_PreDeleteRecord Event: (general) The following is the equivalent example in Siebel eScript: var oBO = TheApplication().GetBusObject(this.BusObject().Name()); UndoRecord Method for a Business ComponentThe UndoRecord method reverses any unsaved modifications that Siebel CRM has made on a record. This includes reversing unsaved modifications to fields, and deleting an active record that is not saved to the Siebel database. This method does not return any information. FormatUsageYou can use the UndoRecord method in the following ways:
UndoRecord reverses unsaved modifications to a record. If you require a fine degree of control over the modifications that Siebel CRM reverses, then do the following:
For more information, see Caution About Using the Cancel Operation Event Handler and NewRecord Method for a Business Component. Used WithBrowser Script, COM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script WriteRecord Method for a Business ComponentThe WriteRecord method saves to the Siebel database any modifications made to the current record. This method does not return any information. FormatUsageAfter creating new records and setting values for fields, you can call the WriteRecord method to save the new record to the Siebel database. Used WithBrowser Script, COM Data Control, COM Data Server, Siebel Java Data Bean, Mobile Web Client Automation Server, Server Script ExamplesThe Siebel VB example in this topic implements the following logic: if the user sets the Sales Stage field to 02, then insert an activity: (general) Sub BusComp_SetFieldValue (FieldName As String) Select Case FieldName For more examples, see GetMVGBusComp Method for a Business Component and NewRecord Method for a Business Component |
Siebel Object Interfaces Reference | Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Legal Notices. | |