Langsung ke konten utama

AX 2012 - Find company currency through X++

CompanyInfo::standardCurrency() or
Ledger::accountingCurrency(CompanyInfo::current());

Komentar

Postingan populer dari blog ini

Use X++ wildcard (LIKE and NOT LIKE) in X++ select statement

For x++ select statements:  select firstOnly batchHistory      where batchHistory.Caption  LIKE  "*Test*"  For x++ queries:  queryBuildRange.value(*Test*); Note the LIKE instead of a '==' and the wildcards inside of the quotations. All other combinations of wildcard usage will work here. This is the same functionality as what the users would put in the grid filtering(eg. '*TEST*' in the caption field filter on the batch tasks form).  However, if you want to find all Captions that do not have the word Test in them (NOT LIKE, !LIKE), you will have to modify the above example slightly.  For x++ select statements:  select firstOnly batchHistory      where  !( batchHistory.Caption LIKE "*TEST*" ) ;  For x++ queries:  queryBuildRange.value(!*Test*);

Cleanup Jobs AX 2012

Cleanup jobs in Dynamics AX 2012 can help delete old data that is not needed anymore, and this reduction in database size can improve performance. In Dynamics AX 2012, cleanup jobs are available across various modules to run manually or in a batch mode. It is important to note that these jobs should be run after enough analysis determines that the business doesn’t need this data in the future. Please be sure to discuss with business management before deleting old data used in transactions that is not required any longer. Dynamics AX 2012 adds data to various tables for staging/intermediate purpose and this staging/intermediate data can be deleted once the transaction has been posted such as Sales update history, Purchase update history data. Here is the list of cleanup jobs available in Dynamics AX 2012 along with brief descriptions. All of these cleanup jobs are available in module > Periodic > Cleanup section Module Job Description General Ledger Clean up...

AX X++ str2Date

From time to time, a user will need to pull a date from a string. More often than not it is from an XML or from some other location. In order to actually use this date passed, it needs to be of data type 'date' so it can be written to fields, used in queries etc.  To do this, a user can use the 'str2Date' function. The str2Date function takes two parameters: datestring = The date in string format. It can be separated by either a dash ('-') or slash ('/') sequence = A three number combo using 1, 2, and 3 where 1 = day, 2 = month, and 3 = year. (e.g. 231 would be MM-YYY-DD, and 321 would be YYYY-MM-YY) If the sequence doesn't match the string or has an error, a '0' will result. Note that its very important to distinguish between day and month as an invalid month (>12) will result in a 0 and if both are <13, the date can translate totally wrong. I've detailed out the results of various scenarios below. Should be pretty self explan...