SBM AppScript Reference → Programming SBM AppScript → Application Objects → Object Types → Change
Each time users modify an SBM table in the system using a browser, it is logged as a Change object in the TS_CHANGES table. This class is mainly used in conjunction with the ChangeList class. Once a change list is found for a table record, the ChangeList is a list of Change objects. This class can be used to access member variables that describe the change. You can read and write with this class by using the inherited AppRecord methods. All of the methods listed on this class directly relate to fields on the Changes table. Please see the SBM schema document for details of each of the fields.
AppRecord -> Change
GetTime( [format] ): Return the date and time of this change, formatted as a string.
Input: format (Long Integer or User) – Optional. If Long Integer, a code telling how to format the date/time. If User object, that user's date/time format preference will be used. If omitted, the format defaults as indicated in the following table.
The following table lists the valid Long Integer format codes.
ID |
Description |
---|---|
1 |
mm/dd/YYYY hh:mm:ss pp (default) |
2 |
dd/mm/YYYY hh:mm:ss pp |
("pp" denotes the am/pm indicator) |
Output: N/A
Return: (String) – The date the change was created in the given format.
GetUserName(): Return the display name of the user who made this change.
Input: N/A
Output: N/A
Return: (String) – The display name of the user who made this change.
Action: (long integer) – Numeric code classifying the type of change, as listed in the Action Codes table.
Code |
Description |
---|---|
0 |
A record was submitted |
1 |
A record was modified |
2 |
A record was deleted |
3 |
An attachment was added |
4 |
An attachment was updated |
5 |
An attachment was deleted |
FldId: (long integer) – TS_ID of the field that was modified during this change.
FldType: (long integer) – Data type of the field that was modified during this change. ID Types are listed in the following table.
Type |
Description |
---|---|
100 |
Numeric field (integer or floating point) |
101 |
Text field |
103 |
Date/Time field |
104 |
Drop-down Selection field |
105 |
Binary/Trinary field |
106 |
The system-defined State field (a selection field) |
107 |
User field (a selection field) |
108 |
System-defined Project field (a selection field) |
109 |
Calculated Summation fields |
110 |
Multi-Selection field |
111 |
Contact Selection field |
113 |
Incident Selection field |
116 |
Folder link Selection field |
122 |
Relational field |
123 |
Sub-Relational field |
124 |
System field |
125 |
Multi-Relational field |
126 |
Multi-User field |
127 |
Multi-Group field |
IssueId: (long integer) – TS_ID of the record that was modified. Use in conjunction with the TableId property to find the record.
NewChar: (String) – If the modified field's data type was text, this field holds the field's value after the change. Check the Type property to determine whether this property is valid.
NewInt: (Long Integer) – If the modified field's data type was an integer, this field holds the field's value after the change. Check the Type property to determine whether this property is valid.
NewReal: (Double) – If the modified field's data type was a floating point number, this field holds the field's value after the change. Check the Type property to determine whether this property is valid.
PriorChar: (String) – If the modified field's data type was text, this field holds the field's value before the change. Check the Type property to determine whether this property is valid.
PriorInt: (Long Integer) – If the modified field's data type was an integer, this field holds the field's value before the change. Check the Type property to determine whether this property is valid.
PriorReal: (Double) – If the modified field's data type was a floating point number, this field holds the field's value before the change. Check the Type property to determine whether this property is valid.
TableId: (long integer) – Table ID of the record that was modified. Use in conjunction with the IssueId property to find the record.
Time: (long integer) – Returns the time that change was made, as the number of seconds since the beginning of Jan. 1, 1970. To get the time as a formatted string, use the GetTime property. To convert it to a VBScript Date quantity, use the extension function Ext.DbLongToDate().
Type: (long integer) – Identifies the database type of the quantity that changed, according to the data types listed in the following table. If the quantity was an integer, then its old and new values are available in the PriorInt and NewInt properties. If it was a floating point number, then PriorReal and NewReal are valid. If it was text, then PriorChar and NewChar are valid.
ID |
Description |
---|---|
0 |
Modification to an integer |
1 |
Modification to a floating point |
2 |
Modification to a Text field |
UserId: (long integer) – TS_ID of the user who made the change. Use the GetUserName method if the name of the user is needed.
Copyright © 2007–2017 Serena Software, Inc. All rights reserved.