Options

How to determine the ACTIVE Profile?

bvbeekbvbeek Member Posts: 32
edited 2015-04-17 in NAV Three Tier
Hi everybody!

In the User Personalization you can set the Profile per user, in my case I select the BOOKKEEPER profile.
When I start the Windows Client I got the profile Bookkeeper.

But... if I run the Windows Client from the command line with the parameter:
....exe -profile "Order Processor"
I got the profile Order Processor.

In this case, I want to know the ACTIVE profile in code.

Looking for something like this:
CASE CurrentProfile(UserID) OF
  'BOOKKEEPER':
    <code>
  'ORDER PROCESSOR':
    <code>
  ETC.
END;

Do you have a tip or suggestion? Please let me know!

Thank you for your time to read this!
Yours,
Bart van Beek
Boltrics Professionals B.V. | www.boltrics.nl
Nekovri Dynamics | 3PL Dynamics

Comments

  • Options
    Jan_VeenendaalJan_Veenendaal Member Posts: 206
    Hi Bart,

    I think you will need something like Arend-Jan Kauffmann describes in his blog: http://kauffmann.nl/index.php/2015/04/07/read-server-settings-from-cal-code/
    Jan Veenendaal
  • Options
    ShedmanShedman Member Posts: 194
    That looks promising indeed :)

    I have found the 'Microsoft.Dynamics.Nav.Types.UserSettings', which indeed contain a property 'ProfileName'. The only thing is that I don't know how to get the UserSettings of the current session in this variable. The class only provides a constructor, but that means that I create a new (and empty) version of it. Getting the ProfileName from that of course returns an empty string...

    I've reviewed all the .NET types under the assembly, but have not been able to find the one that does the trick. Maybe someone does?
Sign In or Register to comment.