Modify standard Role Center management in NAV 2017
gianp
Member Posts: 36
Hi All.
In NAV 2016 I have customized the standard management of Role Center; In Codeunit 1 I changed function DefaultRoleCenter to get a different DefaultRoleCenterID depending of User or Company. In NAV 2016 this work fine. I porting the same code in NAV 2017 but not work! The custom code not have any effect.
Someone have any idea on what cause this?
Thank's so much.
Gianp.
In NAV 2016 I have customized the standard management of Role Center; In Codeunit 1 I changed function DefaultRoleCenter to get a different DefaultRoleCenterID depending of User or Company. In NAV 2016 this work fine. I porting the same code in NAV 2017 but not work! The custom code not have any effect.
Someone have any idea on what cause this?
Thank's so much.
Gianp.
0
Comments
-
can you share the code you used?0
-
Buttom the customized DefaultRoleCenter function that work fine in NAV 2016.
DefaultRoleCenter() : Integer
{ commented standard code - start
DefaultRoleCenterID := ConfPersMgt.DefaultRoleCenterID;
OnAfterGetDefaultRoleCenter(DefaultRoleCenterID);
EXIT(DefaultRoleCenterID);
commented standard code - stop }
// custom code - start
User.RESET;
User.SETRANGE(User."User Name",USERID);
IF User.FINDFIRST THEN BEGIN
IF COMPANYNAME = 'MASTER' THEN BEGIN
DefaultRoleCenterID := 50039;
OnAfterGetDefaultRoleCenter(DefaultRoleCenterID);
EXIT(DefaultRoleCenterID);
END ELSE BEGIN
AgicUserPersonalizzation.RESET;
AgicUserPersonalizzation.SETRANGE(AgicUserPersonalizzation."User SID",User."User Security ID");
IF AgicUserPersonalizzation.FINDFIRST THEN BEGIN
Profile.GET(AgicUserPersonalizzation."Profile ID");
DefaultRoleCenterID := Profile."Role Center ID";
OnAfterGetDefaultRoleCenter(DefaultRoleCenterID);
EXIT(DefaultRoleCenterID);
END;
END;
END;
// custom code - stop
0 -
1. I would subscribe to the OnAfterGetDefaultRoleCenter(DefaultRoleCenterID) function.
2. Did you use the debugger to step into the code. The code is only triggered if the User.findfirst is a success.
3. Which one doesnt work? Master or the other one?0 -
1. I would subscribe to the OnAfterGetDefaultRoleCenter(DefaultRoleCenterID) function.
-- > I dont understand that you are telling me.
2. Did you use the debugger to step into the code. The code is only triggered if the User.findfirst is a success.
--> Yes I debugger right
3. Which one doesnt work? Master or the other one?
--> The role center that system load is standard Default Role Center and not the Role Center in the customized code. The code are not effect: its like the customization are not present...0 -
https://www.youtube.com/watch?v=zQHVv7PV8u8 see this for eventing. 0 -
Thaks for video, I will see it asap. Only one consedation: I have no problem whit NAV 2016... the problems are on NAV 2017!0
-
codeunit 1 is sinlge instance. restart nav server.0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
