Using Dynamics Web API to Retrieve List of Leads that have been Reassigned

62 views Asked by At

I require some assistance with Dynamics. I am trying to find a list of leads that have had their ownership changed recently. Specifically, I am looking for leads that were originally assigned to 'Person 1' and have been reassigned to 'Person 2' within a specified timeframe.

Screenshot of Lead Assignment Process

To achieve this, I am considering the following approaches:

  • Is there any API endpoint that I can utilize to query Dynamics to retrieve leads that have had their ownership changed during the specified timeframe?

  • Alternatively, is there an event in Dynamics that captures lead reassignment, which I can utilize to extract the required information?

  • Are there any other methods to find such leads?

Any guidance or suggestions that you can provide would be greatly appreciated.

1

There are 1 answers

0
Andrew Butenko On

The only way OOB to find that the record was reassigned is to turn on Auditing of the record and mark OwnerId as auditable. Then, theoretically, it would be possible to query that information but not until then.

I would recommend using another approach:

  1. Create a custom entity that will have a lookup that points to the lead and user.
  2. On creating of lead/Update of the owner create a record in that custom table with references to the lead and user.
  3. Once that's done you will have your own "easy-to-query" audit that would you be able to query and get whatever information you need.