Hi Paula,
You will need to create a new method in the OnChange event of your Opportunity form (if one does not already exist) and use the following code..
<p>Dim objRS, strSQL, objSLXDB
Dim boolTeamMember boolTeamMember = false
Set objSLXDB = New SLX_DB
Set objRS = objSLXDB.GetNewRecordSet strSQL = "select accessid from secrights where seccodeid = " & _
"(select seccodeid from seccode where (UPPER(seccodedesc) = 'ADMIN') " & _
"and (seccodetype = 'G')) and (accessid = '" & Application.BasicFunctions.CurrentUserID & "')" objRS.Open strSQL, objSLXDB.Connection If Not (objRS.BOF And objRS.EOF) Then
boolTeamMember = (objRS.Fields(0).Value & "" = Application.BasicFunctions.CurrentUserID)
Else
boolTeamMember = False
End If 'If boolTeamMember = True then they are in the ADMIN team
'Hide/Show your fields here...
If boolTeamMember Then
Else
End if
objRS.Close
Set objRS = Nothing
Set objSLXDB = Nothing
I would also suggest reading through the help within SalesLogix Architect and getting yourself a copy of DevLogix (development book for SalesLogix) so that you have a better understanding of what the above code is doing. Depending on your experience it may also be worth looking at some tutorials for vbScript (http://www.w3schools.com/asp/vbscript_default.asp).
Hope that helps!
Regards,
Lee
(QGate Software Ltd) |