Defects
UGBase Member function should return a Long Integer
ID: | D27749 | |
Published: | 04 February 2021 |
Defect Id
DOC344140
Originally Reported Against
SBM 2009 R1
Status
Submitted
Description
The scripting documentation indicates that the UGBase Member function should return a Long Integer, however, it actually returns a string ('True' or 'False')..
What are the steps to reproduce the problem?
Use sample script as an action to a transition
' Script can be added to the post transition context of any transtion.
' It will write event an event log message for every group in the system and indicate if the user is a member of the group or not.
Option Explicit
Dim oObj, oGroup, oGroupList
Set oObj = Ext.CreateAppRecordList(Ext.TableId("TS_GROUPS"))
If oObj.ReadWithWhere("TS_ID >0 ", "TS_ID") Then
Set oGroupList =oObj
For Each oGroup In oGroupList
' Next line should be:
' If Shell.User.Member(oGroup.GetId()) Then
' OR
' ' If Shell.User.Member(oGroup.GetId()) > 0 Then
' However, since the UGBase object is returning a (string) instead of a (Long Integer) as the documentatio indicates you have to use this
If UCase(Shell.User.Member(oGroup.GetId())) = "TRUE" Then
Call Ext.LogWarningMsg(Shell.User.GetName() & " is a member of the " & oGroup.GetName() & " group.")
Else
Call Ext.LogInfoMsg(Shell.User.GetName() & " is NOT a member of the " & oGroup.GetName() & " group.")
End If
Next
End If