Showing posts with label Workflows. Show all posts
Showing posts with label Workflows. Show all posts

Wednesday, 18 March 2026

Approval Workflows for Item Journals and Requisition Worksheets

The Gap That Existed Until Now

If you've worked with Business Central approval workflows, you know the story. General journal batches had approval support baked in. But item journals? Requisition worksheets? Planning worksheets? Nothing. You either built custom workflows from scratch (not fun) or relied on trust and process discipline to make sure someone reviewed those entries before posting.

That meant inventory adjustments, consumption postings, and purchase document creation from requisition lines could happen without a second pair of eyes. And for organizations with audit requirements or segregation of duties policies, that was a real problem.

With BC28, Microsoft has closed this gap. Let's walk through what's new.


What's New in BC28:

Approval Workflows for Item Journals

Item journals now support the same batch-level approval workflow that general journal batches have had for a while. You can send a batch for approval before anyone can post it. This applies to four journal types:

 


Once a batch has an active approval request, the system locks it down. No edits, no deletes, no posting until the approval is completed or canceled. The standard approval actions (Approve, Reject, Delegate, Comments) show up right on the journal pages, along with the workflow status.


Approval Workflows for Requisition and Planning Worksheets

Requisition worksheets and planning worksheets now have full approval workflow support at the batch level. Before you carry out planning actions or convert requisition lines into purchase documents, the batch can go through an approval cycle.

When an approval request is active on a worksheet batch, the system prevents inserting, modifying, or deleting any requisition or planning lines. The workflow status is visible on the worksheet pages, and the same approval actions are available.

This is a big deal for procurement teams. Think about it: someone generates a planning run, the lines get reviewed and approved, and only then do they become purchase orders. No one accidentally carries out action messages on lines that haven't been vetted.


How It Behaves at Runtime

Here's what happens when a batch is pending approval:


If you try to modify a record that has an active approval request, BC will stop you with a message asking whether you want to cancel the approval first. It's the same pattern you already know from general journal approvals, just extended to new areas.

Setting It Up

Configuration follows the standard workflow setup pattern. No surprises here.

1.    Open the Workflows page (search for it using Tell Me).

2.    Select the Item Journal Batch Approval Workflow or Requisition Worksheet Batch Approval Workflow template.

3.    Specify the template and batch name in the event conditions.

4.    Configure your approvers and enable the workflow.

5.    Open the relevant journal or worksheet and choose Send for Approval.

6.    Track the status on the Approval Entries page.

These are standard workflow templates, which means they come ready to use. You're not building anything from scratch. Pick a template, point it at your batch, set up approvers, and go.

Power Automate Support

Microsoft has also updated the workflow events and responses to work with Power Automate. So if your organization uses Power Automate for approval routing or notifications, you can plug these new workflows into your existing flows. The integration follows the same pattern as other BC workflow events.





Friday, 28 February 2025

How Can We Update a Field Upon Workflow Approval in Business Central?

 

Business Central’s workflows automate actions based on workflow responses. One common requirement is to update a specific field once a workflow is approved.

Updating the Description Field in General Journal Batch Workflow.

In this scenario, when a General Journal Batch is approved, the Description field should be updated with "Account Type + Account No.". This can be achieved by leveraging Business Central’s approval response mechanism.

Step 1: Identify the Approval Response Code Path

  • The approval process navigates through codeunit 1521 and then to codeunit 1535.
  • Within codeunit 1535, there is a publisher OnApproveApprovalRequestsForRecordOnBeforeApprovalEntryToUpdateModify.
  • This publisher allows modify records upon approval.

Step 2: Implement the Code to Update the Description Field

Use the following AL code to subscribe to the event and update the Description field:

[EventSubscriber(ObjectType::Codeunit, Codeunit::"Approvals Mgmt.", OnApproveApprovalRequestsForRecordOnBeforeApprovalEntryToUpdateModify, '', false, false)]

local procedure "Approvals Mgmt._OnApproveApprovalRequestsForRecordOnBeforeApprovalEntryToUpdateModify"(var ApprovalEntryToUpdate: Record "Approval Entry")

var

    RecRef: RecordRef;

    GenJournalBatch: Record "Gen. Journal Batch";

    GenJournalLine: Record "Gen. Journal Line";

begin

    if not RecRef.Get(ApprovalEntryToUpdate."Record ID to Approve") then

        exit;

 

    case RecRef.Number of

        Database::"Gen. Journal Batch":

            begin

                RecRef.SetTable(GenJournalBatch);

                GenJournalLine.Reset();

                GenJournalLine.SetRange("Journal Template Name", GenJournalBatch."Journal Template Name");

                GenJournalLine.SetRange("Journal Batch Name", GenJournalBatch."Name");

                if GenJournalLine.FindSet() then

                    repeat

                        GenJournalLine.Description := format(GenJournalLine."Account Type") + ' ' + GenJournalLine."Account No.";

                        GenJournalLine.Modify();

                    until GenJournalLine.Next() = 0;

            end;

 

        Database::"Gen. Journal Line":

            begin

                RecRef.SetTable(GenJournalLine);

                if GenJournalLine.FindSet() then

                    repeat

                        GenJournalLine.Description := 'Set the value as per your requirement';

                        GenJournalLine.Modify();

                    until GenJournalLine.Next() = 0;

            end;

    end;

end;

Step 3: Deploy and Test the Code

1.      Deploy the extension containing the event subscriber.

2.      Submit a General Journal Batch for approval.

3.      Approve the batch and verify that the Description field is updated.



Conclusion

This approach can be extended to other workflows and responses by identifying the proper publisher.

 


Monday, 27 January 2025

Multi Level User Group Approval Workflows in Business Central


The requirement is to design an approval workflow in Business Central with the following structure:

Level 1 Approval Group:
This group consists of two approvers.
The system should only require one of the two approvers to approve the document. Once any one of them approves, the approval process for this level is considered complete.

Level 2 Approval Group:
After Level 1 approval is completed, the system should automatically send the approval request to approver(s) in Level 2.
This approver(s) must review and approve the document to complete the entire workflow process.



Monday, 10 July 2023