Ext.Doc.No. mandatory while reversing the Prepayment Invoice

sneha
sneha Member Posts: 191
I posted a prepayment invoice. Now I want to reverse the prepayment invoice.
From the PO, I clicked on “Post Prepayment Credit Memo “. System throwing the below error message
You must Specify External. Document No. in Gen. Journal Line Journal Template Name = ‘’, Journal Batch Name=’’, Line No. =’0’
I understand above error message is because “Ext. Doc. No. Mandatory” is checked in P&P Setup and below code in codeunit 12
IF PurchSetup."Ext. Doc. No. Mandatory" OR
(CVLedgEntryBuf."External Document No." <> '')
THEN BEGIN
// Test vendor number
TESTFIELD("External Document No.");
OldVendLedgEntry.RESET;
IF NOT RECORDLEVELLOCKING THEN
OldVendLedgEntry.SETCURRENTKEY("External Document No.");
OldVendLedgEntry.SETRANGE("External Document No.",CVLedgEntryBuf."External Document No.");
OldVendLedgEntry.SETRANGE("Document Type",CVLedgEntryBuf."Document Type");
OldVendLedgEntry.SETRANGE("Vendor No.",CVLedgEntryBuf."CV No.");
IF NOT OldVendLedgEntry.ISEMPTY THEN
ERROR(
Text003,
CVLedgEntryBuf."Document Type",CVLedgEntryBuf."External Document No.");
END;

Based on the given help message, we don’t want to take out the “Ext. Doc. No. Mandatory” from P&P Setup.

Ext. Doc. No. Mandatory Field The Purchases & Payables Setup Table
Here you can specify whether it is mandatory to enter an external document number in the following situations:
in the Vendor Invoice No. field or the Vendor Cr. Memo No. field on a purchase header
in the External Document No. field on a general journal line, where the contents of the Document Type field = Invoice, Credit Memo or Finance Charge and the contents of the Account Type field = Vendor.
If you place a check mark in this field, it will not be possible to post an invoice, a credit memo or the type of general journal line described above without an external document number.

In which field I have to enter the data to bypass the above code?



----Edit---

Sorry, I confused. I was looking for "Ext. Doc. No. field in Purchase Header. I need to fill up "Vendor Cr. Memo No."

Comments

  • DenSter
    DenSter Member Posts: 8,307
    You will have to enter a value in the External Document Number field.
  • aseigle
    aseigle Member Posts: 207
    I know this is a really old post, but I received this error when testing a fix from MS for prepayments.

    The error is misleading because there is no External Document No. field in the Purchase Header. It is really looking for you to specify a value in the Vendor Cr. Memo No. field, which is not shown by default in the Purchase Header.

    Hope this helps save someone time in the future.