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

How to Approve Timesheet via OData API when Request is Made by Azure App Registration?

(6) ShareShare
ReportReport
Posted on by 32

Hello Community,

 

I'm building a backend integration for Business Central using a registered Azure App (via Entra ID) and calling custom OData API pages. Specifically, I have a service-enabled procedure ApproveTimesheet exposed via an API page.

 

I am able to create and submit the Timesheet Header, Lines, and Details using the OData service.

 

Now, I want to approve and reject those lines through the same API.

 

My custom API page calls the Time Sheet Management codeunit internally. However, this codeunit further calls various procedures required for approval.



The issue is that UserId refers to the identity of the Azure App Registration, which does not exist in the User Setup table — and cannot be added via the UI.

 

My question is:

 

Is there a supported way to bypass this check for App-based requests or to delegate the operation as a valid user?

 

Any guidance on best practices for handling such scenarios with Azure App-based OData access would be greatly appreciated.

I have the same question (0)
  • YUN ZHU Profile Picture
    95,729 Super User 2025 Season 2 on at
    As far as I know, there is no way. You authenticate with the app, and the executing user is the user associated with the app, and it cannot be associated with a specific user.
    However, you can try Power Automate, which can get the current approved user.
    Hope the following can give you some hints.
     
    Thanks.
    ZHU
  • Suggested answer
    Sohail Ahmed Profile Picture
    11,148 Super User 2025 Season 2 on at
    Since Azure App users don’t exist in User Setup, the approval fails. You can solve this by impersonating a valid user in AL or triggering approval through a job queue or service account. Best practice is to assign the App Registration a valid BC user context.
     
    ✅ Mark this answer as verified if it helps you

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,362

#2
YUN ZHU Profile Picture

YUN ZHU 867 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 607

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans