The purpose of this blog is for knowledge sharing and connect the relevant audience who are all into Microsoft Dynamics world.
Alfasith AX
Monday, August 5, 2013
Validating two date fields in Dynamic AX
Hi,
1.Create two fields as UtcDateTimeEdit of table TableName
2.Name it InTime and OutTime.
3.In the init() of that datasource or form depends on requirements.
TableName.InTime = DateTimeUtil::getSystemDateTime();
TableName.OutTime = DateTimeUtil::getSystemDateTime();
//here making the system date and time to the that field.
3.Override the modified method by modified each of the fields.
public boolean modified()
{
boolean ret;
ret = super();
if(SMAServiceOrderTable.InTime > SMAServiceOrderTable.OutTime)
{
warning("In time cannot be greater than Out time");
SMAServiceOrderTable.InTime = DateTimeUtil::getSystemDateTime();
SMAServiceOrderTable.OutTime = DateTimeUtil::getSystemDateTime();
}
return ret;
}
1.Create two fields as UtcDateTimeEdit of table TableName
2.Name it InTime and OutTime.
3.In the init() of that datasource or form depends on requirements.
TableName.InTime = DateTimeUtil::getSystemDateTime();
TableName.OutTime = DateTimeUtil::getSystemDateTime();
//here making the system date and time to the that field.
3.Override the modified method by modified each of the fields.
public boolean modified()
{
boolean ret;
ret = super();
if(SMAServiceOrderTable.InTime > SMAServiceOrderTable.OutTime)
{
warning("In time cannot be greater than Out time");
SMAServiceOrderTable.InTime = DateTimeUtil::getSystemDateTime();
SMAServiceOrderTable.OutTime = DateTimeUtil::getSystemDateTime();
}
return ret;
}
Subscribe to:
Posts (Atom)
SQL code to upate one Legal entity banner to all the legal entity in D365
Hi, update companyimage set companyimage.Image = companyimageA.Image from ( select Image from companyimage where dataAreaid = 'USF...
-
Hi, AccountingDistribution ( accounting distribution 7452 ) AccountingDistributionEventTmp ( accounting distribution 100001 ) Accountin...
-
Hi, Create a EDT name it Gender then in properties enumType : //select the enum name Use the below code and enjoy. static v...