ALAppExtensions
ALAppExtensions copied to clipboard
[Event Request] Table 38 "Purchase Header", field 53 "Applies-to Doc. No.", OnValidate trigger; OnBeforeValidateAppliesToDocNo
Hello, we need additional validation in field 53 of Purchase Header table, thank you in advance.
field(53; "Applies-to Doc. No."; Code[20])
{
trigger OnValidate()
var
// - 22.11.21 NDA ND#0303347
// moved to the subscriber OnValidateDocumetType in oodeunit "Purchase Header MGB"
// VendDepLedgEntryL: Record "Vend. Deposit Ledger Entry";
// + 22.11.21 NDA ND#0303347
IsHandeld: Boolean;
begin
if "Applies-to Doc. No." <> '' then
TestField("Bal. Account No.", '');
// - new
IsHandeld := false;
OnBeforeValidateAppliesToDocNo(Rec, IsHandeld);
if IsHandeld then
exit;
// + new
if ("Applies-to Doc. No." <> xRec."Applies-to Doc. No.") and (xRec."Applies-to Doc. No." <> '') and
("Applies-to Doc. No." <> '')
then begin
SetAmountToApply("Applies-to Doc. No.", "Buy-from Vendor No.");
SetAmountToApply(xRec."Applies-to Doc. No.", "Buy-from Vendor No.");
end else
if ("Applies-to Doc. No." <> xRec."Applies-to Doc. No.") and (xRec."Applies-to Doc. No." = '') then
SetAmountToApply("Applies-to Doc. No.", "Buy-from Vendor No.")
else
if ("Applies-to Doc. No." <> xRec."Applies-to Doc. No.") and ("Applies-to Doc. No." = '') then
SetAmountToApply(xRec."Applies-to Doc. No.", "Buy-from Vendor No.");
end;
}
[IntegrationEvent(false, false)]
local procedure OnBeforeValidateAppliesToDocNo(var PurchHeader: Record "Purchase Header"; var IsHandeld: Boolean)
begin
end;
Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.