Highlighted
forumadmin Absent Member.
Absent Member.
4568 views

Receiving ERR # 25 when creating a notifications message record.


Question posted 6/12/09 by Umair Anis
Details:

I'm trying to trigger an email based on severity selected from Teamscript by inserting a notification message record in TS_NOTIFICATIONMESSAGES table and receiving ERR # 25. Please let me know what i'm doing wrong.
INVALID SCRIPT "CertCheck" (id=4)
3 errors during parsing
Syntax ERR # 25
Line 19> myRecord.SetFieldValue( "address", "address@yahoo.com")
Syntax ERR # 25
Line 20> myRecord.SetFieldValue( "subject", "Test Message Subject Goes Here" )
Syntax ERR # 25
Line 20> myRecord.SetFieldValue( "content", "The body of the message goes here." )

here is my full scripts.
**************************
Option Explicit
CheckSev
Sub CheckSev()
Dim sev
Dim tableId, myRecord, myLong
Call Shell.Item.GetFieldValue( "SEVERITY", sev )
If sev = 147 Then
REM Create a Notifications Message record
tableId = Ext.TableId("TS_NOTIFICATIONMESSAGES")
Set myRecord = Ext.CreateAppRecord (tableId)
myRecord.SetFieldValue( "address", "address@yahoo.com")
myRecord.SetFieldValue( "subject", "Test Message Subject Goes Here" )
myRecord.SetFieldValue( "content", "The body of the message goes here." )
myLong = myRecord.Add()
If myLong = 0 Then
Call Ext.LogErrorMsg("Error adding message to notifications table.")
End If
End If
End Sub
***********************




0 Likes
1 Reply
forumadmin Absent Member.
Absent Member.

Re: Receiving ERR # 25 when creating a notifications message record.


Comment posted 6/14/09 by Mikaela Nilsson

All the setFieldValue lines need to have function call.
myRecord.SetFieldValue( "address", "address@yahoo.com")
Need to have either a ok=myRecord.SetFieldValue( "address", "address@yahoo.com")
Or
Call myRecord.SetFieldValue( "address", "address@yahoo.com")
Or
If Not myRecord.SetFieldValue( "address", "address@yahoo.com") Then
' Error finding the field or writing to it
Call Ext.LogErrorMsg( "Cannot write to field addressfield")
End If

Just like you do on the myLong = myRecord.Add().

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.