Dynamics 365的通话记录phonecall,ActivityPointer和phonecall的关系
SELECT top 100 P.ActivityId, -- PhoneCall ID P.Subject, -- PhoneCall Subject -- AP.PartyId, -- Recipient ID con.FullName -- Recipient Name ,l.leadid,l.parentcontactid,con.emailaddress1,ca.createdon,ca.phonenumber FROM ActivityPointer AS P Inner join lead l on p.regardingobjectid=l.leadid --关于是Lead的写法 inner join contact con on l.parentcontactid=con.contactid inner join phonecall ca on p.ActivityId=ca.ActivityId WHERE P.ActivityTypeCode = 4210 -- PhoneCall Activity Type Code order by ca.createdon desc
记得收藏并关注,掌握更多相关知识!!!