Skip to main content

Creditor ID from Extensions

Obsolete

This event is obsolete. It passes the document number without the document type, so a posted invoice and a posted credit memo with the same number cannot be told apart. Use OnBeforeResolveDirectDebitMandateForDocument instead.

Since version 26.5.61, an extension that supplies the SEPA direct debit mandate can also supply the creditor ID (BT-90). It uses a second integration event that mseDoc365 raises right after OnBeforeResolveDirectDebitMandate. Without it, BT-90 is resolved from the Creditor No. of the company bank account, as described on Payment Means.

Event​

Table mseBC mseDoc365 S. Inv.Buffer (5563231):

[IntegrationEvent(false, false)]
local procedure OnBeforeResolveDirectDebitMandateWithCreditorID(DocumentNo: Code[20]; BillToCustomerNo: Code[20]; SellToCustomerNo: Code[20]; DirectDebitMandateID: Code[35]; DueDate: Date; var ResolvedMandateID: Code[35]; var ResolvedDebtorIBAN: Code[50]; var BankAssignedCreditorID: Text[35]; var IsHandled: Boolean)

The parameters are the same as for OnBeforeResolveDirectDebitMandate, plus:

ParameterMeaning
BankAssignedCreditorIDReturn the creditor ID (BT-90). Leave empty to resolve it from the company bank account

The event is raised only for payment means 59, for sales invoices and sales credit memos.

Rules​

  • Both events are raised one after the other with the same variables. A subscriber can therefore set the mandate in either event; use only one of them for a given extension.
  • BankAssignedCreditorID is used only when IsHandled is true. With IsHandled at false, the standard resolution from the BC mandate table and the company bank account applies.
  • An empty BankAssignedCreditorID falls back to the company bank account, including its errors when no Creditor No. can be found.
  • The rules for an empty mandate ID or debtor IBAN are the same as on Direct Debit Mandates from Extensions.

Example​

[EventSubscriber(ObjectType::Table, Database::"mseBC mseDoc365 S. Inv.Buffer", 'OnBeforeResolveDirectDebitMandateWithCreditorID', '', false, false)]
local procedure SupplyMandate(DocumentNo: Code[20]; BillToCustomerNo: Code[20]; SellToCustomerNo: Code[20]; DirectDebitMandateID: Code[35]; DueDate: Date; var ResolvedMandateID: Code[35]; var ResolvedDebtorIBAN: Code[50]; var BankAssignedCreditorID: Text[35]; var IsHandled: Boolean)
begin
// Read the mandate from the add-on's own tables
ResolvedMandateID := 'MANDATE-001';
ResolvedDebtorIBAN := 'DE02120300000000202051';
BankAssignedCreditorID := 'DE98ZZZ09999999999';
IsHandled := true;
end;