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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Getting error when applying prepayment for 1 vendor only

(3) ShareShare
ReportReport
Posted on by 406
Hello,
 
im getting this error recently:You have marked prepayment application or reversal transactions in closed period, please unmark them before applying prepayment
its when i try to apply prepayment for a puchase order for a certain vendor. this error only occurs for this vendor, also it shows when January 2022 ledger calendar is closed, when  i open it, its working fine, i need to know why this error is showing only if january 2022 is closed and only for this vendor. please note that this vendor has one PO in jan 2023. so lets say i create a new PO in july 2024 with this vendor, the error is showing also, but if i open Jan 2022 ledger calendar, its working fine.
I also checked under the backend the code related to this error:
   private void checkExistingVendAdvanceTransInOpenPeriod(VendInvoiceAccount _invoiceAccount)
        {
            VendInvoiceJour vendInvoiceJour;
            VendAdvanceApplicationTrans vendAdvanceApplicationTrans;
            RecId calendarRecId = CompanyInfoHelper::fiscalCalendarRecId();
            while select vendAdvanceApplicationTrans
            join vendInvoiceJour
                where vendAdvanceApplicationTrans.PostedInvoiceRecId == vendInvoiceJour.RecId
                    && vendInvoiceJour.InvoiceAccount == _invoiceAccount
            {
                if (!LedgerFiscalCalendar::checkDateIsValid(calendarRecId, vendAdvanceApplicationTrans.SettlementPostingDate, FiscalPeriodType::Operating, false))
                {
                    throw warning("@AccountsPayable:MarkedPrepaymentInClosedPeriod");
                }
         
i need to know why this is happening.
 
thanks
I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    301,075 Super User 2025 Season 2 on at
    Hi D365 FO Developer,
     
    Can you tell what date is used for the pre-payment? Can you share a screenshot?
  • Mario Barnaba Profile Picture
    19 on at
    this PO is issued in November 2023, this issue is only available for one vendor which is using this purchase order.
     
    when I open February 2022 in ledger calendar, I can apply this prepayment even though in February 2022, we have only 1 transaction for this vendor which is also a Purchase order with a prepayment fully applied.

    and as we searched for this error, it is standard and the meaning of it is that we need to have the fiscal period of both prepayment and PO open which they are (November 2023), but why when I open February 2022 only, I can apply this prepayment?

  • D365FO DEV Profile Picture
    406 on at
    Hi Andre,
     
    my scenario is same as Mario's scenario. same issue with different dates
  • Mario Barnaba Profile Picture
    19 on at
    I found that there is something related to February 2022.
    that some PO with prepayment causing this issue.
    however, this is nothing wrong with the PO.
  • André Arnaud de Calavon Profile Picture
    301,075 Super User 2025 Season 2 on at
    Hi Mario, D365 Dev,

    Have you checked what date is stored in the field SettlementPostingDate in the VendAdvanceApplicationTrans record(s)? A wrong date might be stored or a wrong record can be retrieved. Potentially, in a non-production environment, you can use the debugger to check what exact record is being retrieved in the method that checks the open period.
  • Mario Barnaba Profile Picture
    19 on at
    Hello Andre, following your response,

    I am navigating to all vendors, selecting the vendor and I select the settlement posting date in 2023, when I click the apply prepayment button, an error is showing stating: "fiscal period 18/2/2022 is not open".

    I checked in this vendor transactions, this date is related to an old PO with applied prepayment (18/2/2022)
    so, how do I get rid of this error? because I need to apply this prepayment in 2023.
  • Mario Barnaba Profile Picture
    19 on at
    Dear Andre, as per what you said before,
     
    we debuged the code and it turned out that this invoice is taking a settlement posting date as in 18/02/2022. It is not taking the settlement posting date I am selecting under the vendor.
     
    can you advise please on how we can solve this in code or the issue by system?
  • André Arnaud de Calavon Profile Picture
    301,075 Super User 2025 Season 2 on at
    Hi Mario,
     
    I'm not able to suggest what to do next. I don't have a reproducible scenario, so don't know what options there are now in the standard application. When you open the period and perform the posting, it is then generating accounting entries in 2022 or the data you provided for the update? Test this in a non-prod environment first. If it is creating entries in 2022, then I suggest to log an incident for Microsoft Support.
  • Suggested answer
    CU22040331-0 Profile Picture
    2 on at
    I had the same issue, when I updated all the months as "Open" for that specific Financial year, in the Ledger calendar, the system allowed me to select the Invoice.
    Please try and let me know if it resolved the issue for you as well, Thanks

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 592 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 478 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 305 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans