Need help with TeamScript error: ERR #25 for the SetFieldValue lines?

crknittel's picture
crknittel asked on February 29, 2012 - 9:13pm | Replies (1).

New to TeamScript, I am trying to set a Binary field (SEND_TO_DOCUMENTUM)to Yes or No based on a single selection of YES.

I wrote the script below, but keep getting an SYNTAX error -- ERR #25 for the SetFieldValue lines.

The DBNAME of the field is SEND_TO_DOCUMENTUM.

Does someone know what I need to do to remove the errors from the script below?

Option Explicit
Dim CurrentRecord, bRetVal, strSystem
If Ext.ShellHasProp("Item") Then
Set CurrentRecord = Shell.Item
bRetVal = CurrentRecord.GetFieldValue("POST_TO_DOC",strSystem)
If strSystem = "YES" Then
CurrentRecord.SetFieldValue("SEND_TO_DOCUMENTUM","Yes")
Else
CurrentRecord.SetFieldValue("SEND_TO_DOCUMENTUM","No")
End If
End If

1 Answer

TechWell Contributor's picture

Ext.LogInfoMsg is your friend. That writes param to the server Application log.

When dealing with AppScript, you're at a much "lower" level and frequently reading/ writing numeric TS_ID values instead of the textual values you see in the user interface. You will need to study the db Schema PDF from the Serena website and know how TS_FIELDS, TS_TABLES, TS_SELECTIONS and other system db tables work.

I think you'll find that the GetFieldValue is setting strSystem to a numeric value which is the value of "Yes" for that field. Study TS_FIELDS table, especially TS_LABEL1,2, and 3.

CMCrossroads is a TechWell community.

Through conferences, training, consulting, and online resources, TechWell helps you develop and deliver great software every day.