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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Exposed custom fields in Workflow

(6) ShareShare
ReportReport
Posted on by 104

Hi Everyone,

 

I am trying to create two new Boolean fields, Budgetted and Urgent, in the Purchase Header table. My goal is to use these fields as filters in the Approval Workflow—specifically to trigger workflows when both fields are set to true. However, when creating the workflow, these fields are not exposed in the filtering options.

How can I expose these custom fields so that they can be used in the workflow filtering?

I have the same question (0)
  • Suggested answer
    Yi Yong Profile Picture
    2,647 Super User 2026 Season 1 on at
    Hello,
     
    As long as the fields are added to the table, it will show up on the +Filter selection list.
     
     
    Fields added to the page will not be included.
  • Suggested answer
    Jainam M. Kothari Profile Picture
    15,732 Super User 2026 Season 1 on at
    Hello,
     
    To make custom Boolean fields like "Budgeted and Urgent" available for filtering in approval workflows, you need to extend the workflow setup using AL code.
  • Suggested answer
    Mansi Soni Profile Picture
    8,951 Super User 2026 Season 1 on at
    Hello, 

    First, check in the Approval Workflow if your fields appear in the condition filters. If not, you'll need to extend the workflow event handling and conditions via AL code so the system can recognize and use them in workflow triggers.

    Hope this answer will help you!

    Regards,
    Mansi Soni
  • Gerardo Rentería García Profile Picture
    25,555 Most Valuable Professional on at

    Hi, good day
    I hope this can help you, and give you some hints.

    Walkthrough: Implementing New Workflow Events and Responses - Business Central | Microsoft Learn

    Best Regards
    Gerardo

  • Suggested answer
    Andrés Arias Profile Picture
    5,166 Super User 2026 Season 1 on at
  • Suggested answer
    Sohail Ahmed Profile Picture
    11,169 Super User 2026 Season 1 on at
    To use custom fields like Budgetted and Urgent in Workflow filters, you need to expose them in the workflow event conditions using the AddWorkflowTableRelation and AddWorkflowField methods in AL.
     
    ✅ Here's how you can do it:
     
    1. Extend the Purchase Header table to add your custom Boolean fields.
     
     
    2. Create a Workflow Event Handling subscriber (codeunit) and register your fields:
     
     
     
    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Workflow Setup", 'OnAddWorkflowTableRelations', '', false, false)]
    local procedure AddWorkflowTableRelations()
    begin
        WorkflowSetup.AddWorkflowTableRelation(Database::"Purchase Header");
    end;
     
    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Workflow Setup", 'OnAddWorkflowFieldsToRecord', '', false, false)]
    local procedure AddWorkflowFieldsToRecord(TableID: Integer)
    var
        PurchaseHeader: Record "Purchase Header";
    begin
        if TableID = Database::"Purchase Header" then begin
            WorkflowSetup.AddWorkflowField(PurchaseHeader.FieldNo("Budgetted"));
            WorkflowSetup.AddWorkflowField(PurchaseHeader.FieldNo("Urgent"));
        end;
    end;
     
    3. Reopen the workflow setup page, and your new fields should appear in the conditions filter dropdown.
     
     
     
    This way, you can trigger approvals only when both Budgetted = true and Urgent = true.
     
    ✅ 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,926 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,158 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 533 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans