web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Cannot verify AAD Registration in BC 24.

(2) ShareShare
ReportReport
Posted on by 56
We are currently upgrading from BC 22 to BC24 On Prem. We send notifications based on current user (in Email Accounts). In BC 24, it is not recognizing the Current User. When we add client id and secret in "Email Microsoft Entra application registration" and click "verify registration", we get an error.

 
 
When I check "Email Accounts", it does not recognize the my email address as shown below.
 

Steps to Troubleshoot
Identify the Uninitialized Variable:
The error suggests that the LastErrorMessage property of the ALAzureAdCodeGrantFlow class is being accessed, but the object has not been properly instantiated.
Check the code where the ALAzureAdCodeGrantFlow object is being used, and ensure that it is initialized correctly before any properties or methods are accessed.
 
this is the full error when I try to verify the app connection:
 
If requesting support, please provide the following details to help troubleshooting:
 
Error message: 
A DotNet variable has not been instantiated. Attempting to call Microsoft.Dynamics.Nav.Runtime.ALAzureAdCodeGrantFlow.LastErrorMessage in CodeUnit OAuth2Impl: GetLastErrorMessage
 
Internal session ID: 
94928f7a-3439-4dd3-bcfe-76cf7afe30db
 
Application Insights session ID: 
63cf8e26-1a06-4269-b683-99d2a864fb94
 
Client activity id: 
81c14eee-265b-92d1-2f5b-41352916bb62
 
Time stamp on error: 
2024-09-10T13:44:58.0500678Z
 
User telemetry id: 
4058806c-8d00-43e3-970f-ecda6f4d1bf5
 
AL call stack: 
OAuth2Impl(CodeUnit 502).GetLastErrorMessage line 2 - System Application by Microsoft
OAuth2(CodeUnit 501).GetLastErrorMessage line 2 - System Application by Microsoft
"Email - OAuth Client"(CodeUnit 4507).GetLastAuthorizationErrorMessage line 2 - Email - Outlook REST API by Microsoft
"Email - Outlook API Setup"(Page 4509).TestSetup line 6 - Email - Outlook REST API by Microsoft
"Email - Outlook API Setup"(Page 4509)."TestSetupAction - OnAction"(Trigger) line 2 - Email - Outlook REST API by Microsoft
 
 
I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    95,718 Super User 2025 Season 2 on at
    Hi, It seems to be a setting problem. I hope the following information can give you some hints.
     
    And if this is a standard environment, you can submit a SR to Microsoft to ask them to help investigate.
     
    Hopefully other experts can give you better advice.
     
    Thanks
    ZHU
  • Ganesh2002 Profile Picture
    56 on at
    @Yun Zhu, we have already setup the AAD registration. It works in BC22. It is not working in BC 24. Do we have any server settings in BC24?  

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,664

#2
YUN ZHU Profile Picture

YUN ZHU 960 Super User 2025 Season 2

#3
Jainam M. Kothari Profile Picture

Jainam M. Kothari 773 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans