Dynamics CRM 2011 Online - How to total the duration for activities - dynamics-crm-2011

I have a requirement to total the durations of all activities related to a custom entity. I have created a custom entity that allows the user to add activities for that instance of the custom entity. Every time an activity is added to the custom entity I need to total the duration and update the custom entity. I started by creating a plugin for an activity. The problem is the only messages you can create the plugin for is retrieve and retrivemultiple. I then went to service activity to create the plugin and I cold create it using the create message.
My question is, is every activity a service activity? Has anyone done this and do you have any tips on the best way to go about it?
Thanks,
Gary

It sounds like you are looking for a plugin or custom workflow that operates on the “parent” entity (the entity the activities are related to.) You would write your code to use the RetrieveMultiple method and then loop through the result totaling the value as you go.
IOrganizationService.RetrieveMultiple Method
http://msdn.microsoft.com/en-us/library/microsoft.xrm.sdk.iorganizationservice.retrievemultiple.aspx
Rolling Up Custom Entities in Microsoft CRM 2011 and CRM Online
http://www.catapulterp.com/rolling-up-custom-entities-in-microsoftcrm-2011-and-crm-online/

Related

Adding a log section to a Microsoft Dynamics CRM form

I am managing a projects (subtype of Activity) collection and I would like to implement a simple "Status change" log.
The idea would be that of replicating the simple but effective order management log seen in Prestashop (see image), Order management screen: User selects the new project status, clicks [UPDATE STATUS], and a new row gets appended to the log with new status, date of the change, person having triggered the change.
The basic implementation could be a text area used as a log, the best implementation possible would be that of having a grid.
Could somebody point me in the right direction to do this?
I am using version 2011 but moving to 2015 in a few days.
I suggest using auditing:
The following list identifies the data and operations that can be audited:
Create, update, and delete operations on records.
You could have an OptionSet representing the status of a project. If you enable auditing on this field (and enable auditing in general for CRM) you will be able to see an audit history of changes to the field. To do so users will have to navigate to the Audit History of the record.
The audit history will look similar to the following (in 2011):
If you don't want to use Auditing as suggested by Henrik in his answer, the alternative is to create a custom entity that will act as a log entity for your status change.
In order to implement the track of the changes, you need to implement a Plugin that will be triggered on the update message and will create the records inside the new custom entity.

Mapping Appointment Entity for Data Migration in Microsoft Dynamics CRM 2015

I need to migrate data from CRM 2011 to CRM 2015 for different entities. I am using scribe insight for this purpose. I am stuck with the the migration of different entities belonging to Activities like Appointment, Letter, Fax, etc.
If its a normal lookup field i would have used something like
DBLOOKUP(S25,"CRM 2015","Lookup Entity name","Matching field","Primary key")
There is a field type named 'Party List' which is lookup to multiple entities. How do I map this? So that I can easily migrate data from 2011 to 2015?
I think you're saying you want to migrate Activity records from CRM2011 to CRM2015. I've done something very similar from CRM4 to 2011, using Scribe Insight.
PartyList is a composite field, built from ActivityParty records. You don't write to it directly.
An ActivityParty record links an Activity (eg, email, task) to a Party (eg, account, contact, user, lead).
The sequence of events is:
Migrate Party records (contacts, accounts etc).
For each Activity in CRM 2011
Create an Activity in CRM 2015
For each ActivityParty belonging to the Activity in CRM2011
Create an ActivityParty in CRM2015
Set the status of the CRM2015 Activity to that of the CRM2011 Activity.
Some points to note:
ActivityParty records are somewhat special in CRM. They don't support all messages. Specifically, the can't be updated - only created or deleted.
You can only set the status of the Activity after you've added all the activity parties. CRM will generate an error if you try to add an activityparty to a completed activity.
Hope this helps
Mike
Based on your DBLookup code you use Scribe for migration. I'm not an expert in Scribe so I would suggest to use search engine to find relevant information. Try to use this search.

CRM 2011: Plugin to update Incident on new activity added

I have a requirement to create a Task when a new activity as added to an Incident (Case). I Think can be achieved by triggering a workflow on Activity Creating and check the regarding field. If regarding entity is a Case then run a custom workflow activity to create task.
I think running workflow on each activity creating might be bit overkill. Is there any way to create a plugin to trigger on activity added to Case?
Thanks
You can create plugin that will be triggered after activity is created. But you will have to validate that activity was created related to case in the body of the plugin.

Workflow on "Activity"?

I'm trying to have CRM 2011 share activities to a Team if the user that created the record is part of another team.
Firstly, is it possible to create either a custom or basic workflow on "Activities" instead of having to create a workflow on each type of activity (Appointement, Phone Call, E-mail, etc.) that does the same thing on each of them ?
Secondly, I see the basic workflows wizard allows you to Assign activities to another team, but I don't see the Share action anywhere. Is this a job for a custom, .NET assembly, workflow ?
Thank you!
You need to select the exact entity when you create a workflow, this means you need to create a worklow for each activity entity-type (1 for Appointment, 1 for Phone Call, ...)
There isn't a built-in share functionality inside the standard Workflow designer, you need to use a custom activity (create one using .NET or install one already compiled)
Check these two:
http://crm2011workflowutils.codeplex.com/
http://crm2011sharestep.codeplex.com/

How to store 'event' entity type in MS Dynamics CRM

What is the best way to capture events within Dynamics CRM?
E.g I know these 100 contact attended a conference / seminar on Product X, and I would like to capture that data within the system for email campaigns / reporting.
I was surprised that I wouldn't find any activity of this type.
I think this is more of a business question.
You should build a Conference (event) entity and relate the attendees (100 contacts) either manually or by some automated process.
This will enable you to use that information in any report.
Try the Customer Portal Accelerator.
It was initially called the Event Management Accelerator but the name has changed since and additional functionality has been added
http://dynamics-crm.pinpoint.microsoft.com/en-US/applications/customer-portal-for-microsoft-dynamics-crm-2011-12884910826

Resources