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.