
06-28-2010 01:53 PM
I need to get the current user's User object. 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?
06-28-2010 01:57 PM
Give this a shot ![]()
http://sites.google.com/site/genesprojects/code/ge
06-28-2010 02:07 PM
Thanks for the quick reply..
Sage.SalesLogix.Security is not showing up in Intellisense. I imagine it's not a valid namespace.
If I add a reference to it (Sage.SalesLogix.Security.dll), I get into a cascading effect of needing to add multiple other references. Does that seem right?
Thanks.
06-29-2010 08:50 AM
06-29-2011 11:13 AM
<rant>
This is just another example of not enough design being replaced by way too much C# .net code.......why don't we simply write this out in Assembly language and be done with it?
Could someone please explain to me why SLX couldn't have a simple statement like the following:
string MyCurrentUserID = Sage.SalesLogix.GetInfo.CurrentUserID;
As a developer, I don't wan't tohave to worry about boxing, nulls, structs, inheritance, etc. just to cough up the logged in user's char 12 USERID. You can have all the happy code layers, methods, interfaces, classes, Lists, running behind the scenes to your non 4GL, non Visual coding content .....
Now that we have the userId, I need to see if they're in a Team.....
Sometimes less is more.......
</rant>
07-26-2011 04:28 PM
You mean like
BusinessRuleHelper.GetCurrentUser().Id.ToString()
Enjoy
Chris
02-16-2012 09:43 AM
When I attempt to add Sage.SalesLogix.BusinessRules.dll in the AssemblyReference Collection Editor I get an error:
Could not load exported type data for assembly 'Sage.SalesLogix.BusinessRules, Version=7.5.4.7097, Culture=neutral, PublicKeyToken=null' and type 'Sage.SalesLogix.Account.Rules'. (ActiproSoftware.SyntaxEditor.Addons.DotNet.Net20)
Could not load file or assembly 'Sage.SalesLogix.Services.PotentialMatch, Version=7.5.4.7097, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. (mscorlib)
Am I missing dll's?