We use CRM 2013 On-Premises (Rollup 2, UR2) in the UK with DB language British English and have had a problem with the created, modified date that is displayed at the bottom of each note since upgrading from CRM 2011.
The note dates all say 'Today' with the correct time, and if the date is less than the 5th of the month then 'a' date is shown except its got the month and day mixed up, e.g. its read a UK date from the DB and switched it to a USA date somewhere, 04/01/2014 shows as 1st April 2014... Wrong!! this is the UK, and when it finds a DB date '05/01/2014' it just shows 'Today' thus the application must be erroring trying to convert a UK date to USA.
Please can MS fix this BUG already!!
This issue is driving me crazy, too. We need the date on the case note in Australian format.
Does anyone have a fix or, at least, a workaround besides manually entering the date in each case note?
Just adding another voice (also Australian) who is experiencing this issue :(
you can update the notesv2.js(for service pack 1) or notes.js(before service pack 1) under Program Files\Microsoft Dynamics CRM\CRMWeb\_static\_forms
for notesv2.js, update the following code to swap the date and month because the new date() function only takes US format date string:
$v_0.modifiedOn = (new Date(annotationUI.ModifiedOn.toString()));
after clear your browser cache, you should be able to see the correct date, but this is UNSUPPORTED by MS.
I'm not sure what format the inputs (annotationUI.CreatedOn.toString()) are long,short or other format and so manipulating the string would be difficult and prone to problems.
Please can advise on what the solution should look like?
The format of annotationUI.CreatedOn.toString() looks like this 15/05/2012 1:10:19 p.m. for example.
so we can use following JS code to swap the day and month for CreatedOn:
Apply the same technique to ModifiedOn.
Again, this JS file may get overwritten when you install update in the future.
Thank you for taking the time to show us an example, however this has failed and it seems that the problem is deeper in the CRM application, I proved this by using your code and hard coded the dates to see where the problem occurs, this is what I used;
createdOnParts="2014 10:32 pm";
The above returns 'Today 10:32:00' in the CRM application, if I set createdOnParts=05 then the CRM application returns '23 May 2014 10:32:00'.
So there it appears re-formatting the dates in JS will not help and the problem is in the date handling in the application.
Why won't MS fix this???
Opps... my bad! It would've helped if I had used 2013 and not a date greater than today! so with
createdOnParts="2013 10:32 pm";
the returned text is '23 June 2013 10:32 pm' as it should be. I just need to find out why your code generates an error, there must be a difference on the format of the date.
I've used an alert to display the text of annotationUI.CreatedOn.toString() and the format is very strange looking and I'm not sure what's going on with the year? Here's a couple of results;
Wed Feb 3 09:01:57 UTC 2016
Tue Jun 3 10:36:02 UTC +0100 2014
I can see why your code doesn't work now :o(
I've checked further into this and it seems the problem must in the population of the AnnotationCollection which is holding dates in UTC format but whatever populates the class must be expecting a US format date from the DB but receiving a UK date and so it's messing up the UTC date.
The results I get from the UI dates compared to the DB dates are as follows;
annotationUI.CreatedOn : Wed Nov 12 16:18:24 UTC 2014
DB createdDate : 2014-03-26 09:01:57.000
annotationUI.ModifiedOn:Wed Feb 3 08:54:01 UTC 2016
DB ModifiedDate : 2014-03-26 09:01:57.000
Can you offer any further advice?
My annotationUI.CreatedOn format is different from yours: 15/05/2012 1:10:19 p.m.
you need to figure out why the annotationUI.CreatedOn is Wed Nov 12 16:18:24 UTC 2014 if your DB createdDate is 2014-03-26 09:01:57.000.
You can check the original data send back from the service (open your browser developer tool and capture the network traffic, click the NOTES on your entity form enforce to refresh the notes, you will see a post request/response for /AppWebServices/Annotation.asmx then check the response body)
Thanks for your advice, it seems I'm getting a little closer, I must have got the dates mixed up before but now I've tied them back to the note subject and this is the results I get from the DB, the Java Code and the browser, the java dates are confused but the dates sent to the browser are correct, how can that be?
DB Created: 2014-03-11 12:50:46.000
DB Modified: 2014-06-12 09:06:03.000
annotationUI.CreatedOn: Mon Nov 3 12:50:46 UTC 2014
annotationUI.ModifiedOn: Sat Dec 6 10:06:03 UTC 2014
Browser <CreatedOn>11/03/2014 12:50:46</CreatedOn>
Browser <ModifiedOn>12/06/2014 10:06:03</ModifiedOn>
DB Created: 2013-12-23 16:18:24.000
DB Modified: 2014-03-26 08:54:01.000
annotationUI.CreatedOn: Wed Nov 12 16:18:24 UTC 2014
annotationUI.ModifiedOn: Wed Feb 3 08:54:01 UTC 2016
Browser <CreatedOn>23/12/2013 16:18:24</CreatedOn>
Browser <ModifiedOn>26/03/2014 08:54:01</ModifiedOn>
DB Created: 2014-03-26 09:01:57.000
DB Modified: 2014-03-26 09:01:57.000
annotationUI.CreatedOn: Wed Feb 3 09:01:57 UTC 2016
annotationUI.ModifiedOn: Wed Feb 3 09:01:57 UTC 2016
Browser <CreatedOn>26/03/2014 09:01:57</CreatedOn>
Browser <ModifiedOn>26/03/2014 09:01:57</ModifiedOn>
I think you just need to modify the code of composing the annotationUI.ModifiedOn (swap day and month).
Or you can check your local computer time zone setting, browser setting and CRM personal standards and formats option.
My PC is Windows 7 with regional settings set to 'English (Untied Kingdom) and my browser is IE10 with language set to 'English (united Kingdom) [en-GB]'.
The CRM DB is Windows Server 2012 with a backend SQL Server 2012, the DB Default Language is set to 'British English' and so are all the users.
My instance of CRM has formats set to 'English (United Kingdom)'.
From what I can tell from the code, the AnnotationUI object belongs to a collection called 'AnnotationCollection' and, I believe, this collection is created via the 'Wall.Interfaces' which I think are DLL libraries and thus I can't modify the source of AnnotationUI.
Please let me know if I'm wrong.
You can simply go to settings>Administration>System settings>Formats, check the current format is the one you desire so English(United Kingdom) then click customise when correct. Go to the 'date' tab, change the short date format to dd/MM/yyyy & the long date format to dd/MMMM/yyyy. Hope this helps.
Thanks for your input, but the problem is deeper within CRM, and my CRM formats are already set to 'English (United Kingdom) as previously mentioned. Also, formats are based on a selection and can not be entered so the long format selection is 'dd MMM yyyy' without any slashes.
I must admit i have not read all your posts. But I think I have a fix for your problems. We encountered the same problem in our CRM2013 on-prem after migrating from CRM on-line. Dates where either shown as "invalid date" or completely wrong. There is not doubt that there is a serious bug in the product. But the work around that fixed it for us was to change the date format on the CRM server to English (US).
Follow these steps:
1. Open the IIS manager
2. Choose .Net Globalization
3. Change Culture and UI Culture to "English (United States) (en-US)". I don't know if both are necessary.
4. Apply changes
5. Do an IIS reset
Bada bing! That fixed our date issue!
Hope it helps other with similar problems.
Thomas Rath, Norriq Denmark