microsoft / ALAppExtensions

Repository for collaboration on Microsoft AL application add-on and localization extensions for Microsoft Dynamics 365 Business Central.
MIT License
773 stars 610 forks source link

[Event Request] Codeunit 28000 "Post Code Check" #26731

Closed rubi-rtr closed 1 week ago

rubi-rtr commented 3 months ago

Describe the request

We would like to request the addition of a new event within the VerifyAddress internal procedure.

` internal procedure VerifyAddress(CurrentFieldNo: Integer; TableNo: Integer; TableKey: Text; AddressType: Option Main,"Bill-to","Ship-to","Sell-to","Pay-to","Buy-from","Transfer-from","Transfer-to"; var Name: Text[100]; var Name2: Text[50]; var Contact: Text[100]; var Address: Text[100]; var Address2: Text[50]; var City: Text[30]; var PostCode: Code[20]; var County: Text[30]; var CountryCode: Code[10]) begin if (PostCode = '') or (City = '') or (CurrentFieldNo = 0) or (not GuiAllowed) then exit;

New Event - begin OnBeforeGetAddressValidationSetup(CurrentFieldNo, TableNo, TableKey, AddressType, Name, Name2, Contact, Address, Address2, City, PostCode, County, CountryCode); <<< New Event - end

    GetAddressValidationSetup(CountryCode);
    case Country."Address Validation" of
        Country."Address Validation"::"Entire Address",
        Country."Address Validation"::"Address ID":
            RunAddressValidation(
              TableNo, TableKey, AddressType, 3,
              Name, Name2, Contact, Address, Address2, City, PostCode, County, CountryCode);
    end;
end;`

[IntegrationEvent(false, false)] procedure OnBeforeGetAddressValidationSetup(CurrentFieldNo: Integer; TableNo: Integer; TableKey: Text; AddressType: Option Main,"Bill-to","Ship-to","Sell-to","Pay-to","Buy-from","Transfer-from","Transfer-to"; var Name: Text[100]; var Name2: Text[50]; var Contact: Text[100]; var Address: Text[100]; var Address2: Text[50]; var City: Text[30]; var PostCode: Code[20]; var County: Text[30]; var CountryCode: Code[10]) image

Additional context

We are using this procedure to validate addresses in extended fields. However, the environment is failing to upgrade to V24 because the 'ValidateAddress' procedure no longer exists. We cannot use its replacement, VerifyAddress, due to its protection level. Internal work item: AB#539223

JesperSchulz commented 1 week ago

Availability update: We will publish a fix for this issue in the next update for release 24.

Build ID to track: 24746.