locked
Displaying a date-time stamp on the case entity view in MS CRM 2011 RRS feed

  • Question

  • Hi We are a software development and systems integrator. We are working on a CRM system built on Microsoft CRM 2011. Whilst calling the Service Module, we are face with challenges regarding the a case (to handle incident request/logging). We need to display a column (CreatedOn) that shows the date and time a case is created on incident ticket entity. Currently the "incident" View shows the incident ticket created date without the timestamp. The date is also show (without the timestamp) on the "resolve" case View. How do we show the timestamp in the "incident" and "resolution" entity (view). Secondly, it is noted that the resolution entity/form is a hidden form (in that it cannot be design within Visual Studio). How do we implement or call the resolved case form from within Visual Studio in order to be able to customize it in Visual studio We need to add a column that displays a date-time (date and timestamp) on the case view. This view should display the date and time an incident (case) was closed on the case entity

    Many thanks

    Yuwa

    Monday, August 1, 2011 10:05 PM

Answers

  • Go to customisations- open the entity and look at the createdon fields properties. Make sure in the "format" field, it says "Date and Time" not "Date Only".

    You can create a create a custom field on case entity for Closed on Functionality and create a workflow on "status change". When the case is resolved update that field with "execution time" value.

     

     

    I hope it helps


    Amreek singh Senior CRM Consultant CDC Praxa Sydney,Australia http://mscrmshop.blogspot.com/
    • Proposed as answer by Donna EdwardsMVP Wednesday, August 3, 2011 4:38 PM
    • Marked as answer by Jim Glass Jr Thursday, August 4, 2011 5:30 PM
    Tuesday, August 2, 2011 12:33 AM

All replies

  • Go to customisations- open the entity and look at the createdon fields properties. Make sure in the "format" field, it says "Date and Time" not "Date Only".

    You can create a create a custom field on case entity for Closed on Functionality and create a workflow on "status change". When the case is resolved update that field with "execution time" value.

     

     

    I hope it helps


    Amreek singh Senior CRM Consultant CDC Praxa Sydney,Australia http://mscrmshop.blogspot.com/
    • Proposed as answer by Donna EdwardsMVP Wednesday, August 3, 2011 4:38 PM
    • Marked as answer by Jim Glass Jr Thursday, August 4, 2011 5:30 PM
    Tuesday, August 2, 2011 12:33 AM
  • Thanks a lot  Amreek

    I have been able to display Date and Time on the case view from your description. However when I executed the workflow that updates a custom field (Date Resolved) of format Date and Time, on status change with the "execution time"value of the process entity, it gave me the following error "The object cannot be updated because it is read-only". What do you think could be the problem?

    Tuesday, August 2, 2011 3:14 PM
  • Hi,

    Yes because when you resolve the case then system change the entity status to Resolved and make it inactive for any changes (workflows always run after the actualy action has been performed). In this scenerio i would suggest you develop a plugin (http://msdn.microsoft.com/en-us/library/gg695782.aspx) register its step on SetStateDynamicEntity message on incident entity in Pre-Operation stage, your code will be look like like:

    IOrganizationServiceFactory jj_serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));    
    
    IOrganizationService jj_CrmService = jj_serviceFactory.CreateOrganizationService(context.UserId);
    

    // Check if SetState message is triggered on phone call entity if (context.InputParameters.Contains("EntityMoniker")
    && context.InputParameters["EntityMoniker"] is EntityReference
    && ((EntityReference)context.InputParameters["EntityMoniker"]).LogicalName == "incident")
    {
     switch (context.MessageName)
     {
    case "SetStateDynamicEntity":

    // check if input parameter contains status
    if (context.InputParameters.Contains("Status"))
     {
    // Check if status paramter value (statusreason) is = Problem Resolved
       if (((OptionSetValue)context.InputParameters["Status"]).Value == 5)
     {   

    Entity jj_CaseEntity = new Entity("incident");
    jj_CaseEntity.Attributes.Add("incidentid", Guid.Empty);

    // make sure to change the field name case_resolution_date_time below with the one that you have created
    jj_CaseEntity.Attributes.Add("case_resolution_date_time", DateTime.Now);
    jj_CrmService.Update(jj_CaseEntity);  

    }


    }
     }
    }

     

     


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Tuesday, August 2, 2011 5:50 PM
  • In the workflow, you have to fist change the status of the Case to allow for an update then close the case after updating the value. 

    As another option, train users to close Cases using the Run Workflow button and then in the workflow, you first update the field then close the Case.  I hope it helps.


    Regards, Donna

    Wednesday, August 3, 2011 4:38 PM
  • Hi Donna,

    I respect the opinion of everyone and agree with you on this point.


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".


    Wednesday, August 3, 2011 9:01 PM
  • Thanks for considering the feedback Jehanzeb.

    Regards, Donna

    Wednesday, August 3, 2011 11:00 PM
  • Hi

    As Donna said, you cannot make changes to the resolved case.

    Check if the status is resolved and that field is empty , change the status to open, update the field and change the status back to resolved.

     

    This will work.


    Amreek singh Senior CRM Consultant CDC Praxa Sydney,Australia http://mscrmshop.blogspot.com/
    Thursday, August 4, 2011 12:01 AM