This is just a collection of my commonly used algorithms, global functions etc in x++, they don’t really have that much to do with workflow in specific
Currency
//Getting exchange rate to base currency: e.g. ExchRateHelper::getExchRate_Static(purchreqline.CurrencyCode, today()); //Convert to base currency: e.g. Currency::amountCur2MST(purchreqLine.LineAmount, purchreqLine.currencyCode);
Date
//Today's date e.g. date(); //Returns date only //Time Now timeNow();
EmplId to UserId
SysCompanyUserInfo::emplId2UserId([EMPLID]);
Eventing (AX 2012)
Modifying parameters and return values
static public void preEvent(XppPrePostArgs ppArgs)
{
ppArgs.setArg("_myParam", "New Value");
}
static public void postEvent(XppPrePostArgs ppArgs)
{
ppArgs.setReturnValue("Returned value");
}




