web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Show latest completed activity for each open opportunity

(0) ShareShare
ReportReport
Posted on by 5

Hi, 

I use Microsoft Dynamics 2016 on-premise and I want to create a report for our sales which shows the most recent completed activity per open opportunity.  I think that the relationship between opportunities and activities is quite complicated. There are two alternatives: One is a direct relationship between opp and activity. The other is that the opp is related to an account and the account has n contacts and those contacts may also have activities.

I managed to create a ReportServer report which accomplishes this but I have another solution in mind:

First I would add a custom field lastestCompletedActivity to an opportunity that stores a pointer to an activity.

Then I would want to create a process.

This process should get triggered every time when a new activity is completed. Then the process should find an optionally available opportunity to this activity (either by regarding to-relationship or by going from the contact to the account to the opportunity). Then it should check the latestCompletedActivity's actualend date and compare it to the current activity's actualend. In case the newly completed activity is "newer" then the one stored in the custom field then the lastestCompletedActivity  field should store the pointer the newly completed activity

Is that possible with processes? If yes, how can I accomplish that?

In case this is not possible using "Processes" I would like to reuse my ReportServer query to update a custom field in the MSCRM database. I know that updating fields directly via DB queries is not allowed. My problem is how could I automate the process of updating a custom field with a rather complex SQL query in any other compliant way.

Finally, I wonder how other sales teams accomplish this task:

I think checking the most recent completed activity regarding opportunities is a quite common task but there seems not standard report available in MSCRM, is there?

If you know any other Dynamics CRM forums please let me know.

I have the same question (0)
  • sdfasdf Profile Picture
    842 on at

    Hi,

    I believe your idea is a good one and it should be possible to implement such a scenario using a custom plug-in. This plug-in should run whenever you close an activity, and it can verify whether that activity is directly related to an opportunity, or if it's related to a record that is associated with the said opportunity. Once you identify this opportunity, you can update the custom field that will be used by your custom report.

    With such an approach there no need to use complex SQL queries or anything like that.

    The downside of this approach is that it will require some development effort to create the .NET-based plug-in.

    I hope it helps.

  • hheckner1 Profile Picture
    5 on at

    Hi Nathan,

    thanks for your reply.

    So it is correct that there is no standard report which shows the most recent completed activity per opportunity? Correct?

    Secondly I investigated further into whether it is possible to add a custom field to opportunity which refers to an activity. I think this is not possible. Can you confirm? So in the end you cannot develop anything because you cannot store the result on the opp. I hope that I am wrong here.

    Best regards

    Hannes

  • Suggested answer
    sdfasdf Profile Picture
    842 on at

    You´re right in the sense that you cannot create a lookup field to store a generic activity (ActivityPointer entity) reference on the Opportunity entity. However, since this is for reporting purposes only, you might want to create two text fields on the Opportunity entity: one to store the activity entity name, and another one to store it ID. These fields can be populated by the custom plug-in, and your report can rely on those fields to determine what the last activity was.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 103 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 83

#3
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 69 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans