Page 1 of 1

Setting Default Profiles

Posted: Mon Jan 06, 2014 6:47 pm
by tlyde_LCTMHS
I am trying to upload scanned documents to various orders. I have a login that has multiple profiles but no default selected. My code is:

SelectServer sps;
sps = new SelectServer(null, new Uri(@"http://SELECT-MID:8080/")); // leave off credentials if using windows login
OrderTracking ot = sps.GetService<OrderTracking>();


The error that I get is:

You have to have a profile selected to login.
at SoftPro.Select.Client.Internal.SecurityProvider.SetCurrentUserState(ChooseProfileCallback chooseProfile)
at SoftPro.Select.Client.SelectServer.InitLegacySupport()
at SoftPro.Select.Client.SelectServer._server_Authenticated(Object sender, EventArgs args)
at SoftPro.ClientModel.Server.EnsureAuthenticated()
at SoftPro.ClientModel.Server.GetService(Type serviceType, Boolean ensureAuthenticated)
at SoftPro.ClientModel.Server.GetService[T]()
at SoftPro.Select.Client.SelectServer.GetService[T]()

I've seen this question asked so I know there is no way to go thru the API but I haven't seen what the recommended solution is. I am planning on going directly into the database and setting the default profile to whichever ProfileID I need to be at that time. Is there a better way to handle this??

Thanks

Re: Setting Default Profiles

Posted: Tue Jan 07, 2014 9:35 am
by john.morton
Assuming that you're writing this against the 2.6 version of the API (Boylan), our recommendation is to have multiple users to represent the different profiles you might need to access to. As you saw, it's purely based off their default profile, so you can have those different users setup with the appropriate default profiles, and then log off (dispose of your SelectServer) and log back in with a different user as needed.