Skip to content

Uptake/approval apis#29778

Open
BenPlunk wants to merge 5 commits intomicrosoft:mainfrom
BenPlunk:uptake/approval-apis
Open

Uptake/approval apis#29778
BenPlunk wants to merge 5 commits intomicrosoft:mainfrom
BenPlunk:uptake/approval-apis

Conversation

@BenPlunk
Copy link

@BenPlunk BenPlunk commented Mar 3, 2026

Summary

Added the following APIs:

Read-only API that allows to query Workflow
Read-only API that allows to query (Workflow, User) mappings
Read-only API that allows to query (Workflow, User, action) history

Depends on Objects in Base App PR https://github.com/microsoft/BusinessCentralApps/pull/1733

Work Item(s)

Fixes #29777
AB#613827

@BenPlunk BenPlunk requested a review from a team as a code owner March 3, 2026 07:33
@BenPlunk BenPlunk requested a review from mynjj March 3, 2026 07:33
@stkillen
Copy link
Contributor

stkillen commented Mar 3, 2026

{
Caption = 'Approval Code';
}
field(salespersPurchCode; Rec."Salespers./Purch. Code")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not use abbreviations for field names


page 30094 "APIV2 - Approval Entries"
{
APIGroup = 'auditing';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these are going to be a separate group, then they shouldn't be in APIV2 app. Instead they should get their own app.

{
APIGroup = 'auditing';
APIPublisher = 'microsoft';
APIVersion = 'v2.0';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

microsoft/auditing is a new API path, why v2.0?

  • Either no new path and part of standard APIs (not favorable)
  • Or new app (favorable)

BenPlunk and others added 2 commits March 4, 2026 10:49
Co-authored-by: Onat Buyukakkus <55088871+onbuyuka@users.noreply.github.com>
Co-authored-by: Onat Buyukakkus <55088871+onbuyuka@users.noreply.github.com>
@github-actions github-actions bot added the linked Issue is linked to a Azure Boards work item label Mar 3, 2026
{
Caption = 'Substitute';
}
field(eMail; Rec."E-Mail")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

email

{
Caption = 'Sequence No.';
}
field(senderID; Rec."Sender ID")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ID is not proper, it should be Id to align with other APIs

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both field name and caption should be updated

{
Caption = 'Sequence No.';
}
field(senderID; Rec."Sender ID")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both field name and caption should be updated

{
Caption = 'Pending Approvals';
}
field(recordID; Rec."Record ID to Approve")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is the recordId going to be used? What is the flow in using/exposing this?
RecordId is very BC specific. We usually add the System Id and Table Id, however there should be a way of fetching the record itself.

{
Caption = 'Posted Record ID';
}
field(delegationDateFormula; Rec."Delegation Date Formula")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Date formula is very BC specific. How is it supposed to be used by the consumer of the API?


// [THEN] entry should exist in the response
if GetLastErrorText() <> '' then
Assert.ExpectedError('Request failed with error: ' + GetLastErrorText());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this one should be Assert.Error, not expected error

if GetLastErrorText() <> '' then
Assert.ExpectedError('Request failed with error: ' + GetLastErrorText());

Assert.IsTrue(LibraryGraphMgt.GetObjectIDFromJSON(ResponseText, 'id', ApprovalEntryId), 'Could not find approval entry');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are weak. Just getting an ID means nothing. We should get the proper E2E scenarios that outline the usage of the API, so we understand how the API should be used.

if GetLastErrorText() <> '' then
Assert.ExpectedError('Request failed with error: ' + GetLastErrorText());

Assert.IsTrue(LibraryGraphMgt.GetObjectIDFromJSON(ResponseText, 'id', ApprovalEntryId), 'Could not find approval entry');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assert should check the actual contents of the response, checking if ID exists proves nothing.

@JesperSchulz JesperSchulz added the Integration GitHub request for Integration area label Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Integration GitHub request for Integration area linked Issue is linked to a Azure Boards work item

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BC Idea]: Auditing Reports - Approval APIs

5 participants