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."
0
Comments
RIS Plus, LLC
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.