Infor CRM (Formerly Saleslogix) Getting the Current User and Contact Context in the Web Custom Portal

Ryan Farley previously posted about how to get the current Contact context in the Customer Web Portal.  This same approach can be used to determine the Saleslogix User context that the Customer Portal is running under. 

Expanding on Ryan’s initial post by calling a different service, like so:

Sage.SalesLogix.Security.IWebPortalUserService service = Sage.Platform.Application.ApplicationContext.Current.Services.Get<Sage.Platform.Security.IUserService>() as Sage.SalesLogix.Security.IWebPortalUserService;
            if (service != null)
            {
            Sage.Entity.Interfaces.IContact con = service.GetPortalUser().Contact;
            string contactID = con.Id.ToString();           
            }

Sage.SalesLogix.Security.IWebPortalUserService service2 = Sage.Platform.Application.ApplicationContext.Current.Services.Get<Sage.Platform.Security.IUserService>() as Sage.SalesLogix.Security.IWebPortalUserService;
            if (service2 != null)
            {
            Sage.Entity.Interfaces.IUser usr = service2.GetUser() as Sage.Entity.Interfaces.IUser;
                string userID = usr.Id.ToString();
            }

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!