locked
convert duration in tasks from minutes to hours RRS feed

  • Question

  • hi,

    I need to show duration for each task per hour not minutes is there any resolution for this issue??


    Ghazal Sarbazi

    Tuesday, May 20, 2014 6:51 AM

Answers

  • the resolution is very simple, Dynamic CRM does not need script tag for JS files!

    Ghazal Sarbazi

    Thursday, May 22, 2014 5:39 AM

All replies

  • Hi,

    The Task durations are shown in hours by default from and over 1 hrs like 1hr, 1.5 hr, etc. Do you want to show 15 mins as 0.25 hrs, 30 mins as 0.5 hrs? If that is what you want, I don't think there's a supported method to achieve that.


    Admin QuikView Solution for CRM 2013

    Tuesday, May 20, 2014 9:52 AM
  • but the task duration is stored per minutes and when I want to show it in a report it gives me the minutes , what I want is to create a new column and change this field to hours , I have used JS but it gives me unknown error!

    Ghazal Sarbazi

    Thursday, May 22, 2014 12:14 AM
  • I have created new calculated field and with this java script but it gives me unknown error, is there anyone who can help me??!!!

     <script type="text/javascript" src="jcarousellite_1.0.1.js">

    function convert()
    {
      try {
            if (Xrm.Page.getAttribute("actualdurationminutes").getValue() != null) {
                var val1 = parseFloat(Xrm.Page.getAttribute("actualdurationminutes").getValue());
            } else {
                var val1 = 0;
            }


     var result = val1/60 ;
     Xrm.Page.getAttribute("new_taskduration").setValue(result);
            Xrm.Page.data.entity.attributes.get("new_taskduration").setSubmitMode("always");
        }
        catch (err) {
            // alert(err);
        }
    }

    </script>


    Ghazal Sarbazi

    Thursday, May 22, 2014 3:44 AM
  • Hi,

    I think the issue is about the field type of the "new_taskduration". What is its type?


    Persian Dynamics CRM Community | انجمن متخصصان فارسی زبان

    Thursday, May 22, 2014 4:42 AM
    Moderator
  • no I solved the problem , but the type of the field is decimal number

    Ghazal Sarbazi

    Thursday, May 22, 2014 5:32 AM
  • Thursday, May 22, 2014 5:35 AM
    Moderator
  • the resolution is very simple, Dynamic CRM does not need script tag for JS files!

    Ghazal Sarbazi

    Thursday, May 22, 2014 5:39 AM