Microsoft Operations Manager

SetCustomField Method

The SetCustomFieldmethod sets the value of a user-defined custom field of an alert.

[VBScript]
Alert.SetCustomField(FieldNumber Integer, FieldValue String)

Parameters

FieldNumber
Specifies the number of the user-defined custom field to set. Possible values for the FieldNumberparameter are 1, 2, 3, 4, and 5 to set the first through fifth custom fields, respectively.
FieldValue
Specifies the value to which to set the user-defined custom field of the alert.

Return Value

None

Examples

The following example shows how to store an array of values in the user-defined custom field of an alert.

[VBScript] 
Function StoreArrayInCustomField(objAlert, intField, arrValues)
	Dim intIndex
	Dim strFieldValue
 
	For intIndex = LBound(arrValues) To UBound(arrValues)
		' create a comma-separated string from the array
		strFieldValue = strFieldValue &
CStr(arrValues(intIndex)) & ","
	Next

	objAlert.SetCustomField(intField, strFieldValue)

	StoreArrayInCustomField = strFieldValue
End Function

Requirements

Windows NT/2000: Requires Windows 2000 or later
Version: Requires MOM 1.0 SP1

See Also

Alert Object


Did you find this information useful? Please send your suggestions and comments about the documentation to momsdk@microsoft.com.