?
Solved

MS CRM 4.0:  Populating a date field in a resolved case

Posted on 2010-08-25
8
Medium Priority
?
2,391 Views
Last Modified: 2013-11-24
I have created an attribute in the Service Case entity called 'Resolved On'.  Its is a datetime field.  When a case is resolved, I want this field populated with the date and time that the resolution occurred.  I would prefer if it populated this field by copying the date/time from the "Created On' field of the associated Case Resolution activity, but could settle for it being the current date time.

I tried to do this via a workflow, but found that a) you cannot modify the Resolved On field because the case is closed and now read-only and b) you can't select the date field in the resolution activity to copy the date from!

Does anyone have any suggestions on how I could populate this Resolved On field with the date/time of case resolution?  I'm not much of a programmer, but I might be able to do some simple scripting if I have examples to follow.
0
Comment
Question by:I_play_with_DNA
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 7

Expert Comment

by:stacko111
ID: 33526078
Before going down the customization route, just a sugeestion, but wouldn't the Modified On field on the case be very similar, if not the same as the Resolved On date?

If this is the case then you don't need to do any customization - just use that.
0
 

Author Comment

by:I_play_with_DNA
ID: 33526163
A good thought, but the modified date can be modified by system processes, even though the user cannot modify the record.  So the modified date often does not reflect the resolution date.
0
 
LVL 7

Accepted Solution

by:
stacko111 earned 2000 total points
ID: 33526461
I've tried to find how you can fire some javascript on the Case Resolution event but I don't think it is possible. In my searching I did find that this question has been asked before and a few workarounds have been suggested:

http://www.experts-exchange.com/Microsoft/Applications/Microsoft_Dynamics/Q_24217913.html

However I've just had another thought - why don't you add some javascript into the OnSave event of the form that updates your Resolved On Field with the current date. That way when the case is finally resolved it will have the date it was last saved on which should be the same.

I'm not sure if this field would be updated like the Modified On is - you would need to test that.

The code to do this would be:

crmForm.all.yourfield.DataValue = new Date()

You could even hide the field on the form so the users don't even know its there:

crmForm.all.yourfield_c.style.visibility = 'hidden';
crmForm.all.yourfield_d.style.visibility = 'hidden';

The drawback I can think of is that this field would always be populated, I don't know if that is an issue for you
0
Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

 

Author Comment

by:I_play_with_DNA
ID: 33526856
@stacko111:
I kind of like where this solution is heading.  It brings up a couple of other questions though.

Using this code, the field will be updated when a user clicks save on the form.  However, at the point of case resolution I, and I'm assuming other users, don't hit save; we just choose Action -> Resolve Case.  Do you know if this action also triggers OnSave events?  Any modifications to the form content are certainly saved when 'Resolve Case' is clicked; I just don't know if this action triggers OnSave events.

Also, in what order would the OnSave event script be run?  When a case is resolved, the record becomes read-only.  Do you know if the script will run prior to the record being marked read-only, or can scripts over-ride the read-only status?  I know I can test this, but I thought I would ask in case you already knew the answers.
0
 
LVL 7

Expert Comment

by:stacko111
ID: 33526959
I would assume that the Case Resolution does trigger the OnSave event and update the field, the problem may be that the field is updated by system processes like the Modified On field.
0
 
LVL 7

Expert Comment

by:stacko111
ID: 33532643
I've had a chance to test this and from what I can see it works fine (as long as the field is not set to be Read Only on the form).

I'm just wondering about these system processes you mentioned that update the Modified On date as they may also change this field - but I'm not aware of any myself. I don't think workflows can update a Case once it is resolved as the record becomes Read Only.
0
 

Author Comment

by:I_play_with_DNA
ID: 33533505
@stacko111:
I'm not sure exactly what processes modify the case either; I've never been able to track them down.  But we do find cases in our system where the modified on date is AFTER the case resolution date, indicating that it must have been a system process of some sort, since neither users or workflows can modify the record after resolution.
0
 
LVL 11

Expert Comment

by:rakeshAgarwal
ID: 33584654
hi

 You can write a javascript  posted in my blog.  Kindly check if this helps

http://www.dynamicsexchange.com/Blogs/User.aspx?Tableid=176
0

Featured Post

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I showed you how to use console view (HERE (http://www.experts-exchange.com/articles/18379/Getting-Started-and-Using-the-Salesforce-com-Console.html)) -– but how do you set it up on the admin side of Salesforce? Note that you have to have Admin leve…
Desired Skill Set for Microsoft Dynamics CRM Technical Resources – Part I
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question