New Event to the Table 130 - "Incoming Document"
2. LOCAL [IntegrationEvent] OnAfterFindUnpostedRecord(var IncomingDocument: Record "Incoming Document";VAR RelatedRecord : Variant;VAR RecordFound : Boolean)
LOCAL FindUnpostedNAVRecord(VAR RelatedRecord : Variant) : Boolean CASE "Document Type" OF "Document Type"::Journal: BEGIN GenJournalLine.SETRANGE("Incoming Document Entry No.","Entry No."); IF GenJournalLine.FINDFIRST THEN BEGIN GenJournalLine.SETRANGE("Journal Batch Name",GenJournalLine."Journal Batch Name"); GenJournalLine.SETRANGE("Journal Template Name",GenJournalLine."Journal Template Name"); RelatedRecord := GenJournalLine; EXIT(TRUE) END; END; "Document Type"::"Sales Invoice", "Document Type"::"Sales Credit Memo": BEGIN SalesHeader.SETRANGE("Incoming Document Entry No.","Entry No."); IF SalesHeader.FINDFIRST THEN BEGIN RelatedRecord := SalesHeader; EXIT(TRUE); END; END; "Document Type"::"Purchase Invoice", "Document Type"::"Purchase Credit Memo": BEGIN PurchaseHeader.SETRANGE("Incoming Document Entry No.","Entry No."); IF PurchaseHeader.FINDFIRST THEN BEGIN RelatedRecord := PurchaseHeader; EXIT(TRUE); END; END; END;
RecordFound := FALSE; OnAfterFindUnPostedNAVRecord(IncomingDocument : Record "Incoming Document";RelatedRecord,RecordFound); EXIT(RecordFound);
This event already exist