Adding a log section to a Microsoft Dynamics CRM form - dynamics-crm-2011

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.

Related

Azure devops 2019.1 - Activity logs

I look for a way to collect and save activity and security logs from the Azure devops server(onprem 2019.1).
Logs include - user logins, build events, work item events, security changes etc.
I'm aware about this option https://server_name/tfs/_oi/_diagnostics/activityLog. But it's not an api interface.
Any Idea how it's can be implemented that?
Thanks.
TFS keeps track of an activity log of all recent activities. This information is stored in 2 tables inside Tfs_Configuration and Tfs_collectionname called tbl_Command and tbl_Parameter. These tables keep a record of every single command that every single user has executed against TFS for the last 14 days.
If you don’t want to get activity log through tbl_Command table and hidden activity log page (http://server:port/tfs/_oi), I’m afraid there is no other way at present.
You could add your request for this feature on our UserVoice site, which is our main forum for product suggestions. After suggest raised, you can vote and add your comments for this feedback. The product team would provide the updates if they view it.

Automating Approval Processes in Dynamics CRM

A bit of background before I begin.
Background:
I am working on migrating an existing .NET based system to Dynamics CRM and one of its key feature is its 'Request Approval Process'. I have implemented some simpler versions of such approval processes in past but this one is a bit complex since it involves multi-level approvals, multiple approvers at one level, amendment logic, delegation functionality, etc.
Analysis Till Now:
Before pushing this question at SO, I did a fair analysis of the requirements from my end and have come up with few possible approaches:
Workflow based approach (something on lines of this)
Complete custom logic using Plugins/Web Resources (something on lines of this)
I am not explaining the details of these approaches as of now but the core issue is that none of these two approaches are fitting correctly to my requirements.
Queries:
While analyzing these approaches I came across some newer functionalities added to CRM (listed below) but did not get any additional resources to explore them further. I just want to confirm that I am not trying to achieve something which is already present out-of-the-box or going in the incorrect direction.
1. Internal Process Automation:
Reference: Here
Any leads/thoughts on this approach? I am not able to find any good documentation/articles around this.
2. Graphical Approval Workflow:
Reference: Here
This feature seems to be useful but it is mentioned to be a part of Dynamics Marketing. With the new structuring of Dynamics 365, will this feature be a part of Dynamics CRM by default?
Also, the Prerequisites section of this link mentions certain Item Types for which you can configure this functionality. So can't we use this functionality for any entity records?
Any kind of help/inputs would be appreciated.
I'd suggest the best of both worlds: using out-of-box Workflows along with custom Workflow activities that you can write with C#. Use as much out-of-box functionality as you can, but when you need to query records or run custom logic, create a custom workflow activity that can be used in your out-of-box Workflow. Custom workflow activities are similar to plugins in that they are written using C#. You can have custom inputs and custom outputs for your activity.
For example, maybe your approval process needs to look up the appropriate approving user for this record. You could write a custom workflow activity that takes an input (the record being approved) and an output (the user that has the ability to approve). Then in your Workflow, you'd add your custom activity as a step. After that step, you could send an email to the approver by using the output of that custom step.
More information about custom workflow activities: https://msdn.microsoft.com/en-us/library/gg309745.aspx

CRM Workflow Does not show availability to update related entity record

Two custom entities "Detailings" and "Project Managements". The project management is the parental relationship to the detailing. I'm trying to create a workflow for when fields change in project management to update fields in detailings. However detailings is not an available related entity type in the process. What am I missing? See screen shots attached.![enter image description here][1]
You are not missing something. The OOB steps of a workflow don't permit to access to the related entities.
You need to install in your CRM a custom workflow activity, as this one:
http://crm2011distributewf.codeplex.com/
It will make you run a workflow for each related entity in order to update each single record.
The configuration requires a bit of technical knowledge, but in the bottom of the page there is also a link to download the instructions.

How to copy Notes and Activities while converting Contact to Lead in Microsoft Dynamics CRM 2011

I have a requirement to copy all Notes and Activities while converting Lead to Contact and vice versa.
When I Qualifying Lead to Contact I use my custom plugin which is triggered by QualifyLead event. There is no out of the box solution to convert Contact to Lead so I use my custom on-demand dialog. But this dialog unable to run my custom plugin (which will copy Notes and Activities from Contact to Lead).
Please help me to find a way to copy all this stuff from Contact to Lead.
You can create a Custom Workflow Activity with the code of your custom plugin and uses as step inside your on-demand dialog.
You can start from here:
http://msdn.microsoft.com/en-us/library/gg328515.aspx
Another way that you can do this is to simply reference the notes from the Lead in the Contact, Account, or Opportunity entities using an IFrame and some JavaScript as described in http://030bacf.netsolhost.com/WordPress/?cat=69 . Depending on how many records you have, potentially this could even be a better solution since you are only keeping one copy of the notes which will help keep the size of the database more manageable and performance better. Or you could use this solution for the notes and the solution recommended by Guido for the Activity records. I had to make a change to the URL used for CRM 2013 and have copied that part below.
//src="/"+context.getContext().getOrgUniqueName()+"/_controls/note/notesdata.aspx?id="+lookupItem[0].id+"&ParentEntity=3&EnableInlineEdit=false&EnableInsert=false";
// change to this for CRM 2013
src=serverUrl+"/"+Xrm.Page.context.prependOrgName("/_controls/notes/notesdata.aspx?id="+lookupItem[0].id+"&ParentEntity=3&EnableInlineEdit=false&EnableInsert=false");

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

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/

Resources