-
Notifications
You must be signed in to change notification settings - Fork 10
Getting PM State
Some of available methods that could be used to learn the Siebel PM current state and what could be done:
-
canInvokeMethod(method)
- returns true if the method specified by the input parameter could be executed. -
getControls()
- returns the object of applet's controls with their dynamic and static attributes. -
getListColumns()
- returns the object of list applet's list columns with their dynamic and static attributes (output similar to the output ofgetControls
). -
getControlsRecordSet(addRecordIndex)
- the same asgetRecordSet(addRecordIndex)
, but the objects' keys are controls' names (not fields' names as in the output of thegetRecordSet
method). The method converts the values and always returns theId
value. -
getCurrentRecord(raw)
- returns the currently selected record, if theraw
input parameter is true, the raw recordset is returned. -
getCurrentRecordModel(controls, methods)
- returns the converted values and attributes of the controls for the current record, optionally it accepts the template object with the names of the controls to be returned. In addition, thecontrols
object has thestate
property with the following possible values:- 0 - No records displayed
- 1 - Record is being created
- 2 - Record is being edited
- 3 - Recordset is in query mode.
- 4 - Record is displayed
- 5 - Record is read-only
The methods
input parameter also is optional, and contains the object where keys are methods names; if this parameter is passed, the getCurrentRecordModel
sets the Boolean value for each key that indicates if the method could be invoked; otherwise all methods specified on the applet's controls will be returned. Send the empty literal object {} to avoid the calculations.
This methods modifies the input parameters.
-
getRecordSet(addRecordIndex)
andgetRawRecordSet(addRecordIndex)
- return the current set of records displayed in the applet (returned value is copied and also returns the Id value). ThegetRawRecordSet
method returns not formatted values, thegetRecordSet
returns formatted values. If the optional parameteraddRecordIndex
has truthy value, the output contains the zero-based index of the record (_indx
). Note:getRecordSet
returns one empty record in the query mode.getRawRecordSet
still returns the recordset. -
getSelection()
- returns the zero-based index of the currently selected record; if no records, it returns -1. Please pay attention that the returned value doesn't correspond to the record index in the recordset fetched from the server. -
getPaginationInfo()
returns{ start, end, total, hasMore, current }
that could be used to display row counter information.hasMore
returns the value of theIsNumRowsKnown
PM property. To check if it makes sense to go to the next record set in the list applet, checkcanInvokeMethod('GotoNextSet')
. -
getControlsRecordObjects
-
saveUserPref(userPrefName, userPrefValue)
andgetUserPref(userPrefName)
The value is saved into the user's spf-file, this value is persisted between sessions.