Bookshelf Home | Contents | Index | PDF |
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 ClassThis topic describes methods that you can use that reside in the Business Component class. It includes the following information:
ActivateField MethodThe ActivateField method activates a business component field. It returns nothing. It uses the following syntax: this.ActivateField(field_name); A field is inactive except in the following situations, by default:
ExampleThe 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(); ActivateMultipleFields MethodThe ActivateMultipleFields method activates more than one field. It returns nothing. It uses the following syntax: BusComp.ActivateMultipleFields(SiebelPropertySet);
Example 1The 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(); Example 2The 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(); Associate MethodThe 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:
SiebelApp.S_App.FindApplet(appletName).BusComp().Associate(); An association business component is a type of business component that includes an intertable. For more information, see GetAssocBusComp Method. ClearToQuery MethodThe ClearToQuery method clears the current query. It returns nothing. It uses the following syntax:
ExampleThe following example uses the ClearToQuery method: var model= SiebelApp.S_App.GetModel(); For another example usage of the ClearToQuery method, see CountRecords Method. CountRecords MethodThe 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: ExampleThe following example uses the CountRecords method: var model= SiebelApp.S_App.GetModel(); For more information, see ClearToQuery Method. DeactivateFields MethodThe 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 DeactivateFields method returns nothing. SiebelApp.S_App.FindApplet(appletName).BusComp().DeactivateFields(); 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 MethodThe DeleteRecord method deletes the current record from the local database. It returns one of the following values: buscomp.DeleteRecord(psInputArgs); ExecuteQuery MethodThe 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:
FirstRecord MethodThe 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: SiebelApp.S_App.FindApplet(appletName).BusComp().FirstRecord(); GetAssocBusComp MethodThe GetAssocBusComp method returns an instance of the association business component. It uses the following syntax: 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.
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 MethodThe following example associates a contact that includes the ContactID Id with an account that includes the AccountId Id: var Model = SiebelApp.S_App.GetModel() assocBC.FirstRecord();// positions on the contactbc GetFieldValue MethodThe 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)
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 MethodThe 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:
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(); GetLastErrCode Method for Business ComponentsThe GetLastErrCode method returns the error code for the most recent error that the disconnected client logged. It uses the following syntax: 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 ComponentsThe 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: ActiveBusObject().GetLastErrText(); This method includes no arguments. GetMultipleFieldValues MethodThe GetMultipleFieldValues method returns a value for each field that a property set specifies. It uses the following syntax: BusComp.GetMultipleFieldValues(fieldNamesPropSet, fieldValuesPropSet)
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: You cannot use the same instance of a property set for the fieldNamesPropSet argument and for the fieldValuesPropSet argument. Example of Using the GetMultipleFieldValues MethodThe following example uses the GetMultipleFieldValues method: var oPsDR_Header = SiebelApp.S_App.NewPropertySet(); GetPicklistBusComp MethodThe 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 PicklistsIf 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 PicklistThis 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
GetSearchExpr MethodThe 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: 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 MethodThe 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: The GetSearchSpec method uses the following syntax: BusComp.GetSearchSpec(FieldName); SiebelApp.S_App.FindApplet(appletName).BusComp().GetSearchSpec (FieldName); GetUserProperty MethodThe GetUserProperty method gets the value of a business component user property. It uses the following syntax: BusComp.GetUserProperty(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 MethodThe 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: SiebelApp.S_App.FindApplet(appletName).BusComp().GetViewMode(); InvokeMethod for Business ComponentsThe 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 ComponentsThe Name method returns the name of a business component. It uses the following syntax: SiebelApp.S_App.FindApplet(appletName).BusComp() NextRecord MethodThe 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: SiebelApp.S_App.FindApplet(appletName).BusComp().NextRecord(); ParentBusComp MethodThe ParentBusComp method returns the parent business component of a business component. It uses the following syntax: SiebelApp.S_App.FindApplet(appletName).BusComp().ParentBuscomp() Pick MethodThe 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: 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 MethodThe 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. BusComp.InvokeMethod("RefreshBusComp") "buscomp. InvokeMethod("RefreshBusComp") $.callback(this, function (retObj) { RefreshRecord MethodThe 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. BusComp.InvokeMethod("RefreshRecord ") "buscomp. InvokeMethod("RefreshRecord") $.callback(this, function (retObj) { SetFieldValue MethodThe 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:
SetFieldValue(fieldName, fieldValue);
For examples that use the SetFieldValue method, see the following topics:
SetMultipleFieldValues MethodThe 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")
ExampleThe 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(); SetSearchSpec MethodThe SetSearchSpec method sets the search specification for a business component. It returns nothing. It uses the following syntax: BusComp.SetSearchSpec(FieldName, searchSpec); SiebelApp.S_App.FindApplet(appletName).BusComp().SetSearchSpec("Id", strCallId);
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 MethodThe SetViewMode method sets the visibility type for a business component. It returns nothing. It uses the following syntax: SiebelApp.S_App.FindApplet(appletName).BusComp().SetViewMode(inMode); UndoRecord MethodThe 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:
SiebelApp.S_App.FindApplet(appletName).BusComp().UndoRecord(); You can use the UndoRecord method in the following ways:
UpdateRecord MethodThe 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:
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 The UpdateRecord method can run in a Siebel Mobile disconnected client. For more information, see CanUpdate Method. WriteRecord MethodThe WriteRecord method writes any modifications that the user makes to the current record. If you use this method with:
The WriteRecord method returns one of the following values:
The WriteRecord method uses the following syntax: buscomp.writerecord(bAddSyncQ)
For examples that use the WriteRecord method, see the following topics:
ExampleYou 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(); |
Configuring Siebel Open UI | Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices. | |