Quantcast
Channel: Microsoft Dynamics 365 Community
Viewing all articles
Browse latest Browse all 64797

How to get time difference between two different time values (TimeEdit control) in MS Dynamics Ax 2012

$
0
0

Today I got change to work with timeedit control in Ax where we have to get input of time and then take difference to get number of hours.

For this example I used timeEdit control and add two timeEdit control in form.These timeEdit controls are unbound, I set the out of the box FromTime and ToTime extended data Type and set auto declaration property to true so these controls can be access by name in code.

TimePropertiesInAx

Similarly set the properties ToTime.

 

Now add button and add its click method. The time difference between two times value can be get with timeConsumed out of the box function.

 

void clicked()

{

 

super();

 

info(timeConsumed(txtFromTime.value(),txtToTime.value()));

}

5-15-2015 12-19-11 AM

output is as

5-15-2015 12-19-25 AM

 

 

endtime

 

out put is as

 

5-15-2015 12-19-51 AM


Viewing all articles
Browse latest Browse all 64797

Trending Articles



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