{"title":"Codeunit 9018 Azure AD Plan Impl., extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/9018-azure-ad-plan-impl/points/","author":"JOP-AL","license":"Metadata from Microsoft's symbol packages. AL source MIT, Copyright (c) Microsoft Corporation. Selection and wording © 2026 JOP-AL. https://jonas-paprotka.de/licenses/","subject":"Microsoft Dynamics 365 Business Central","checked":"2026-11-20","changed":"2026-10-05","object":{"type":"codeunit","id":9018,"name":"Azure AD Plan Impl.","app":"System Application","url":"https://jonas-paprotka.de/ref/codeunit/9018-azure-ad-plan-impl/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/9018-azure-ad-plan-impl/source/","path":"src/System Application/App/Azure AD Plan/src/AzureADPlanImpl.Codeunit.al","commit":"4303e5e584d3aa5d9e98cbc615525a5396ad6ed7","lines":"a line is <source url>#L<line>"},"steps":{"event":"[line, \"event\", name, handled]: raises an event of this object; handled 1 when it has an IsHandled parameter","call":"[line, \"call\", name, arguments]: calls a procedure of this object","ext":"[line, \"ext\", type, id, name, arguments]: calls a procedure of another object, through a variable declared with that type","write":"[line, \"write\", table id, method, 1 when called with true]: Insert, Modify, ModifyAll, Delete, DeleteAll or Rename","validate":"[line, \"validate\", table id, field name]","run":"[line, \"run\", type, id]: Codeunit.Run, Page.Run, Report.Run and their kin"},"objects":{"codeunit:9026":{"name":"User Login Time Tracker","url":"https://jonas-paprotka.de/ref/codeunit/9026-user-login-time-tracker/"},"codeunit:9024":{"name":"Azure AD Graph User","url":"https://jonas-paprotka.de/ref/codeunit/9024-azure-ad-graph-user/"},"codeunit:9843":{"name":"User Selection","url":"https://jonas-paprotka.de/ref/codeunit/9843-user-selection/"},"codeunit:9027":{"name":"Plan Ids","url":"https://jonas-paprotka.de/ref/codeunit/9027-plan-ids/"},"codeunit:457":{"name":"Environment Information","url":"https://jonas-paprotka.de/ref/codeunit/457-environment-information/"},"codeunit:9012":{"name":"Azure AD Graph","url":"https://jonas-paprotka.de/ref/codeunit/9012-azure-ad-graph/"},"table:9005":{"name":"User Plan","url":"https://jonas-paprotka.de/ref/table/9005-user-plan/"},"codeunit:9825":{"name":"Plan Configuration","url":"https://jonas-paprotka.de/ref/codeunit/9825-plan-configuration/"},"table:9004":{"name":"Plan","url":"https://jonas-paprotka.de/ref/table/9004-plan/"},"codeunit:9016":{"name":"Azure AD Plan","url":"https://jonas-paprotka.de/ref/codeunit/9016-azure-ad-plan/"},"codeunit:9822":{"name":"Plan Configuration Impl.","url":"https://jonas-paprotka.de/ref/codeunit/9822-plan-configuration-impl/"},"codeunit:152":{"name":"User Permissions","url":"https://jonas-paprotka.de/ref/codeunit/152-user-permissions/"},"table:2000000073":{"name":"User Personalization","url":"https://jonas-paprotka.de/ref/table/2000000073-user-personalization/"}},"procs":[{"name":"IsGraphUserEntitledFromServicePlan","line":91,"kind":"procedure","params":1,"steps":[[100,"call","IsBCServicePlan",1],[104,"call","IsDeviceRole",1]]},{"name":"UpdateUserPlans","line":111,"kind":"procedure","params":4,"steps":[[117,"call","GetGraphUserPlans",2],[121,"ext","codeunit",9026,"UserLoggedInEnvironment",1],[124,"call","RemoveUnassignedUserPlans",3],[127,"call","AddNewlyAssignedUserPlans",4]]},{"name":"UpdateUserPlans","line":131,"kind":"procedure","params":4,"steps":[[136,"ext","codeunit",9024,"GetGraphUser",3],[140,"call","RemoveUnassignedUserPlans",3]]},{"name":"UpdateUserPlans","line":144,"kind":"procedure","params":0,"steps":[[149,"ext","codeunit",9843,"FilterSystemUserAndAADGroupUsers",1]]},{"name":"RefreshUserPlanAssignments","line":161,"kind":"procedure","params":1,"steps":[[171,"ext","codeunit",9024,"GetGraphUser",2],[180,"call","IsDeviceRole",1],[183,"call","UpdateUserFromAzureGraph",2],[184,"call","UpdateUserPlans",4]]},{"name":"TryGetAzureUserPlanRoleCenterId","line":189,"kind":"procedure","params":2,"steps":[[191,"call","GetAzureUserPlanRoleCenterId",1]]},{"name":"GetUserPlanExperience","line":249,"kind":"procedure","params":0,"steps":[[254,"call","UserHasPlan",2],[254,"ext","codeunit",9027,"GetPremiumPlanId",0],[257,"call","UserHasPlan",2],[257,"ext","codeunit",9027,"GetEssentialPlanId",0],[260,"call","UserHasPlan",2],[260,"ext","codeunit",9027,"GetBasicPlanId",0]]},{"name":"CheckMixedPlansExist","line":273,"kind":"procedure","params":1,"steps":[[275,"call","ShouldCheckMixedPlans",0],[278,"call","MixedPlansExist",1]]},{"name":"MixedPlansExist","line":288,"kind":"procedure","params":1,"steps":[[311,"ext","codeunit",9024,"TryGetUserAuthenticationObjectId",2],[326,"call","PlansExist",4],[326,"ext","codeunit",9027,"GetBasicPlanId",0],[327,"call","PlansExist",4],[327,"ext","codeunit",9027,"GetEssentialPlanId",0],[328,"call","PlansExist",4],[328,"ext","codeunit",9027,"GetPremiumPlanId",0],[333,"call","GetAuthenticationEmailFromAuthenticationObjectID",1],[334,"call","GetAuthenticationEmailFromAuthenticationObjectID",1]]},{"name":"ShouldCheckMixedPlans","line":342,"kind":"procedure","access":"local","params":0,"steps":[[347,"ext","codeunit",457,"IsSaaS",0],[357,"call","DoPlansExist",0],[360,"call","DoUserPlansExist",0]]},{"name":"GetAuthenticationEmailFromAuthenticationObjectID","line":367,"kind":"procedure","access":"local","params":1,"steps":[[372,"ext","codeunit",9024,"GetUser",2],[375,"ext","codeunit",9012,"GetUserByObjectId",2],[376,"ext","codeunit",9024,"GetAuthenticationEmail",1]]},{"name":"GetPlanName","line":381,"kind":"procedure","access":"local","params":1,"steps":[[386,"ext","codeunit",9027,"GetBasicPlanId",0],[388,"ext","codeunit",9027,"GetEssentialPlanId",0],[390,"ext","codeunit",9027,"GetPremiumPlanId",0]]},{"name":"PlansExist","line":405,"kind":"procedure","access":"local","params":4,"steps":[[415,"call","GetPlanName",1]]},{"name":"RemoveUnassignedUserPlans","line":427,"kind":"procedure","access":"local","params":3,"steps":[[443,"write",9005,"Insert"],[452,"write",9005,"DeleteAll"],[462,"write",9005,"Delete"],[464,"ext","codeunit",9825,"IsCustomized",1],[466,"ext","codeunit",9825,"RemoveCustomPermissionsFromUser",2],[468,"ext","codeunit",9825,"RemoveDefaultPermissionsFromUser",2]]},{"name":"GetGraphUserPlans","line":477,"kind":"procedure","access":"local","params":2,"steps":[[489,"write",9004,"DeleteAll"],[492,"ext","codeunit",9012,"IsEnvironmentSecurityGroupDefined",0],[493,"ext","codeunit",9012,"IsMemberOfGroupWithId",2],[493,"ext","codeunit",9012,"GetEnvironmentSecurityGroupId",0],[494,"call","IsInternalAdmin",1],[505,"call","IsBCServicePlan",1],[506,"call","AddToTempPlan",3],[517,"call","IsBCServicePlan",1],[518,"call","AddToTempPlan",3],[523,"call","IsDeviceRole",1],[525,"ext","codeunit",9027,"GetGlobalAdminPlanId",0],[525,"ext","codeunit",9027,"GetD365AdminPlanId",0],[525,"ext","codeunit",9027,"GetBCAdminPlanId",0],[525,"ext","codeunit",9027,"GetMicrosoft365PlanId",0],[530,"write",9004,"DeleteAll"],[532,"call","GetDevicesPlanInfo",2],[534,"call","AddToTempPlan",3]]},{"name":"IsDeviceRole","line":546,"kind":"procedure","access":"local","params":1,"steps":[[548,"ext","codeunit",9012,"IsGroupMember",2]]},{"name":"IsInternalAdmin","line":552,"kind":"procedure","access":"local","params":1,"steps":[[561,"ext","codeunit",9027,"GetGlobalAdminPlanId",0],[561,"ext","codeunit",9027,"GetD365AdminPlanId",0],[561,"ext","codeunit",9027,"GetBCAdminPlanId",0]]},{"name":"GetDevicesPlanInfo","line":569,"kind":"procedure","access":"local","params":2,"steps":[[574,"ext","codeunit",9027,"GetDevicePlanId",0],[575,"ext","codeunit",9027,"GetDevicePlanId",0]]},{"name":"InsertFromTempPlan","line":580,"kind":"procedure","access":"local","params":1,"steps":[[586,"write",9004,"Insert"]]},{"name":"UpdateUserFromAzureGraph","line":591,"kind":"procedure","access":"local","params":2,"steps":[[595,"ext","codeunit",9024,"GetGraphUser",2],[596,"ext","codeunit",9024,"UpdateUserFromAzureGraph",2]]},{"name":"IsBCServicePlan","line":601,"kind":"procedure","params":1,"steps":[[608,"event","OnBeforeIsBcServicePlan",0],[616,"ext","codeunit",9027,"GetMicrosoft365PlanId",0],[620,"ext","codeunit",9012,"IsM365CollaborationEnabled",0]]},{"name":"GetAzureUserPlanRoleCenterId","line":624,"kind":"procedure","access":"local","params":1,"steps":[[635,"ext","codeunit",9024,"GetGraphUser",2],[640,"call","GetGraphUserPlans",2]]},{"name":"AssignPlanToUserWithDelegatedRole","line":657,"kind":"procedure","params":2,"steps":[[669,"ext","codeunit",9024,"IsUserDelegatedAdmin",0],[670,"ext","codeunit",9027,"GetDelegatedAdminPlanId",0],[671,"ext","codeunit",9024,"IsUserDelegatedHelpdesk",0],[672,"ext","codeunit",9027,"GetHelpDeskPlanId",0],[680,"call","IsPlanAssignedToUser",2],[686,"call","DoesUserHavePlans",1],[690,"write",9005,"DeleteAll"],[696,"write",9005,"Insert"],[709,"ext","codeunit",9016,"OnUpdateUserAccessForSaaS",2],[713,"ext","codeunit",9822,"IsCustomized",1],[713,"ext","codeunit",9822,"ConfigurationContainsSuper",1],[715,"ext","codeunit",152,"RemoveSuperPermissions",1]]},{"name":"AddNewlyAssignedUserPlans","line":722,"kind":"procedure","access":"local","params":4,"steps":[[741,"call","InsertFromTempPlan",1],[745,"write",9005,"Insert"],[749,"ext","codeunit",9016,"OnUpdateUserAccessForSaaS",2],[751,"ext","codeunit",9822,"ConfigurationContainsSuper",1],[752,"ext","codeunit",9822,"IsCustomized",1],[764,"write",2000000073,"Modify"],[773,"call","IsUserInternalAdmin",1],[775,"call","IsUserAdmin",1],[778,"ext","codeunit",152,"RemoveSuperPermissions",1]]},{"name":"AddToTempPlan","line":786,"kind":"procedure","access":"local","params":3,"steps":[[799,"event","OnInitializeRoleCenter",0],[802,"write",9004,"Insert"]]},{"name":"IsUserAdmin","line":807,"kind":"procedure","access":"local","params":1,"steps":[[814,"call","IsPlanAssignedToUser",2],[814,"ext","codeunit",9027,"GetGlobalAdminPlanId",0],[815,"call","IsPlanAssignedToUser",2],[815,"ext","codeunit",9027,"GetDelegatedAdminPlanId",0],[816,"call","IsPlanAssignedToUser",2],[816,"ext","codeunit",9027,"GetD365AdminPlanId",0]]},{"name":"IsUserInternalAdmin","line":820,"kind":"procedure","access":"local","params":1,"steps":[[827,"call","IsPlanAssignedToUser",2],[827,"ext","codeunit",9027,"GetGlobalAdminPlanId",0],[828,"call","IsPlanAssignedToUser",2],[828,"ext","codeunit",9027,"GetD365AdminPlanId",0],[829,"call","IsPlanAssignedToUser",2],[829,"ext","codeunit",9027,"GetBCAdminPlanId",0]]},{"name":"GetPlanIDs","line":833,"kind":"procedure","params":2,"steps":[[838,"call","GetGraphUserPlans",2]]},{"name":"GetPlanNames","line":846,"kind":"procedure","params":2,"steps":[[852,"call","GetGraphUserPlans",2]]},{"name":"CheckIfPlansDifferent","line":882,"kind":"procedure","params":2,"steps":[[892,"call","GetGraphUserPlans",2]]},{"name":"OnAfterDeleteUser","line":913,"kind":"procedure","access":"local","params":2,"steps":[[921,"write",9005,"DeleteAll"]]}]}