locked
Getting the To field in a phone call activity RRS feed

  • Question

  • I'm trying to get the 'to' field on a phone call activity. I'm writing an SQL query (which will be used for a report in VS 2008), and I'm trying to use the PartyId in the ActivityPartyBase table. I'm joining to the ActivityPointerBase table, and passing in the activity id. But this is giving me 4 results - it's including the 'regarding' too, but I just want want the 'To' field (displayed as 'Recipient', but its schema name is 'To').

    Here's a example of some SQL I've tried. 

    select PartyId, PartyIdName, A2.ActivityId from ActivityPartyBase AP2
    join ActivityPointerBase A2 on A2.activityid = AP2.ActivityId
    where AP2.activityid = '4427AA44-632C-E411-9D8C-00155D3FE201'
    Thanks.
    Monday, August 25, 2014 4:28 PM

All replies

  • Hi,

    4210 means phonecall activity and participationtypemask = 2 means ToRecepient

    select * from activityparty ap
    inner join activitypointer apo on ap.activityID = apo.activityID
    where apo.activitytypecode =4210 and ap.participationtypemask = 2

    Here you can see the participationtypemask values

    http://msdn.microsoft.com/en-us/library/gg328549.aspx

    Polat Aydın Crm Software Developer



    Monday, August 25, 2014 5:08 PM
  • Hello,

    please use filtered view instead of queries to the tables.

    regards,

    Jithesh

    Monday, August 25, 2014 10:49 PM