locked
Get Activities whose status has been changed in dynamic CRM RRS feed

  • Question

  • Hi,

    I would like to get all the Activities whose status has been changed from the last 24 hours.

    Is there a way i can achieve this using CRM SDK?

    Thanks,

    Pooja 


    • Edited by G Pooja Monday, February 8, 2016 4:57 AM
    Monday, February 8, 2016 4:53 AM

All replies

  • Hi,

    You can't get the activities that have changed status the past 24h in an easy way. There is a modifiedon field which tells you when the object is changed which tells you when a record is changed, to see which field is changed you would have to query the Audit, which should be possible but I haven't done that yet.

    Regards


    Rickard Norström Developer CRM-Konsulterna
    http://www.crmkonsulterna.se
    Swedish Dynamics CRM Forum: http://www.crmforum.se
    My Blog: http://rickardnorstrom.blogspot.se

    Monday, February 8, 2016 9:25 AM
  • The approach via the SDK would be:

    1. Use a QueryExpression (or Fetch) to find all records modified in the last 24 hours, based on the modifiedon field
    2. Loop through the results and execute a RetrieveAttributeChangeHistoryRequest for each record to get the audit of all changes to the statecode (or statuscode)

    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    Monday, February 8, 2016 1:53 PM
    Moderator
  • Hi,

    If this is a really must-have feature, one way of doing it would be a datetime field that you stamp when someone changes status of the record, that would be very searchable. It will not be something you would want to implement for every field though, but if it is just status you're looking for it shouldn't impede performance much.

    Regards


    Rickard Norström Developer CRM-Konsulterna
    http://www.crmkonsulterna.se
    Swedish Dynamics CRM Forum: http://www.crmforum.se
    My Blog: http://rickardnorstrom.blogspot.se

    Monday, February 8, 2016 2:13 PM