20. Januar 2015 18:25
25. Januar 2015 18:47
IF EMail = '' THEN
EXIT(FALSE);
WITH Cont DO BEGIN
IF STRLEN(EMail) > MAXSTRLEN("Search E-Mail") THEN
EXIT(FALSE);
SETCURRENTKEY("Search E-Mail");
SETRANGE("Search E-Mail",EMail);
IF FINDFIRST THEN BEGIN // Der Erste gewinnt
SegLine."Contact No." := "No.";
SegLine."Contact Company No." := "Company No.";
SegLine."Contact Alt. Address Code" := '';
EXIT(TRUE);
END;
END;
WITH ContAltAddress DO BEGIN
IF STRLEN(EMail) > MAXSTRLEN("Search E-Mail") THEN
EXIT(FALSE);
SETCURRENTKEY("Search E-Mail");
SETRANGE("Search E-Mail",EMail);
IF FINDFIRST THEN BEGIN // Der Erste gewinnt
SegLine."Contact No." := "Contact No.";
Cont.GET("Contact No.");
SegLine."Contact Company No." := Cont."Company No.";
SegLine."Contact Alt. Address Code" := Code;
EXIT(TRUE);
END;
END;
EXIT(FALSE);