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
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/
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?