Hallo pbeele, hallo LEAB,
ich habe heute mal den Schulterschluss zwischen 3CX und Sage gemacht.
Ich bin nach der Anleitung vorgegangen.
3CX lokal im Firmennetz, daher kann diese auch ohne Probleme den SQL Server erreichen.
Wichtig, alle angegebenen Felder müssen zurückgeliefert werden.
Hier das Lookup-By-Number-Statement:
SELECT * FROM (select A.Adresse as contactid, Replace(Replace(isnull(A.Telefon,''),' ',''),'-','') as phonebusiness, K.Kto +' - ' + K.Matchcode as companyname, 'Zentrale' as lastname, Replace(Replace(isnull(A.Mobilfunk,'') ,' ',''),'-','') as phonemobile, '' as firstname, '' as phonemobile2, '' as phonehome, '' as phonehome2,'' as phonebusiness2, '' as phoneother, '' as faxhome, '' as faxbusiness, '' as pager, '' as photourl, isnull(A.EMail,'') as email FROM KHKAdressen A INNER JOIN KHKKontokorrent K ON K.Adresse = A.Adresse AND K.Mandant=A.Mandant WHERE K.Aktiv=-1 AND A.Aktiv=-1 AND isnull(A.Telefon,'') <>'' UNION select -P.Nummer, Replace(Replace(isnull(P.Telefon,'') ,' ',''),'-',''), K.Kto + ' - ' + K.Matchcode, P.Ansprechpartner, Replace(replace(isnull(P.Mobilfunk,''),' ',''),'-',''), '' as firstname, '' as phonemobile2, '' as phonehome, '' as phonehome2,'' as phonebusiness2, '' as phoneother, '' as faxhome, '' as faxbusiness, '' as pager, '' as photourl, isnull(P.Email,'') as email FROM KHKAnsprechpartner P INNER JOIN KHKKontokorrent K ON P.Adresse=K.Adresse AND P.Mandant=K.Mandant WHERE K.Aktiv=-1 AND (isnull(P.Telefon,'') <>'' OR isnull(P.Mobilfunk,'') <>'') ) AS TAB WHERE phonebusiness LIKE '%[Number]%' or phonemobile like '%[Number]%'
Die bisherigen Tests funktionieren soweit, bei Fragen könnt Ihr Euch gerne melden.
Gruss Mark