Get Standard Information in AX Monday, Jan 19 2009 

What I mean by standard function is, how to get logon user Id, default date or default datetime. I found it little bit hard, so that I’ll post it to make me easier to search

/*get the default user Id*/

curuserid()

/*get the default date */

today()

/*get the default date time*/

utcdatetime utc4, utcNow;

    ;

    utc4 = DateTimeUtil::utcNow();

    utcNow = DateTimeUtil ::applyTimeZoneOffset

        ( utc4,

        Timezone::GMTPLUS0700_BANGKOK_HANOI_JAKARTA

        );

Advertisements

Update in Axapta Thursday, Dec 11 2008 

I’ve learned axapta for 2 days and I found a wall while customized it :p
Actually, it’s really different with Solomon, you could not just select or update like sql script. Here’re the scripts:

ttsbegin;
while select forUpdate wmsorder where wmsorder.inventTransId == salesline.InventTransId
{
select * from inventtable where inventtable.ItemId == salesline.ItemId;

if (inventtable)
{
wmsorder.itemName = inventtable.itemName;
}
wmsorder.PortDest = salestable.Port;
wmsorder.doUpdate();
}
ttscommit;

ttsbegin and ttscommit are like tranbeg and tranend in Solomon. This code makes sure your table is in update condition, and the system will wait until your update process finish.