// This is a job to understand about time values comparison and time field values comparison //using dialog
static void TimeComparison(Args _args)
{
TimeofDay fromTime,toTime; // Time variables
//TimeDate tbTime; // Table Buffer
Dialog dlg = new Dialog("TimeComparision");// object created for Dialog
dialogField dlgField,dlgField2;// Dialog Fields
TimeofDay fTime,tTime; // Time variables
;
dlgField = dlg.addFieldValue(typeid(TimeofDay),"","FromTime");
dlgField2 = dlg.addFieldValue(typeid(TimeofDay),"ToTime","ToTime");
if(dlg.run())
{
fromTime = dlgField.value();
toTime = dlgField2.value();
}
// fromTime = str2time("03:00:00 am");// we can change the time into string format
// toTime = str2time("04:00:00 am");
if(fromTime < toTime)
{
info("This is the small time");
info(time2str(fromTime,1,1));
}
else if(fromTime > toTime)
{
info("From Time should be less than To time ");
info(time2str(toTime,1,1));
}
else
info("Enter the time");
//-----------------------------
// To compare we can use this function: str2time("11:00:00 am")
//while select tbTime where tbTime.FromTime == str2time("11:00:00 am")
//{
//print tbTime.FromTime;
//info(time2str(tbTime.FromTime,1,1));
//}
//print time;
//pause;
tTime = str2time("03:00:00 am");
tTime = str2time("04:00:00 am");
if(tTime == str2time("3:00:00:am"))
{
print tTime;
}
pause;
}
This blog is for Dynamics AX (AXAPTA) Developers,this will help you for your development issues. This site contains some Microsoft Dynamics AX X++ Codes for use in your day to day use.
Subscribe to:
Post Comments (Atom)
Ledger Voucher creation Framework and x++ code to create ledger voucher
Please click her for MS reference file Below is the out of the box example reference and code. SalesInvoiceJournalPostSubBill_Extension->...
-
{ "Message" : "Please verify that the user is valid and set up correctly." } Sol: System Administration > Se...
-
Please click here to access Custom Workflow step by step process:
-
FormRun formRun = sender.formRun(); Object inventTrans_ds = formRun.dataSource(formDataSourceStr(InventMarking,InventTransO...
No comments:
Post a Comment
Give me the commetns and solutions