
Checking to see if the current user is on the same team as an account’s account manager is an easy task. Luckily, the User entity has a built-in business rule called GetUserTeamMembers which returns a list of OwnerJoin entities. For these OwnerJoin entries, the Child property will contain the Owner entity for each team member for the user. You can check if the current user is on the same team as the account manager using the following code:
var account = this.BindingSource.Current as Sage.Entity.Interfaces.IAccount; var currentUser = Sage.SalesLogix.API.MySlx.Security.CurrentSalesLogixUser; // get account manager's team members var teamMembers = account.AccountManager.GetUserTeamMembers(); // now check if current user is on account manager's team if (teamMembers.FirstOrDefault(x => x.Child.Id == currentUser.DefaultOwner.Id) != null) { // current user is on same team as account manager }
Note, the code uses FirstOrDefault so if this is in a business rule (or anything other than a C# Snippet Action) you’ll need to add using System.Linq to your using directives.
Subscribe To Our Newsletter
Join our mailing list to receive the latest Infor CRM (Saleslogix) and Creatio (bpm'online) news and product updates!
You have Successfully Subscribed!