microsoft / microsoft/BCApps

[Bug]: Several functions in codeunit 9010 "Azure AD User Management" do not return a value

Open Beginner friendly
#10,664 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Team: Integrations
Dominant language
AL
Stars
683
Forks
459
Avg merge
3d 26m
Merged PRs (30d)
633

Description

Describe the issue

See codeunit 9010 "Azure AD User Management" in BC29 preview

For example, this is a correct function:
[NonDebuggable]
procedure IsUserTenantAdmin(): Boolean
begin
exit(AzureADUserMgmtImpl.IsUserTenantAdmin());
end;

because the return value from the Implementation is passed on to a call to this function.

However, this is wrong for several other functions in this codeunit:

_[NonDebuggable]
procedure CreateNewUserFromGraphUser(GraphUserInfo: DotNet UserInfo)
begin
    AzureADUserMgmtImpl.CreateNewUserFromGraphUser(GraphUserInfo);
end;_

and

_[NonDebuggable]
procedure SynchronizeAllLicensedUsersFromDirectory()
begin
    AzureADUserMgmtImpl.SynchronizeAllLicensedUsersFromDirectory();
end;_

do NOT pass the return value from the Implementation function to another call. So, it is not possible to check whether the function was executed correctly.

Expected behavior

Change
AzureADUserMgmtImpl.CreateNewUserFromGraphUser(GraphUserInfo);
into
Exit(AzureADUserMgmtImpl.CreateNewUserFromGraphUser(GraphUserInfo));

and
AzureADUserMgmtImpl.SynchronizeAllLicensedUsersFromDirectory();
into
Exit(AzureADUserMgmtImpl.SynchronizeAllLicensedUsersFromDirectory();)

Steps to reproduce

/

Additional context

No response

I will provide a fix for a bug
  • I will provide a fix for a bug

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in codeunit 9010 "Azure AD User Management" and compare each wrapper with its corresponding AzureADUserMgmtImpl function, beginning with CreateNewUserFromGraphUser and SynchronizeAllLicensedUsersFromDirectory. Confirm which functions return values, ensure the wrappers expose those results consistently, and verify the codeunit compiles and its existing checks pass.

Written by the indexing model from the issue text.

Assessment

Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.