Determining if a user is on a Team or Department in the Infor CRM Web Client

I thought I would show a way you can check to see if a user is in a specific Team or Department. While there are other ways of accomplishing this also, this is a pretty easy way to check. This may not be the most efficient way of doing it, especially if your teams and departments contain lots of users.

Both of these snippets are similar, just checking the Owner.Type differently for each.

Department:

    Sage.Entity.Interfaces.IOwner ownr = Sage.SalesLogix.Security.Owner.GetByOwnerDescription("Accounting");
    foreach (Sage.Entity.Interfaces.IOwnerRights right in ownr.Rights)
    {
        if (right.User == Sage.SalesLogix.API.MySlx.Security.CurrentSalesLogixUser && right.Owner.Type == Sage.Entity.Interfaces.OwnerType.Department)
        {
            accountingUser = true;
            break;
        }
    }

Teams:

	System.Collections.Generic.IList<Sage.Entity.Interfaces.IOwner> teamlist = Sage.SalesLogix.Security.Owner.GetTeamsByUser(Sage.SalesLogix.API.MySlx.Security.CurrentSalesLogixUser);
	foreach (Sage.Entity.Interfaces.IOwner team in teamlist)
	{
		if (team.Type==Sage.Entity.Interfaces.OwnerType.Department && team.OwnerDescription.ToLower().Contains("accounting")) 
		{
			accountingUser = true;
			break;
		}
	}
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!