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

General Journal Approval Workflow Error

(7) ShareShare
ReportReport
Posted on by 427
Hi experts,
 
I have setup the general journal line approval workflow. but the thing is i can change the journal data ( Account type, Account number, Amount etc.), even i have sent it for approval ( Status= Pending approval). and also after approved the journal lines ( Status= Approved), I can change journal line data and after delete the restricted record i can post the journal lines.
 
How can I solve this in dynamic 365 BC . I need to restrict changing data when approval status = Pending approval and approved.
I have the same question (0)
  • Suggested answer
    Sohail Ahmed Profile Picture
    11,136 Super User 2025 Season 2 on at
    Hi Niki,
     
    This behavior happens because standard journal approval workflows in Business Central don’t automatically lock the journal lines from editing. To restrict changes based on approval status, you’ll need to add custom validation in the journal page or table extension.
     
    A simple solution:
     
    Use an event subscriber on the OnBeforeValidateEvent for fields like Amount, Account No., etc.
     
    In the code, check if Approval Status = Pending Approval or Approved, and prevent changes with an error message.
     
     
    This will block edits once the journal is submitted for approval. ✅ Mark this as the verified answer if helpful.
     
     
  • Suggested answer
    techreviews.digital Profile Picture
    376 on at
    Dear @Niki
     
    Greetings!!!

    I tried it on my system, but after approval, once I try to make any changes in the Journal line, the approval status changes to Imposed Restrictions. The system is not allowing me to proceed with the posting of the transaction.
     
    I followed the following steps:
    Step 1: Created an approval workflow template from the General Journal Batch Approval template.
    Step 2: Set up my user ID as approver in the approval workflow (It will directly make the status approved once I request the approval)
    Step 3: After approval, I made a change in the amount. 
    Step 4: The approval status changed from Approved to Imposed Restrictions.
     
    I hope it will help you in resolving your concerns.
     
    Best Regards, 
    Sheikh Muhammad Jawad
  • Suggested answer
    Ahmad Subhani Profile Picture
    581 on at
    Hi,
     
    If we make any changes in the Journal line, the approval status changes to Imposed Restrictions. System will not going to Allow you to Proceed.
     
    Means there is a Problem in the Workflow you created. Try to use the default template and then just apply the condition and approval type. Then it will work.
     
    Mark the Answer as Verified if this is Helpful.
     
  • Suggested answer
    Sumit Singh Profile Picture
    10,079 on at
     What’s Missing?
    The approval workflow only changes the status (Approval Status field), but does not enforce data locking. You need to implement custom validation logic to restrict changes based on the status.

    Solution Options
    Option 1: Use Event Subscribers (Recommended)
    Create a codeunit with event subscribers to validate changes on journal lines.
    Steps:
    1. Subscribe to the OnBeforeValidateEvent or OnBeforeModifyEvent of the Gen. Journal Line table.
    2. Check the Approval Status field.
    3. If status is Pending Approval or Approved, raise an error to prevent changes.
    Sample AL Code:
    codeunit 50100 "JournalLineApprovalLock"
    {
        [EventSubscriber(ObjectType::Table, Database::"Gen. Journal Line", 'OnBeforeModifyEvent', '', true, true)]
        local procedure PreventJournalLineModification(var Rec: Record "Gen. Journal Line"; var xRec: Record "Gen. Journal Line"; RunTrigger: Boolean)
        begin
            if Rec."Approval Status" in [Rec."Approval Status"::"Pending Approval", Rec."Approval Status"::Approved] then
                Error('You cannot modify journal lines that are pending approval or already approved.');
        end;
        [EventSubscriber(ObjectType::Table, Database::"Gen. Journal Line", 'OnBeforeDeleteEvent', '', true, true)]
        local procedure PreventJournalLineDeletion(var Rec: Record "Gen. Journal Line")
        begin
            if Rec."Approval Status" in [Rec."Approval Status"::"Pending Approval", Rec."Approval Status"::Approved] then
                Error('You cannot delete journal lines that are pending approval or already approved.');
        end;
        [EventSubscriber(ObjectType::Table, Database::"Gen. Journal Line", 'OnBeforeValidateEvent', '', true, true)]
        local procedure PreventFieldValidation(var Rec: Record "Gen. Journal Line"; var xRec: Record "Gen. Journal Line"; FieldNumber: Integer; var IsHandled: Boolean)
        begin
            if Rec."Approval Status" in [Rec."Approval Status"::"Pending Approval", Rec."Approval Status"::Approved] then
                Error('You cannot change journal line data when it is pending approval or approved.');
        end;
    }

    Option 2: Page-Level Validation
    If you want to restrict changes only from the UI, you can:
    • Override OnModifyRecord trigger on the journal line page.
    • Add similar logic to prevent changes.

    Option 3: Use Permissions (Limited)
    You can create a custom permission set that restricts modification rights, but this is not dynamic based on approval status, so it's less flexible.

    Note: This response was created in collaboration with Microsoft Copilot to ensure clarity and completeness. I hope it helps to some extent.
    Mark the Answer as Verified if this is Helpful.
     
  • Suggested answer
    YUN ZHU Profile Picture
    95,329 Super User 2025 Season 2 on at
    This is standard behavior and requires some simple customization if you need locking.
    This is like the Sales Order status is Released, and some fields can also be modified.
     
    Hope this helps.
    Thanks.
    ZHU
  • Niki Profile Picture
    427 on at
     
    Thank you for replying me. 
     
    Did you make any editing , when the approval status is pending approval. Did you receive record restriction that time also?
  • Suggested answer
    techreviews.digital Profile Picture
    376 on at
    Dear Niki, 
     
    Greetings!!!

    The Business Central will not restrict you from making any changes in the General Journal line, but it will change the status from Approved to Imposed Restrictions. So, after making the change the user needs to request for the approval again otherwise Business Central will not allow to post the transaction. 
     
    In my example, I only modified the amount after approval. 
     
    I hope it will answer all of your concerns. 
     
    Best Regards, 
    Sheikh Muhammad Jawad
  • DAnny3211 Profile Picture
    11,397 on at

    Hi Niiki,

    This behavior occurs because the standard approval workflow in Business Central doesn't automatically lock the journal lines from being edited after submission or approval.

    To restrict changes when the approval status is Pending Approval or Approved, you can consider the following approaches:

    1. Custom Validation in Extensions: Develop a small AL extension that adds validation logic to the OnModify or OnBeforeValidate triggers of the General Journal Line table. You can check the approval status and prevent changes accordingly.
    2. Field-Level Permissions: While Business Central doesn’t support dynamic field-level locking out of the box, you can simulate this by disabling fields based on status using page-level logic.
    3. Workflow Enhancements: Extend the workflow to include a status check before allowing modifications or deletions. This may require custom workflow events or conditions.
    4. Audit and Alerts: If full restriction isn’t feasible, consider implementing audit logging or alerts when changes are made post-approval.

    Let me know if you’d like help with the AL code or setting up the workflow conditions.

    Please verify if this response was helpful.

    Best regards!

  • Suggested answer
    Ahmad Subhani Profile Picture
    581 on at
    Hi @Niki,
     
    Yes when the status is Pending Approval, we can not change.
     
    Mark the Answer as Verified if this is Helpful.
  • Suggested answer
    Andrés Arias Profile Picture
    4,188 Super User 2025 Season 2 on at
    Hello,

    I understand that the error could be caused by the workflow of journal lines. You could use the general journal workflow?

    The modification of fields would have to be done through development.
     
    I hope this helps.
     
    Regards,
     
    Andrés

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 3,143

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,694 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,067 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans