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.
0
Comments
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
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?
-- > 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...