Table 288 Vendor Bank Account, source in 29
Source29
src/Layers/W1/BaseApp/Purchases/Vendor/VendorBankAccount.Table.al372 lines, Copyright (c) Microsoft Corporation. MIT
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
namespace Microsoft.Purchases.Vendor;
using Microsoft.Bank.Setup;
using Microsoft.Finance.Currency;
using Microsoft.Foundation.Address;
using Microsoft.Foundation.Company;
using Microsoft.Purchases.Payables;
using System.Automation;
using System.Email;
using System.Globalization;
table 288 "Vendor Bank Account"
{
Caption = 'Vendor Bank Account';
DataCaptionFields = "Vendor No.", "Code", Name;
DrillDownPageID = "Vendor Bank Account List";
LookupPageID = "Vendor Bank Account List";
DataClassification = CustomerContent;
fields
{
field(1; "Vendor No."; Code[20])
{
Caption = 'Vendor No.';
NotBlank = true;
TableRelation = Vendor;
}
field(2; "Code"; Code[20])
{
Caption = 'Code';
ToolTip = 'Specifies a code to identify this vendor bank account.';
NotBlank = true;
}
field(3; Name; Text[100])
{
Caption = 'Name';
ToolTip = 'Specifies the name of the bank where the vendor has this bank account.';
trigger OnLookup()
begin
OnBeforeLookupName(xRec);
end;
}
field(5; "Name 2"; Text[50])
{
Caption = 'Name 2';
}
field(6; Address; Text[100])
{
Caption = 'Address';
ToolTip = 'Specifies the address of the bank where the vendor has the bank account.';
}
field(7; "Address 2"; Text[50])
{
Caption = 'Address 2';
ToolTip = 'Specifies additional address information.';
}
field(8; City; Text[30])
{
Caption = 'City';
ToolTip = 'Specifies the city of the bank where the vendor has the bank account.';
TableRelation = if ("Country/Region Code" = const('')) "Post Code".City
else
if ("Country/Region Code" = filter(<> '')) "Post Code".City where("Country/Region Code" = field("Country/Region Code"));
ValidateTableRelation = false;
trigger OnLookup()
begin
PostCode.LookupPostCode(City, "Post Code", County, "Country/Region Code");
end;
trigger OnValidate()
var
IsHandled: Boolean;
begin
IsHandled := false;
OnBeforeValidateCity(Rec, PostCode, CurrFieldNo, IsHandled);
if not IsHandled then
PostCode.ValidateCity(City, "Post Code", County, "Country/Region Code", (CurrFieldNo <> 0) and GuiAllowed);
end;
}
field(9; "Post Code"; Code[20])
{
Caption = 'Post Code';
ToolTip = 'Specifies the postal code.';
TableRelation = if ("Country/Region Code" = const('')) "Post Code"
else
if ("Country/Region Code" = filter(<> '')) "Post Code" where("Country/Region Code" = field("Country/Region Code"));
ValidateTableRelation = false;
trigger OnLookup()
begin
PostCode.LookupPostCode(City, "Post Code", County, "Country/Region Code");
end;
trigger OnValidate()
var
IsHandled: Boolean;
begin
IsHandled := false;
OnBeforeValidatePostCode(Rec, PostCode, CurrFieldNo, IsHandled);
if not IsHandled then
PostCode.ValidatePostCode(City, "Post Code", County, "Country/Region Code", (CurrFieldNo <> 0) and GuiAllowed);
end;
}
field(10; Contact; Text[100])
{
Caption = 'Contact';
ToolTip = 'Specifies the name of the bank employee regularly contacted in connection with this bank account.';
}
field(11; "Phone No."; Text[30])
{
Caption = 'Phone No.';
ToolTip = 'Specifies the telephone number of the bank where the vendor has the bank account.';
ExtendedDatatype = PhoneNo;
}
field(12; "Telex No."; Text[20])
{
Caption = 'Telex No.';
}
field(13; "Bank Branch No."; Text[20])
{
Caption = 'Bank Branch No.';
ToolTip = 'Specifies the number of the bank branch.';
trigger OnValidate()
begin
OnValidateBankAccount(Rec, 'Bank Branch No.');
end;
}
field(14; "Bank Account No."; Text[30])
{
Caption = 'Bank Account No.';
ToolTip = 'Specifies the number used by the bank for the bank account.';
MaskType = Concealed;
trigger OnValidate()
begin
OnValidateBankAccount(Rec, 'Bank Account No.');
end;
}
field(15; "Transit No."; Text[20])
{
Caption = 'Transit No.';
ToolTip = 'Specifies a bank identification number of your own choice.';
}
field(16; "Currency Code"; Code[10])
{
Caption = 'Currency Code';
ToolTip = 'Specifies the relevant currency code for the bank account.';
TableRelation = Currency;
}
field(17; "Country/Region Code"; Code[10])
{
Caption = 'Country/Region Code';
ToolTip = 'Specifies the country/region of the address.';
TableRelation = "Country/Region";
trigger OnValidate()
begin
PostCode.CheckClearPostCodeCityCounty(City, "Post Code", County, "Country/Region Code", xRec."Country/Region Code");
end;
}
field(18; County; Text[30])
{
CaptionClass = '5,1,' + "Country/Region Code";
Caption = 'County';
ToolTip = 'Specifies the state, province or county as a part of the address.';
}
field(19; "Fax No."; Text[30])
{
Caption = 'Fax No.';
ToolTip = 'Specifies the fax number associated with the address.';
}
field(20; "Telex Answer Back"; Text[20])
{
Caption = 'Telex Answer Back';
}
field(21; "Language Code"; Code[10])
{
Caption = 'Language Code';
ToolTip = 'Specifies the language that is used when translating specified text on documents to foreign business partner, such as an item description on an order confirmation.';
TableRelation = Language;
}
field(22; "E-Mail"; Text[80])
{
Caption = 'Email';
ToolTip = 'Specifies the email address associated with the bank account.';
ExtendedDatatype = EMail;
trigger OnValidate()
var
MailManagement: Codeunit "Mail Management";
begin
MailManagement.ValidateEmailAddressField("E-Mail");
end;
}
#if not CLEAN27
#pragma warning disable AS0086
#endif
field(23; "Home Page"; Text[255])
#if not CLEAN27
#pragma warning restore AS0086
#endif
{
Caption = 'Home Page';
ToolTip = 'Specifies the bank web site.';
ExtendedDatatype = URL;
}
field(24; IBAN; Code[50])
{
Caption = 'IBAN';
ToolTip = 'Specifies the bank account''s international bank account number.';
MaskType = Concealed;
trigger OnValidate()
var
CompanyInfo: Record "Company Information";
IsHandled: Boolean;
begin
IsHandled := false;
OnBeforeValidateIBAN(Rec, xRec, IsHandled);
if IsHandled then
exit;
CompanyInfo.CheckIBAN(IBAN);
end;
}
field(25; "SWIFT Code"; Code[20])
{
Caption = 'SWIFT Code';
ToolTip = 'Specifies the SWIFT code (international bank identifier code) of the bank where the vendor has the account.';
TableRelation = "SWIFT Code";
ValidateTableRelation = false;
}
field(1211; "Bank Clearing Code"; Text[50])
{
Caption = 'Bank Clearing Code';
ToolTip = 'Specifies the code for bank clearing that is required according to the format standard you selected in the Bank Clearing Standard field.';
}
field(1212; "Bank Clearing Standard"; Text[50])
{
Caption = 'Bank Clearing Standard';
ToolTip = 'Specifies the format standard to be used in bank transfers if you use the Bank Clearing Code field to identify you as the sender.';
TableRelation = "Bank Clearing Standard";
}
}
keys
{
key(Key1; "Vendor No.", "Code")
{
Clustered = true;
}
}
fieldgroups
{
fieldgroup(DropDown; "Code", Name)
{
}
fieldgroup(Brick; "Code", Name, "Phone No.", Contact)
{
}
}
trigger OnDelete()
var
VendorLedgerEntry: Record "Vendor Ledger Entry";
Vendor: Record Vendor;
begin
ApprovalsMgmt.OnCancelVendorBankAccountApprovalRequest(Rec);
VendorLedgerEntry.SetRange("Vendor No.", "Vendor No.");
VendorLedgerEntry.SetRange("Recipient Bank Account", Code);
VendorLedgerEntry.SetRange(Open, true);
OnDeleteOnAfterSetFilters(Rec, VendorLedgerEntry);
if not VendorLedgerEntry.IsEmpty() then
Error(BankAccDeleteErr);
if Vendor.Get("Vendor No.") and (Vendor."Preferred Bank Account Code" = Code) then begin
Vendor."Preferred Bank Account Code" := '';
Vendor.Modify();
end;
end;
trigger OnRename()
var
IsHandled: Boolean;
begin
IsHandled := false;
OnBeforeOnRename(Rec, xRec, IsHandled);
if IsHandled then
exit;
ApprovalsMgmt.OnRenameRecordInApprovalRequest(xRec.RecordId, RecordId);
end;
var
PostCode: Record "Post Code";
ApprovalsMgmt: Codeunit "Approvals Mgmt.";
BankAccIdentifierIsEmptyErr: Label 'You must specify either a Bank Account No. or an IBAN.';
BankAccDeleteErr: Label 'You cannot delete this bank account because it is associated with one or more open ledger entries.';
procedure GetBankAccountNoWithCheck() AccountNo: Text
begin
AccountNo := GetBankAccountNo();
if AccountNo = '' then
Error(BankAccIdentifierIsEmptyErr);
end;
procedure GetBankAccountNo(): Text
var
Handled: Boolean;
ResultBankAccountNo: Text;
begin
OnGetBankAccount(Handled, Rec, ResultBankAccountNo);
if Handled then exit(ResultBankAccountNo);
if IBAN <> '' then
exit(DelChr(IBAN, '=<>'));
if "Bank Account No." <> '' then
exit("Bank Account No.");
end;
[IntegrationEvent(false, false)]
local procedure OnBeforeOnRename(var VendorBankAccount: Record "Vendor Bank Account"; xVendorBankAccount: Record "Vendor Bank Account"; var IsHandled: Boolean)
begin
end;
[IntegrationEvent(true, false)]
local procedure OnBeforeLookupName(xVendorBankAccount: Record "Vendor Bank Account")
begin
end;
[IntegrationEvent(false, false)]
local procedure OnValidateBankAccount(var VendorBankAccount: Record "Vendor Bank Account"; FieldToValidate: Text)
begin
end;
[IntegrationEvent(false, false)]
local procedure OnBeforeValidateIBAN(var VendorBankAccount: Record "Vendor Bank Account"; var xVendorBankAccount: Record "Vendor Bank Account"; var IsHandled: Boolean)
begin
end;
[IntegrationEvent(false, false)]
local procedure OnGetBankAccount(var Handled: Boolean; VendorBankAccount: Record "Vendor Bank Account"; var ResultBankAccountNo: Text)
begin
end;
[IntegrationEvent(false, false)]
local procedure OnBeforeValidateCity(var VendorBankAccount: Record "Vendor Bank Account"; var PostCodeRec: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean)
begin
end;
[IntegrationEvent(false, false)]
local procedure OnBeforeValidatePostCode(var VendorBankAccount: Record "Vendor Bank Account"; var PostCodeRec: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean)
begin
end;
[IntegrationEvent(false, false)]
local procedure OnDeleteOnAfterSetFilters(var VendorBankAccount: Record "Vendor Bank Account"; var VendorLedgerEntry: Record "Vendor Ledger Entry")
begin
end;
}