Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 55831

Date/Time Difference Error

$
0
0

Hi House,

I wrote the bellow script to Calculate the Time Difference Between "Created On" and "Modified On" to be Displayed in "Case Duration".

//Time Difference Between Created on and Modified On
function Sub ()
{
var val1 = Xrm.Page.getAttribute("modifiedon").getValue();
var val2 = Xrm.Page.getAttribute("createdon").getValue();

if(val1==null)return;
if(val2==null)return;

var result = val1 - val2;
Xrm.Page.getAttribute("new_caseduration").setValue(result);
Xrm.Page.getAttribute("new_caseresolutiontime").setValue(result);
}

Output:

// Expected Output :

//Created On:    1/20/2016  11:05 AM

//Modified On:   1/20/2016  11:020 AM

//Case Duration:  0/00/0000  00:15 00

Note: All fields Formats Remains Date/Time.

How Do i solve this issue Please....

Thanks And Regards.


Viewing all articles
Browse latest Browse all 55831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>