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...
Answered

How to allow an entra application to post journals in closed periods?

(2) ShareShare
ReportReport
Posted on by 43
Hi,
 
in Business Central, is it possible to setup a posting date to a service account, which is an Entra ID Application, like we do it for a standard user?
 
or is there a way to have different posting date opened for different components in BC (sales vs purchasing...)
 
I have to post inventory adjustment through an external integration system for the past month. but the posting date is closed to make sure that users will not update these months
but some users and my service account should be able to do it.
 
 
I have the same question (0)
  • Holly Huffman Profile Picture
    6,538 Super User 2025 Season 2 on at
    hi there! 
     
    good morning, evening, or afternoon - depending on where you are :) 
    hope you are well! 
     
    is it a service account or a microsoft entra application id? 
     
  • Willgart Profile Picture
    43 on at
    it's a Microsoft entra application id
  • Suggested answer
    CN-24021152-0 Profile Picture
    79 on at
    Hello,
     
    In case you are referring to Closed Periods based on the Dates set at General Legder Setup to avoid users post any transaction in a period prior of the current month, you can always setup at user setup the Dates range to allow some users to post in different periods.
    User Setup Dates overrides the dates set at General Ledger Setup, in this way some users will be able to post any kind of transactions in prior Periods even most of the users cannot.
    This practice is usually used  by accounting users, once in some cases they might need to post transactions that needs to be reflected in prior months than the current month.
     
    Hope this can help you to move forward in you issue.
     
    Kind Regards,
    Carmen Nunes
  • Suggested answer
    Yi Yong Profile Picture
    2,590 Super User 2025 Season 2 on at
    Hello,
     
    You will have to customize them.
     
    For example on codeunit 21 - Item Jnl check line
    There is the function "OnBeforeDateNowAllowed".
    You can subscribe to the event and add condition to set true on DateCheckDone to skip.
  • Willgart Profile Picture
    43 on at
    Thanks,
     
    I'm able to set the DateCheckDone to true
    it's working the error
    "The Posting Date is not within your range of allowed posting dates."
    is no longer raised
     
    but I'm still receiving another error now:
    "Posting Date is not within your range of allowed posting dates in Gen. Journal Line Journal Template Name='',Journal Batch Name='',Line No.='0'"
     
    How can I find which procedure is generating the error?
    Maybe I have to listen for another event?
    and what is even stranger, I'm using a template name and batch name when I prepare my journal in my code.
    so the error did not point my names:
     Template Name='',Journal Batch Name='',

    to confirm that I have the batch name in place in my event subscriber procedure I test that:

        [EventSubscriber(ObjectType::Codeunit, Codeunit::"Item Jnl.-Check Line", 'OnBeforeDateNotAllowed', '', true, true)]
        local procedure HandleOnBeforeDateNowAllowed(ItemJnlLine: Record "Item Journal Line"; var DateCheckDone: Boolean)
        var
            InventoryPeriod: Record "Inventory Period";
        begin
            DateCheckDone := true;
            Error(ItemJnlLine."Journal Batch Name"); <-- added for testing removed after 
    end;
    so I raise an error with the Journal Batch Name, and I see the name I putted in my code, not an empty one.

     
  • Suggested answer
    Teddy Herryanto (That NAV Guy) Profile Picture
    14,284 Super User 2025 Season 2 on at
    You can use User Setup. The Allow Posting From and Allow Posting To on the User Setup takes priority.
     
    You cannot select the Entra User from the User ID lookup, but you can just type in the Entra's User Name because there is no validation.
  • Verified answer
    Gerardo Rentería García Profile Picture
    25,388 Most Valuable Professional on at
  • Willgart Profile Picture
    43 on at
    Yes!!!
    thanks a lot
    the second blog point me to the event I have to catch.
    OnBeforeIsPostingDateValidWithSetup
    I will be able to implement my own logic now.
     

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

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 744 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 674 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans