Get the technical value of an enum

You mayby need to retry the value of an enum.

For example : you have this enum : SalesUpdate::DeliverNow, and you will recover DeliverNow, not the label which can be in French, Dutch, English, …

You can proceed like this :

info(new DictEnum(enumNum(SalesUpdate)).value2Symbol(SalesUpdate::DeliverNow));
Advertisements

Convert date to utcDateTime

You can convert with the method DateTimeUtil::anyToDateTim([anyType]) BUT, I have receive some erros by use this method.

You can also use the conversion by a string !

date curDate;
utcDateTime newDateTime;

curDate             = systemDateGet(); 
newDateTime         = DateTimeUtil::parse(strfmt("%1T00:00:00", date2str(curdate, 321, 2, 3, 2, 3, 4)));
//=> 01-02-2010T00:00:00

For the time, you can use also the method : timeNow()