Security change on December 1, 2026: TLS 1.2 will become the minimum standard for 365 business Print Agent. Details and system requirements
365 business development
365 business Address Validation

Address Data API

Table 5523606 bdev.Address Data is the tenant's directory of addresses already validated or confirmed by a user.

It answers a repeated validation without a service call, and it publishes a small set of procedures another extension can call directly.

Code
addressData: Record "bdev.Address Data";

A table, not a codeunit

These procedures are instance methods on the bdev.Address Data record variable itself, not on a separate API codeunit. Most of them read or change the row the variable is currently positioned on.

Fields

FieldTypeDescription
AddressText[100]Street and house number. Part of the primary key, not editable after insert.
Address 2Text[50]Additional address information. Part of the primary key.
Post CodeCode[20]Part of the primary key.
CityText[30]Part of the primary key.
CountyText[30]Part of the primary key.
Country/Region CodeCode[10]Part of the primary key.
Address Validation StatusOptionNot Validated, Manually Checked or Validated. See Status.
Last Date ValidatedDateSet automatically whenever the status changes to anything other than Not Validated.
UsageInteger (FlowField)How many source records currently point at this address.

The six address fields together form the primary key, so two rows with the same address never exist. Changing any of them resets Address Validation Status to Not Validated.

Status

Code
Rec."Address Validation Status"::"Not Validated" Rec."Address Validation Status"::"Manually Checked" Rec."Address Validation Status"::Validated

A row starts as Not Validated on insert. It becomes Validated when the validation service has confirmed it and Manually Checked when a user confirms it by hand on the Address Data page. Both count as validated for IsValidated and IsKnownAddress.

IsValidated()

Four overloads answer whether an address is already validated, without calling the service.

Code
procedure IsValidated(): Boolean procedure IsValidated(addressBuffer: Record "bdev.Address Validation Buffer" temporary): Boolean procedure IsValidated(recordVariant: Variant): Boolean procedure IsValidated(recordVariant: Variant; addressOptionOrdinal: Integer): Boolean
ParameterTypeDescription
(none)Checks the status of the row Rec is currently positioned on.
addressBufferRecord "bdev.Address Validation Buffer" temporaryLooks up the row with this address and checks its status. false when no such row exists.
recordVariantVariantA record of one of the tables the app supports (see Address Validation API). The app builds the address from it first.
addressOptionOrdinalIntegerWhich address on the record to use, for a table that carries more than one (for example a sales document's sell-to, ship-to and bill-to addresses).

Returns true when the matching row has status Manually Checked or Validated.

IsKnownAddress(Record)

Code
procedure IsKnownAddress(var addressBuffer: Record "bdev.Address Validation Buffer" temporary): Boolean
ParameterTypeDescription
addressBufferRecord "bdev.Address Validation Buffer" temporaryThe address to look up. On a match, Rec is positioned on the found row and addressBuffer is filled with its values.

Returns true when the address is already known and validated. This is the lookup the app itself runs before calling the service: a hit here means the address does not need to go to the service again.

AddOrUpdate(...)

Inserts the address if it is not yet known, or finds the existing row, and records that source uses it. Four overloads, depending on whether the address comes from a validation buffer or from the dictionary Address Prediction API returns, and on whether the source record carries more than one address.

Code
procedure AddOrUpdate(addressBuffer: Record "bdev.Address Validation Buffer" temporary; source: Variant) procedure AddOrUpdate(addressBuffer: Record "bdev.Address Validation Buffer" temporary; source: Variant; addressOptionOrdinal: Integer) procedure AddOrUpdate(addressBuffer: Dictionary of [Text, Text]; source: Variant) procedure AddOrUpdate(addressBuffer: Dictionary of [Text, Text]; source: Variant; addressOptionOrdinal: Integer)
ParameterTypeDescription
addressBufferRecord "bdev.Address Validation Buffer" temporary, or Dictionary of [Text, Text]The address to add or update. An address with neither Address, Address 2, Post Code nor City filled is ignored.
sourceVariantThe record that uses this address, for the Usage count. Pass a record of bdev.Address Data itself to skip the usage link.
addressOptionOrdinalIntegerWhich address on source this is, for a table with more than one. Omit it, or pass -1, for a table with a single address.

This call does not validate the address and does not change its status - it only makes sure the address exists in the directory and is linked to source. Call SetValidatedManually afterwards if you know by other means that the address is correct.

SetValidatedManually()

Code
procedure SetValidatedManually()

Sets the status of the row Rec is positioned on to Manually Checked and saves it. Use this after AddOrUpdate when your own process has already confirmed the address is correct and a service call is not needed.

ResetValidation()

Code
procedure ResetValidation()

Sets the status of the row Rec is positioned on back to Not Validated and saves it. The next automatic or manual validation then calls the service again instead of answering from the directory.

Example

Code
procedure MarkBrokerAddressAsChecked(var broker: Record Broker) var addressData: Record "bdev.Address Data"; address: Record "bdev.Address Validation Buffer" temporary; begin address.Init(); address."Primary Key" := CreateGuid(); address.Address := broker.Address; address."Address 2" := broker."Address 2"; address."Post Code" := broker."Post Code"; address.City := broker.City; address.County := broker.County; address."Country/Region Code" := broker."Country/Region Code"; if (addressData.IsKnownAddress(address)) then exit; addressData.AddOrUpdate(address, broker); addressData.SetValidatedManually(); end;

AddOrUpdate does not validate

AddOrUpdate only records that an address exists and who uses it. If the address has not gone through Address Validation API and you have not called SetValidatedManually, its status stays Not Validated and IsValidated/IsKnownAddress answer accordingly.

See also

Last modified on