Change Role Centre for Web Client

thegreenleprechaun
Member Posts: 5
All,
Can we programmatically change the Role Centre of a user when he logs in from a Webclient.
A role centre for RTC and a different role centre for Web Client for the same user. We can know where user has logged in from is querying the Active Sessions table.
Client wants user to only enter their Expenses using Webclient and for everything else use RTC.
I have patrolled almost all blogs and topics on this website but no concrete solution without having to restart the application.
Anythingg else that the learned people around here can share.
Thanks
Can we programmatically change the Role Centre of a user when he logs in from a Webclient.
A role centre for RTC and a different role centre for Web Client for the same user. We can know where user has logged in from is querying the Active Sessions table.
Client wants user to only enter their Expenses using Webclient and for everything else use RTC.
I have patrolled almost all blogs and topics on this website but no concrete solution without having to restart the application.
Anythingg else that the learned people around here can share.
Thanks
0
Comments
-
You could change the Profile ID on User Personalization during login depending on the Client Type in Active Session. When user log in on web you set Profile ID to the WebProfile else you set Profile ID to the users default profile.
/Juha0 -
Tried that already before I posted the query.
On Application Management , DefaultRoleCentreID get a called only if there is no default role centre assigned.
Next I tried the LoginManagement Codeunit, because surely this codeunit needs to be called to login, where it checks if Profile.Is Empty I wrote code to change the role centre ID but by the time application application loads it has grabbed the Role Centre id already. However, if I close and restart the browser it now takes the correct role centre.
Hence my original question, a solution where I won't have to restart the application.
Thanks0 -
The role center is determined by the Profile ID in User Personalization, so changing the Profile ID in LoginManagement LogInStart works.
It will however mess up your User Personalization table, as Profile ID will show the profile used at last login. You can add a new field “Default Profile ID” to User Personalization and show the new field in the user personalization pages and remove the standard Profile ID field.
Create a function ChangeProfileID like this:
ActiveSession.GET(SERVICEINSTANCEID,SESSIONID);
UserPersonalization.GET(ActiveSession."User SID");
IF ActiveSession."Client Type" = ActiveSession."Client Type"::"Web Client" THEN
UserPersonalization."Profile ID" := 'WEB' <- REPLACE WITH THE PROFILE FOR WEB
ELSE
UserPersonalization."Profile ID" := UserPersonalization."Default Profile ID ;
UserPersonalization.MODIFY;
And call it in start of LogInStart. You will now use the profile WEB when logging in with web client and the default profile with other clients. No restart needed.
/Juha0 -
Thanks Juha,
Let me explain with screen shots what i meant by restarting the application. Please see attached screenshot.
Areas in Red - Description of the Role Centre Page
Areas in Green - Action Items for the Role Centre.
Step 1. - Change the code. View variables, everything is perfect. Role Centre when coming from Web is set ot Expense. As expected, Fantastic.
Step 2.- Open browser. try the webclient. It opens the Expense Role Centre which is NOT the default role centre on User Personalization. Fantastic, Code change worked.
Step 3. Open RTC to check which role centre it picks up, should not be EXPENSE but the default one. Now, we have a problem, Even though the Description says "Lease Mgmt." the Action items are from the Expense Role Centre.
Step 4- Close RTC and Open it again. Restarting the RTC application - This time it gets the right Role Centre and the Correct Action Items on the left.
Everytime henceforth it opens the RTC fine but for the first time even though it gets the Default Role centre right it gets the action items from the Web Role centre.
Somewhere it doesn't refresh completely on its own but restarting the RTC fixes it.
Thanks0 -
Hmm.. I didn't notice that the action items wasn't correct, sorry.
Strange that the RTC loads the action items before knowing the profile. If you don't have any profiles in the database they will be inserted in LogInStart.
I have tried to delete all profiles, and when I start RTC it open the correct role center with correct action items.
So I guess it's not possible to do what you want.
/Juha0 -
I thought so, just wanted to get an opinion here before i gave up.
I have raised it with Microsoft using our Advisory Hours and hoping to hear from them by next week. I will update the post here if they come up with a "Solution"
The fact that, as you said, that RTC loads the action items before knowing the profile seems very odd. There is no concept of STX file anymore so i can't say that it took it from there, There is User Metadata table but that is user personalization only, so i don't know where does it get the action items from a different profile.
I will update if i hear anything from MS.
Thanks for your time.0 -
It seems that the only way to accomplish this is Dynamics NAV 2015 Web Client, using the Profile URL Parameter to specify the Profile to use. Changing this on-the-fly in CU1 is not working, as some Settings are already done when launching CompanyOpen().
Check out the following page: How to: Open the Microsoft Dynamics NAV Web Client.Cheers
Carsten
==> How To Ask Questions The Smart Way
This post is my own opinion and does not necessarily reflect the opinion or view of my employer.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 322 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions