ALAppExtensions
ALAppExtensions copied to clipboard
Table 5050 Contact add event "OnBeforeCreateLink"
Additional Event needed:
OnBeforeCreateLink(Rec: Contact; var IsHandled: boolean);
procedure CreateCustomerLink()
var
Cust: Record Customer;
ContBusRel: Record "Contact Business Relation";
begin
CheckForExistingRelationships(ContBusRel."Link to Table"::Customer);
CheckIfPrivacyBlockedGeneric;
RMSetup.Get();
RMSetup.TestField("Bus. Rel. Code for Customers");
**OnBeforeCreateLink(Rec: Contact; var IsHandled: boolean);**
**if IsHandled then**
**exit;**
CreateLink(
PAGE::"Customer Link",
RMSetup."Bus. Rel. Code for Customers",
ContBusRel."Link to Table"::Customer);
ContBusRel.SetCurrentKey("Link to Table", "Contact No.");
ContBusRel.SetRange("Link to Table", ContBusRel."Link to Table"::Customer);
ContBusRel.SetRange("Contact No.", "Company No.");
if ContBusRel.FindFirst then
if Cust.Get(ContBusRel."No.") then
#if not CLEAN18
UpdateQuotes(Cust, '');
#else
UpdateQuotesFromTemplate(Cust, '');
#endif
OnAfterCreateCustomerLink(Rec);
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.