Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Sunday, June 29, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Web Forums - SalesLogix Web Platform & Application Architect
Forum to discuss the use of the SalesLogix Web Platform, Client and Customer Portals, and the Application Architect (For version 7.2 and higher only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Platform & Application Architect | New ThreadView:  Search:  
 Author  Thread: How To Get The Current SalesLogix User
Stephen Kennedy
Posts: 37
 
How To Get The Current SalesLogix UserYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Jun 10 3:51 PM
I need to get the current user's User object. I've been reading all the threads I can find on this. Seems like I've almost got it. I don't understand why this is so hard.

I am using this code:
SLXUserService service = ApplicationContext.Current.Services.Get() as SLXUserService;
User currentUser = service.GetUser();

But I keep getting consecutive error messages about adding 2 or 3 new references. What all references are required? Security? Entities? Sage.SalesLogix? ugh.

I've also tried using the API namespace. That current user it returns cannot be converted into a normal IUser.

Is there a better/easier way that I am missing?






[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: How To Get The Current SalesLogix UserYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Jun 10 4:27 PM
Sage.SalesLogix.API.MySlx.Security.CurrentSalesLogixUser returns a Sage.SalesLogix.Security.User object. Not sure why you wouldn't be able to cast that back to the Interface.
[Reply][Quote]
Stephen Kennedy
Posts: 37
 
Re: How To Get The Current SalesLogix UserYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Jun 10 4:43 PM
That's weird. In my specific case I have a UserControl called CheckedBy. When I try to use this code:

opp.MeasurementServices.CheckedBy = (Sage.Entity.Interfaces.IUser) Sage.SalesLogix.API.MySlx.Security.CurrentSalesLogixUser;

I get these two errors:

1. The type 'Sage.SalesLogix.Security.User' is defined in an assembly that is not referenced. You must add a reference to assembly 'Sage.SalesLogix.Security...

2. Cannot convert type 'Sage.SalesLogix.Security.User' to 'Sage.Entity.Interfaces.IUser'

What am I missing?
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: How To Get The Current SalesLogix UserYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Jun 10 5:09 PM
Obviously you are missing a reference to the Sage.SalesLogix.Security.dll.

Error #2 is just a cascading error. Once you add a Reference to that DLL it will go away as well, since Sage.SalesLogix.Security.User is derived from Sage.Entity.Interfaces.IUser.

Also, keep in mind that IUser is just an interface. In this case, you are actually going to be working with a User object regardless of the fact that you are casting it to the Interface.

Now, how to add the Reference from the App Architect:
- While editing your Code Snippet, make sure that the Properties tab is visible.
- From the Properties tab, click on the Elipsis next to AssemblyReferences
- On the Dialog that Opens, click on the Add button, then set the Assembly path to "Sage.SalesLogix.Security.dll" (I believe you could leave the Hint Path blank) for this dll.

Go ahead and rebuild and retest.

[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 6/29/2025 11:55:57 PM