ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

New Event to the Table 130 - "Incoming Document"

Open clausmacali opened this issue 7 years ago • 1 comments

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);

clausmacali avatar Apr 30 '19 16:04 clausmacali

This event already exist

AlexanderYakunin avatar May 07 '19 10:05 AlexanderYakunin