Beispiel für alle Eigenschaften
VBScript:
Dim oUser : Set oUser = cRM.CurrentProject.Users.CurrentUser
Dim bHasAdministratorRights : bHasAdministratorRights = oUser.HasAdministratorRights
Dim bIsLoggedIn : bIsLoggedIn = oUser.IsLoggedIn
Dim bIsTheAdministrator : bIsTheAdministrator = oUser.IsTheAdministrator
Dim sDepartment : sDepartment = oUser.Department
Dim sEmail : sEmail = oUser.Email
Dim sEmail2 : sEmail2 = oUser.Email2
Dim sFax : sFax = oUser.Fax
Dim sFirstName : sFirstName = oUser.FirstName
Dim sGroupNames : sGroupNames = oUser.GroupNames
Dim sID : sID = oUser.ID
Dim sLastName : sLastName = oUser.LastName
Dim sLoginName : sLoginName = oUser.LoginName
Dim sMobile : sMobile = oUser.Mobile
Dim sMobile2 : sMobile2 = oUser.Mobile2
Dim sPhone : sPhone = oUser.Phone
Dim sPhone2 : sPhone2 = oUser.Phone2
Dim sPicture : sPicture = oUser.Picture
Dim sPosition : sPosition = oUser.Position
Dim sShortName : sShortName = oUser.ShortName
Dim sSignature : sSignature = oUser.Signature
Dim sTitle : sTitle = oUser.Title
Dim sUserDefined1 : sUserDefined1 = oUser.UserDefined1
Dim sUserDefined2 : sUserDefined2 = oUser.UserDefined2
Call cRM.DialogMessageBox("Folgende Eigenschaften können für den aktuellen Benutzer abgefragt werden:" & vbCrLf &_
"Ist angemeldet: " & bIsLoggedIn & vbCrLf &_
"Login-Name: " & sLoginName & vbCrLf &_
"ID: " & sID & vbCrLf &_
"Anrede: " & sTitle & vbCrLf &_
"Name: " & sLastName & vbCrLf &_
"Vorname: " & sFirstName & vbCrLf &_
"Kurzname: " & sShortName & vbCrLf &_
"Position: " & sPosition & vbCrLf &_
"Abteilung: " & sDepartment & vbCrLf &_
"Telefon: " & sPhone & vbCrLf &_
"Telefon2: " & sPhone2 & vbCrLf &_
"Mobiltelefon: " & sMobile & vbCrLf &_
"Mobiltelefon2: " & sMobile2 & vbCrLf &_
"Telefax: " & sFax & vbCrLf &_
"E-Mail: " & sEmail & vbCrLf &_
"E-Mail2: " & sEmail2 & vbCrLf &_
"Zusatz1: " & sUserDefined1 & vbCrLf &_
"Zusatz2: " & sUserDefined2 & vbCrLf &_
"Unterschrift: " & sSignature & vbCrLf &_
"Bild: " & sPicture & vbCrLf &_
"Mitgliedschaften: " & sGroupNames & vbCrLf &_
"Ist der 'Administrator': " & bIsTheAdministrator & vbCrLf &_
"Hat administrative Rechte: " & bHasAdministratorRights, "User-Eigenschaften", vbOkOnly)
Set oUser = Nothing
C#-Script:
User user = cRM.CurrentProject.Users.CurrentUser;
bool hasAdministratorRights = user.HasAdministratorRights;
bool isLoggedIn = user.IsLoggedIn;
bool isTheAdministrator = user.IsTheAdministrator;
string department = user.Department;
string email = user.Email;
string email2 = user.Email2;
string fax = user.Fax;
string firstName = user.FirstName;
string groupNames = user.GroupNames;
string id = user.ID;
string lastName = user.LastName;
string loginName = user.LoginName;
string mobile = user.Mobile;
string mobile2 = user.Mobile2;
string phone = user.Phone;
string phone2 = user.Phone2;
string picture = user.Picture;
string position = user.Position;
string shortName = user.ShortName;
string signature = user.Signature;
string title = user.Title;
string userDefined1 = user.UserDefined1;
string userDefined2 = user.UserDefined2;
cRM.DialogMessageBox("Folgende Eigenschaften können für den aktuellen Benutzer abgefragt werden:" + System.Environment.NewLine +
"Ist angemeldet: " + isLoggedIn + System.Environment.NewLine +
"Login-Name: " + loginName + System.Environment.NewLine +
"ID: " + id + System.Environment.NewLine +
"Anrede: " + title + System.Environment.NewLine +
"Name: " + lastName + System.Environment.NewLine +
"Vorname: " + firstName + System.Environment.NewLine +
"Kurzname: " + shortName + System.Environment.NewLine +
"Position: " + position + System.Environment.NewLine +
"Abteilung: " + department + System.Environment.NewLine +
"Telefon: " + phone + System.Environment.NewLine +
"Telefon2: " + phone2 + System.Environment.NewLine +
"Mobiltelefon: " + mobile + System.Environment.NewLine +
"Mobiltelefon2: " + mobile2 + System.Environment.NewLine +
"Telefax: " + fax + System.Environment.NewLine +
"E-Mail: " + email + System.Environment.NewLine +
"E-Mail2: " + email2 + System.Environment.NewLine +
"Zusatz1: " + userDefined1 + System.Environment.NewLine +
"Zusatz2: " + userDefined2 + System.Environment.NewLine +
"Unterschrift: " + signature + System.Environment.NewLine +
"Bild: " + picture + System.Environment.NewLine +
"Mitgliedschaften: " + groupNames + System.Environment.NewLine +
"Ist der 'Administrator': " + isTheAdministrator + System.Environment.NewLine +
"Hat administrative Rechte: " + hasAdministratorRights, "User-Eigenschaften", 0);
user.Dispose();