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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Preventing Vendor/Customer Payments Without Invoice Selection

(6) ShareShare
ReportReport
Posted on by 209
Dear team,
 
Is there a way to prevent vendor/customer payments from being processed without the invoice selection in the payment lines??
 
Thank you :)
Shivam Pandey
I have the same question (0)
  • Suggested answer
    BillurSamdancioglu Profile Picture
    18,371 Most Valuable Professional on at
    Preventing Vendor/Customer Payments Without Invoice Selection
    You may try to set invoice fields as mandatory.
  • Suggested answer
    Sagar121 Profile Picture
    385 on at
    Preventing Vendor/Customer Payments Without Invoice Selection
    Try this code. This will prevent user from posting  Vendor payment journal if paymid is not entered you can simple extend same logic for Customer payment Journal too.( changing your ledgerjournaltable.JournalName == '' and LedgerJournalACType::Cust,  also change paymid field

     

    [ExtensionOf(classStr(LedgerJournalCheckPost))]

     

    final class LedgerJournalCheckPost_Test_Extension

     

    {

        public void run()

        {

            LedgerJournalTrans ledgerJournalTrans;

            if (ledgerJournalTable.JournalName == 'VendPay')

            {

                select firstOnly RecId from ledgerJournalTrans

                    where ledgerJournalTrans.JournalNum == ledgerJournalTable.JournalNum

                       && ledgerJournalTrans.AccountType == LedgerJournalACType::Vend

                       && ledgerJournalTrans.PaymId == '';

                if (ledgerJournalTrans.RecId)

                {

                    throw error(“Payment ID must be entered in Vendor Payment Journal.");

                }

            }

            next run();

        }

    }

  • Suggested answer
    Ramit Paul Profile Picture
    22,782 Most Valuable Professional on at
    Preventing Vendor/Customer Payments Without Invoice Selection
    Why you need this? What is the business requirement? is there no scenario where they will use On account payment/ advance payment? 
     
    Also, as answered by others, there is no stanadrad solution unless some workaround suggested by Sohaib.
  • Sohaib Cheema Profile Picture
    47,774 User Group Leader on at
    Preventing Vendor/Customer Payments Without Invoice Selection
     
    I have done some testing and found the behaviour that you have mentioned. While it can work with Invoice Id mentioned, it does not when one or multiple invoices are settled using checkbox, on the new pop-up form that is opened from the Settle Transaction Button.
     
    This would need customization by adding a new method in the class named as LedgerJournalWFApprovalDocument
    The newly added method would be on the same pattern as an existing method in the class (parmMaxVoucherCreditAmount)
     
     
    Once a new method is added using extension, that would make a new selection possible in the workflow conditions.
     
    If you have a technical consultant, tell them following.
    1) initially when a transaction is marked it remains in a table named SpecTrans (until payment journal is not posted). The table maintains the record using three key fields RefCompany, RefRecId, RefTableId
    2) Once payment journal is posted the records go to the table VendSettlement and get deleted from SpecTrans
    3) therefore your custom method must check both tables, for marked transactions.
    In technical language it is called adding Calculated Fields in the workflow document class, that enables a new selection on the conditions of workflow
     
    You will get a new choice on the following form:
     
     
  • Shivam.bst Profile Picture
    209 on at
    Preventing Vendor/Customer Payments Without Invoice Selection

    Hi Everyone,

     

    Thank you for your responses.

     

    Hi @Sohaib Cheema,

     

    Thanks for your suggestion,

     

    I tried the workflow option—it correctly returns when there is no invoice in the journal line. However, it’s still not working in cases where the invoice is marked for settlement.

    Could you please provide more insight into the workflow conditions?

    pls see the workflow condition which I have added - 

     

    Thanks again!

  • Suggested answer
    Yng Lih Profile Picture
    1,210 on at
    Preventing Vendor/Customer Payments Without Invoice Selection
    Hi Shivam,
     
    There is no standard feature to control the mandatory of invoice selection for payment. You will need customization to achieve this.
     
    Beforehand, you may want to check if there are any business scenarios where payment will be made first without invoice.
    e.g. Advanced payment/ Deposit from customer
     
    Thanks.
     
     
    If this information was helpful, kindly mark it as 'Verified'. Thank you. :)
     
     
  • Suggested answer
    Syed Haris Shah Profile Picture
    220 on at
    Preventing Vendor/Customer Payments Without Invoice Selection
    Hi Shivam,
     
    There is no out-of-the-box feature to restrict customer/vendor payments without invoice selection. However, the solution suggested by Shoaib makes sense if you prefer to avoid customization.
     
    If you find this answer helpful, please consider verifying the answer. 👍
     
    Regards,
    Syed Haris Shah
     
  • Suggested answer
    Sohaib Cheema Profile Picture
    47,774 User Group Leader on at
    Preventing Vendor/Customer Payments Without Invoice Selection
    Do you have a workflow on the payments? The standard workflow comes without any customization for the both side of payment?
    You can set the conditions, (If InvoiceNumber is Empty) , reject the payment workflow.
     
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    297,389 Super User 2025 Season 2 on at
    Preventing Vendor/Customer Payments Without Invoice Selection
    Hi Shivam,

    Out of the box, there is no setting to control a mandatory settlement during payment posting. You can consider a customization for this requirement.

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Sohaib Cheema Profile Picture

Sohaib Cheema 775 User Group Leader

#2
Martin Dráb Profile Picture

Martin Dráb 634 Most Valuable Professional

#3
André Arnaud de Calavon Profile Picture

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

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans