Bookshelf Home | Contents | Index | PDF | ![]() ![]() |
Siebel Object Interfaces Reference > Siebel Object Interfaces Reference > Object Interfaces Reference > Business Component EventsThis topic describes business component events. It includes the following topics:
You can use these events only on the Siebel Server, except for the PreSetFieldValue event, which you can use only on the browser. You can call an event from a data operation on a business component. You define these events for each business component. You can call an event before or after Siebel CRM performs the predefined behavior. Monitoring Modifications That the User Makes to a Multivalue FieldTo monitor modifications the user makes to a multivalue field, you must use the multivalue group business component. If the user uses the multivalue group applet to modify a value in a multivalue field, then Siebel CRM calls the PreSetFieldValue event and the SetFieldValue event for the field. It does not call any event on the parent business component. If the user does not use the multivalue group applet to modify a value in a multivalue field, then Siebel CRM does not start the PreSetFieldValue event or the SetFieldValue event for the field. The only time Siebel CRM starts these events is if the user updates the field in the multivalue group applet. BusComp_Associate EventIf the user adds a business component record to create an association, then Siebel CRM calls the BusComp_Associate event. This method does not return any information. FormatUsageThe usage for the BusComp_Associate event is the same as the usage for the BusComp_NewRecord event. For more information, see BusComp_NewRecord Event. Used WithBusComp_ChangeRecord EventIf a business component record becomes the current record, then Siebel CRM calls the BusComp_ChangeRecord event. This method does not return any information. FormatUsageSiebel CRM runs code in the ChangeRecord event handler each time the active record changes. To allow smooth scrolling in a list applet, you must avoid lengthy operations in this event handler. Used WithExamplesThe Siebel VB example in this topic uses subprograms in the declarations section of the general section to set up an audit trail for service requests. This example uses the ChangeRecord event handler to initialize the values from the service record so that Siebel CRM can compare them with current values: (general) Sub CreateAuditRecord (FieldName As String, NewValue As String, OldValue As String, ChangedText As String) Dim ActionBC As BusComp Set CurrentBO = TheApplication.GetBusObject("Service Request") With ActionBC .SetFieldValue "Activity SR Id", theSRNumber Sub InitializeOldValues Sub BusComp_ChangeRecord BusComp_CopyRecord EventIf the user copies a business component record, and if the user makes this record the active record, then Siebel CRM calls the BusComp_CopyRecord event. This method does not return any information. FormatUsageIf a new record is created in one of the following ways, then Siebel CRM calls the BusComp_CopyRecord method instead of the BusComp_NewRecord method:
Used WithBusComp_DeleteRecord EventIf the user deletes a business component record, then Siebel CRM calls the BusComp_DeleteRecord event. The fields of the deleted record are no longer available. This method does not return any information. FormatUsage for the BusComp_DeleteRecord EventSiebel CRM does not start the BusComp_PreDeleteRecord event or the BusComp_DeleteRecord event for a child record that it deletes according to the Cascade Delete property on a link. For performance reasons, Siebel CRM performs these deletes directly in the data layer. Siebel CRM calls script events from the object layer, so it does not run them. Used WithBusComp_InvokeMethod EventIf Siebel CRM calls the InvokeMethod method on a business component, then it also calls the BusComp_InvokeMethod event. This method does not return any information. FormatBusComp_InvokeMethod(methodName) The arguments you can use with this format are the same as the arguments described in Table 24. UsageIf you call a specialized method on a business component, or if you call the InvokeMethod method explicitly on a business component, then Siebel CRM calls the BusComp_InvokeMethod event. For more information, see About Specialized and Custom Methods. Used WithBusComp_NewRecord EventIf the user creates a business component record, and if the user makes this record the active record, then Siebel CRM calls the BusComp_NewRecord event. You can use this event to set up default values for a field. This method does not return any information. FormatUsageIf a new record is created in one of the following ways, then Siebel CRM calls the BusComp_CopyRecord method instead of the BusComp_NewRecord method:
Used WithExamplesFor an example, see Pick Method for a Business Component. BusComp_PreAssociate EventIf Siebel CRM detects that the user is about to add a business component record to create an association, then it calls the BusComp_PreAssociate event before it adds the record. This method returns ContinueOperation or CancelOperation. For more information, see Caution About Using the Cancel Operation Event Handler. FormatNo arguments are available.The format is the same as for BusComp_PreNewRecord event. For more information, see BusComp_PreNewRecord Event. Used WithBusComp_PreCopyRecord EventIf Siebel CRM detects that the user is about to copy a business component record, then it calls the BusComp_PreCopyRecord event before it copies the record. You can use this event to perform precopy validation. This method returns ContinueOperation or CancelOperation. For more information, see Caution About Using the Cancel Operation Event Handler. FormatUsed WithBusComp_PreDeleteRecord EventIf Siebel CRM detects that the user is about to delete a business component record, then it calls the BusComp_PreDeleteRecord event. You can use this event to prevent the deletion or to perform any actions before Siebel CRM deletes the record.This method returns ContinueOperation or CancelOperation. For more information, see Caution About Using the Cancel Operation Event Handler. FormatUsageUsage for the BusComp_PreDeleteRecord event is the same as usage for the BusComp_DeleteRecord event. For more information, see Usage for the BusComp_DeleteRecord Event. Used WithExamplesThe following Siebel VB example prevents the deletion of an account that includes associated opportunities: (general) Function BusComp_PreDeleteRecord As Integer sAcctRowId = me.GetFieldValue("Id") With oBC BusComp_PreDeleteRecord = ContinueOperation Set oBC = Nothing BusComp_PreGetFieldValue EventIf a user accesses a business component field, then Siebel CRM calls the BusComp_PreGetFieldValue event. This method returns the field name and field value that exists before Siebel CRM displays the field. It also returns ContinueOperation or CancelOperation. For more information, see Caution About Using the Cancel Operation Event Handler. FormatBusComp_PreGetFieldValue(FieldName, FieldValue) Table 77 describes the arguments for the BusComp_PreGetFieldValue event.
UsageSiebel CRM calls the BusComp_PreGetFieldValue event in the following situations:
Improving Performance when Calling the BusComp_PreGetFieldValue MethodSiebel CRM runs any script that is attached to this event very frequently. It even calls empty scripts. These calls might cause a Siebel application appear to be unresponsive. To improve performance when calling the BusComp_PreGetFieldValue method
Used WithBusComp_PreInvokeMethod EventIf Siebel CRM calls a specialized method on a business component, then it calls the BusComp_PreInvokeMethod event before it calls this specialized method. The BusComp_PreInvokeMethod event returns ContinueOperation or CancelOperation. For more information, see About Specialized and Custom Methods, and Caution About Using the Cancel Operation Event Handler. FormatBusComp_PreInvokeMethod(methodName) The arguments you can use with this format are the same as the arguments described in Table 24. Used WithBusComp_PreNewRecord EventIf Siebel CRM detects that the user is about to create a new business component record, then it calls the BusComp_PreNewRecord event before it creates the record. You can use this event to perform preinsert validation. This method returns ContinueOperation or CancelOperation. For more information, see Caution About Using the Cancel Operation Event Handler. FormatUsed WithBusComp_PreQuery EventSiebel CRM calls the BusComp_PreQuery event before it runs a query. This method returns ContinueOperation or CancelOperation. For more information, see Caution About Using the Cancel Operation Event Handler. FormatUsageTo modify the search criteria or to restrict Siebel CRM from running certain queries, you can use the BusComp_PreQuery event. Used WithExamplesThe following example is in Siebel VB: Function BusComp_PreQuery() As Integer BusComp_PreSetFieldValue EventSiebel CRM calls the BusComp_PreSetFieldValue event in the following situations:
This event allows you to use custom validation before Siebel CRM applies predefined validation. This method returns ContinueOperation or CancelOperation. For more information, see Caution About Using the Cancel Operation Event Handler. FormatBusComp_PreSetFieldValue(FieldName, FieldValue) The arguments you can use with this format are the same as the argument described in Table 22. UsageIf your script returns CancelOperation for a field, then Siebel CRM does not enter data for this field. However, Siebel CRM still starts BusComp_PreSetFieldValue for the other fields that the picklist uses to enter data. For more information, see Caution About Using the Cancel Operation Event Handler. If a user uses a picklist to enter data for multiple fields, then it starts the BusComp_PreSetFieldValue method for each field that the user uses to enter data. For example, in an applet that the user accesses to enter data for the Last Name, First Name, and Contact ID. In this example, Siebel CRM starts the BusComp_PreSetFieldValue method three times, one time for each field. Siebel CRM does not call the BusComp_PreSetFieldValue event on a picklist or multivalue field. Usage With RoundtripsSiebel CRM does the following during a roundtrip to the Siebel Server:
To prevent infinite recursions, if the BusComp_PreSetFieldValue event is running, then Siebel CRM does not run it again for the same business component instance, even if Siebel CRM uses it on a different field in the business component. Used WithExamplesThe following Siebel VB example uses the PreSetFieldValue event to determine if a quote discount is greater than 20 percent, and to take the appropriate action if it is. For other examples of BusComp_PreSetFieldValue, see LoginId Method for an Application, and ExecuteQuery Method for a Business Component: Function BusComp_PreSetFieldValue (FieldName As String, The following is the equivalent example in Siebel eScript: function BusComp_PreSetFieldValue (FieldName, FieldValue) BusComp_PreWriteRecord EventSiebel CRM calls the BusComp_PreWriteRecord event before it writes a record to the Siebel database. This method returns ContinueOperation or CancelOperation. For more information, see Caution About Using the Cancel Operation Event Handler. FormatUsageFor important caution information, see Caution for Using an Error Method with a Write Record Event. You can use this event to perform any final validation before Siebel CRM performs any predefined internal record-level validation. Siebel CRM starts the BusComp_PreWriteRecord event only if the user modifies or inserts a field value, or if the user deletes a record. If the user deletes a record, then Siebel CRM calls the BusComp_PreWriteRecord method to delete the implied join that joins any records to the initial record. Using a Write Record Event with a Multivalue GroupIf Siebel CRM associates a multivalue group record that uses a many to many relationship with the business component that calls the association, then it starts the BusComp_PreWriteRecord event and the BusComp_WriteRecord event. It starts these events even if the association does not update any fields in the multivalue group business component or in the calling business component. It runs the BusComp_PreWriteRecord event and the BusComp_WriteRecord event to acknowledge the update to the intersection table. Used WithExamplesThe following example calls the BusComp_PreWriteRecord event: Function BusComp_PreWriteRecord As Integer ' This code resets the probability before the write if Me.GetFieldValue("Sales Stage") LIKE "07*" then BusComp_Query EventSiebel CRM calls the BusComp_Query event after it completes a query but before it displays the query results. This event does not return any information. FormatUsed WithExamplesIn the following Siebel VB example, the Action business component uses a special activity type. If the user starts an account query, then this code determines if important information is available. If it is available, then Siebel CRM displays it in a message box: Dim oBusObj As BusObject, oCurrFinAct As BusComp, set oBusObj = TheApplication.ActiveBusObject If oCurrFinAct.FirstRecord <> 0 then Set oCurrFinAct = Nothing BusComp_SetFieldValue EventIf Siebel CRM sends a value to a business component from the Siebel client or through a call to the SetFieldValue method, then it calls the BusComp_SetFieldValue event. It does not call this event for a predefaulted field or for a calculated field. This event does not return any information. FormatBusComp_SetFieldValue(FieldName) The arguments you can use in this format are the same as the arguments that are described in Table 52. Used WithExamplesIn the following Siebel VB example, if Siebel CRM calls the SetFieldValue event, then it calls methods on an existing business component: Sub BusComp_SetFieldValue (FieldName As String) The following is the equivalent example in Siebel eScript: function BusComp_SetFieldValue (FieldName) BusComp_WriteRecord EventSiebel CRM starts the BusComp_WriteRecord event after it saves the record to the Siebel database. This event does not return any information. FormatUsageDo not use the BusComp_SetFieldValue event in a BusComp_WriteRecord event. If you must use the BusComp_SetFieldValue event, then use it in the BusComp_PreWriteRecord event. For more information, see BusComp_PreWriteRecord Event. For information about using the BusComp_WriteRecord event with a multivalue group, see Using a Write Record Event with a Multivalue Group. Caution for Using an Error Method with a Write Record EventCAUTION: Be careful if you use the RaiseError method or the RaiseErrorText method in the BusComp_WriteRecord event or in the BusComp_PreWriteRecord event. For example, if you use the RaiseErrorText method in the BusComp_PreWriteRecord method, then the user or the code cannot step off the current record until the condition that causes Siebel CRM to call the RaiseErrorText method is addressed. Used With |
![]() ![]() |
Siebel Object Interfaces Reference | Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Legal Notices. | |