Personalized Community is here!
Quickly customize your community to find the content you seek.
Choose your path Increase your proficiency with the Dynamics 365 applications that you already use and learn more about the apps that interest you. Up your game with a learning path tailored to today's Dynamics 365 masterminds and designed to prepare you for industry-recognized Microsoft certifications.
Visit Microsoft Learn
2020 Release Wave 2Discover the latest updates and new features to Dynamics 365 planned through March 2021.
Release overview guides and videos Release Plan | Preview 2020 Release Wave 2 TimelineWatch the 2020 Release Wave 1 virtual launch event
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Upcoming TechTalks
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 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.
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.
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.
Business Applications communities