Determining if a User is a Member of a Team in Infor CRM Web Part 2

Back in 2009, Ryan wrote about how to determine if a user is in a team. His last code snippet example is no longer valid as those methods now return different object types. His old code was this:

Sage.SalesLogix.Security.SLXUserService usersvc = (Sage.SalesLogix.Security.SLXUserService)Sage.Platform.Application.ApplicationContext.Current.Services.Get<Sage.Platform.Security.IUserService>();
Sage.SalesLogix.Security.User user = usersvc.GetUser();
 
System.Collections.Generic.IList<Sage.SalesLogix.Security.Owner> teamlist = Sage.SalesLogix.Security.Owner.GetTeamsByUser(user);
 
string list = string.Empty;
foreach (Sage.SalesLogix.Security.Owner team in teamlist)
{
    list += team.OwnerDescription + "rn";
}
QFTextBox.Text = list;

The new code should be this:

    System.Collections.Generic.IList<Sage.Entity.Interfaces.IOwner> teamlist = Sage.SalesLogix.Security.Owner.GetTeamsByUser(Sage.SalesLogix.API.MySlx.Security.CurrentSalesLogixUser);
 
    string list = string.Empty;
    foreach (Sage.Entity.Interfaces.IOwner team in teamlist)
    {
        list += team.OwnerDescription + "rn";
    }
    QFTextBox.Text = list;
ABOUT THE AUTHOR

Kris Halsrud

Kris Halsrud is a Senior Analyst / Developer for Customer FX Corporation.

Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter

Join our mailing list to receive the latest Infor CRM (Saleslogix) news and product updates!

You have Successfully Subscribed!