locked
Date Format RRS feed

  • Question

  • Hi all

    1) when i choose a date from crm calender it gives in this format M/D/Y  i need to change to this Format D/M/Y is it possible if how, i changed the PC Setting short date and long date but nothing changed on crm.

    2) i have a field called Next call i need to a have a lert if the next call date is equal today's date i appreciete if some one can help this js code as i am not good in js.

    thanks for your help.

    Sunday, January 16, 2011 7:25 AM

Answers

  • Thanks guys

    thank you Redy date format worked only needed to change from the dashboard as you told for second i get the best and easiest wayof what i want that is Advanced find.as Faizal suggested

    thanks all u guys for the great support.

    • Marked as answer by CMmohamed Wednesday, January 19, 2011 5:55 AM
    Wednesday, January 19, 2011 5:54 AM

All replies

  • Hi CMmohamed,

     

    You can resolve this using the Personalize Workplace. In the Format tab, simply select the related date format or you can try following scripts,

    var value=crmForm.all.new_date.DataValue;

    var year = value.getYear().toString();
    var month = (value.getMonth() + 1).toString();
    var dayOfMonth = value.getDate().toString();

    Regards,

    Sunday, January 16, 2011 12:24 PM
  • thank u Ercan i will try and let you know what about the Second Question .
    Monday, January 17, 2011 6:08 AM
  • Alternatively, u may change the date setting for the crm application from Settings -> Administration -> System Settings -> Formats -> Customize...

    Regards,

    Ali

     


    Paradise lies at the feet of thy mother. - Prophet Mohammed (PBUH)
    Monday, January 17, 2011 7:58 AM
  • 1) Mr Ali has answered this question.

    2) You need to create a windows service to run on daily basis and check the alerts to be send. You will also find few addons which can do this. An other work around which is quite easy to use is to make an advanced find view and monitor that view on daily basis. You can also use stored prodcedure and that would not be supported.


    Regards Faisal
    Monday, January 17, 2011 10:44 AM
  • Thans all

    1) trust i tried this  Settings -> Administration -> System Settings -> Formats -> Customize... before i post  and restarted the server but nothing changed.also trying the code of Ercan

    2)faisal alerts are for the users of CRM i have a feild Called  next call on Contact so what i need is if date of today equals to the next call date , then CRM will give the user an alert.

    thanks for your help.

     

    Monday, January 17, 2011 8:18 PM
  • Hi

    There are two places where you need to do this

    1) Settings -> Administration -> System Settings -> Formats  [Server Setting] once this is done you should reset IIS

    And on the client machine [User Setting]

    2) From Dashboard [loader.aspx] -> from Toolbar -> options -> Format [select your choice] and this should set the client settings.

    Or

    you can run a simple SQL Statement which can set this up for you

    For Example to set users to UK Settings

    UPDATE [YourOrganisation_MSCRM].[dbo].[FilteredUserSettings]
       SET [LocaleId] = 2057,
        [CurrencySymbol] = '£',
        [TimeFormatString]= 'HH:mm',
        [DateFormatString] = 'dd/MM/yyyy',
        [LongDateformatCode] = 1  ,
        [NegativeCurrencyFormatCode] = 1,
        [PMDesignator] = 'PM'
     
    GO

    PS: You should reset your IIS once you have done this on your CRM server.

     

    Here is the javascript code but this will only work when the user open the form. You can write a wait timeout custom wokfow to monitor and send alerts.

    var value=crmForm.all.new_NextCalldate.DataValue;

    var year = value.getYear().toString();
    var month = (value.getMonth() + 1).toString();
    var dayOfMonth = value.getDate().toString();

    Usage:

    if (GetTodaysDateDifference(dayOfMonth, month, year) == 0)

    {

       alert("It is next call date ");

    }

    //Returns a value >0 where the incoming date is not equal to todays date
    function GetTodaysDateDifference(dtDay, dtMonth, dtYear) {

        var todaysDate = new Date();
        var curday = todaysDate.getDate();
        var curmon = todaysDate.getMonth() + 1;
        var curyear = todaysDate.getFullYear();

        var calday = dtDay;
        var calmon = dtMonth;
        var calyear = dtYear;

        if (curday != "" || curmon != "" || curyear != "" || calday != "" || calmon != "" || calyear != "") {

            var curd = new Date(curyear, curmon - 1, curday);
            var cald = new Date(calyear, calmon - 1, calday);

            var diff = Date.UTC(curyear, curmon, curday, 0, 0, 0) - Date.UTC(calyear, calmon, calday, 0, 0, 0);
            return diff;
        }
    }

     

     

     

    Amar


    Hope this helps. Amar

    CRM Forum Guidance on how to Help Us Help You

    • Proposed as answer by Faisal Fiaz Monday, January 17, 2011 10:12 PM
    Monday, January 17, 2011 9:41 PM
  • It is easier to create a workflow on create of record which should wait untill next call time(minus/plus one minute) and send email as an alert to the user.
    Regards Faisal
    Monday, January 17, 2011 10:31 PM
  • Thanks guys

    thank you Redy date format worked only needed to change from the dashboard as you told for second i get the best and easiest wayof what i want that is Advanced find.as Faizal suggested

    thanks all u guys for the great support.

    • Marked as answer by CMmohamed Wednesday, January 19, 2011 5:55 AM
    Wednesday, January 19, 2011 5:54 AM