Posts

Showing posts from August, 2014

Code: X++ script to disable AX users

If you are looking for script to quickly disable AX users. This way you can keep people out of the AOS without actually needing to remove the user.    Three approaches for the code: 1. Simple Job to disable the specified user in UserInfo table. static void disableUsers(Args _args) {     UserInfo userInfo;     ;       //a00008 is the user id which we want to disable.     while select forUpdate userInfo where userInfo.id == 'a00008'     {         if(userInfo)         {             ttsBegin;                          userInfo.enable = 0;             userInfo.update();                          ttsCommit;       ...

Difference between InMemory and TempDB tables in AX 2012

Image
Basically in AX2012 there are two types of Temporary tables, (i)TempDB tables and (ii)InMemory Tables. Basic differences between them are: InMemory tables TempDB tables 1. Holds data temporarily in client or server tier 1. Holds data temporarily in database till the scope is valid 2. These tables can't be stored in Database 2. These tables are stored in the database 3. Can't apply security 3. Can apply security 4. We cannot use InMemory table buffers 4. TempDB table buffer can be used in coding TempDB tables We call them TempDB tables because their TableType property value is TempDB. This value comes from the TableType::TempDB enum value. The TableType property value can be set at AOT > Data Dictionary > Tables > MyTempDBTable > Properties > TableType. All types of temporary tables are automatically dropped by the system when the table variable in X++ goes out of scope. A TempDB...