Wednesday, 29 January 2014

How to give startup message in Axapta 2012

Hi ,

Sometimes we want to give startup message. To do that follow below steps.

  1. Open the Configuration Utility (Start > Control Panel > Administrative Tools > Microsoft Dynamics AX Configuration Utility).
  2. Verify that the currently open configuration target and configuration are the ones you want to modify.
  3. On the General tab, in the Startup message box, enter the message you want to display, and then click OK.
    When the client is started, the text displays in a message box, with an OK button below.

Saturday, 25 January 2014

Move all object from layer into the project in AX 2012

Hi ,


We can also export all the objects of layer and take backup. but for doing this we need to move all the objects from a layer into the project. Below I am defining how can we do it.
 Create a new project.



Then open the newly created project.
Choose Advanced Filter/Sort from the toolbar.
A new dialog pops up.


You can choose grouping of the objects as in the AOT or by user.

 Select the required objects.
Use the Select button on the dialog to select the objects you require for your project.
We wanna select all AOT objects from a specific layer, so we’ll use the UtilLevel field in the selection criteria.
                                             



From the screenshot you can see that all objects from the USR layer are selected, you can filter more by entrering the criteria you would like to do.

Thursday, 23 January 2014

'The X++ debugger work only for users who are in the 'Microsoft Dynamics AX Debugging Users' local group of the Windows.'

Hi ,

To overcome from the Debugging Error: 'The X++ debugger work only for users who are in the 'Microsoft Dynamics AX Debugging Users' local group of the Windows.' please follow below steps.

To determine the AOS service account 
  1. From the Start menu, point to All Programs, click Administrative Tools, and then click Services. 
  2. In Services, right-click the Microsoft Dynamics AX Object Server service and then click Properties. 
  3. In the Properties window, on the Log On tab, the AOS service account is specified in the This account field. 
To add the AOS service account to the debug group 
  1. From the Start menu, point to All Programs, click Administrative Tools, click Computer Management, and then click Local Users and Groups. 
  2. In Local Users and Groups, double-click Groups, right-click Microsoft Dynamics AX Debugging Users and click Add to Group. 
  3. In the Properties window, click Add and add the AOS service account to the group. 
  4. Restart the machine. 

Thursday, 9 January 2014

Find bank account from specification of main account


The following method finds a bank account from the main account attached to it. This is a general approach for relating the main account number to a record storing an account or account+dimensions combination.

Note use of DimensionAttributeValueCombination and MainAccount tables.


BankAccountTable bankAccountFromMainAccount(MainAccountNum mainAccountNum)
{
// Lookup bank account from main account

BankAccountTable bankAccountTable;
DimensionAttributeValueCombination valueCom;
MainAccount mainAccount;

select firstOnly bankAccountTable
join valueCom
where valueCom.RecId == bankAccountTable.LedgerDimension
join mainAccount
where mainAccount.RecId == valueCom.MainAccount
&& mainAccount.MainAccountId == mainAccountNum;

if(!bankAccountTable)
this.throwError(strFmt("Could not find bank account with main account '%1'",mainAccountNum));

return bankAccountTable;
}

Sunday, 15 December 2013

issues during changing index uniqueness



Some times we need to create a new unique index or alter existing one, but table may already contain duplicate data for this index and our changes could not be applied until data in table fixed to support uniqueness. We could do it by deleting records in the table but due to huge number of companies in environment it could be time consuming. To save your time you could use following job:
static void Job3(Args _args)
{
    MyTable myTable;
    DataArea da;
    int cnt;
    ;
    ttsbegin;
    while select da
    {
        cnt = 1;
        changecompany(da.Id)
        {
            myTable = null;
            while select forupdate myTable
            {
                cnt++;
                myTable.FieldForUniqueness = int2str( cnt );
                myTable.update();
            }
        }
    }
    ttscommit;
}
Another way to solve this problem is to make following steps:
  1. Try to synchronize your table
  2. You get an error saying that there are duplicates
  3. Rright away you go to Administration > Periodic > SQL Administration form.
  4. Select your table in the list and run Table actions > Check/Synchronize command.
  5. In appeared form enable “Check Allow duplicated’” and run.
  6. You will get a list of conflicting records to kill.

Problem Solving Techniques in Axapta



Sometimes, when developing, AX doesn’t work as expected, or behaves weird.
Here are some of the things you can try if you run out of ideas, roughly in the order I do:

Try again
You probably already did, but make sure you can reproduce the problem. If it only occurred once, it’s not a problem.

Check your code again
Check your code carefully for errors, and maybe ask a colleague’s opinion.

Compile
Your project might contain compile errors, so compile it to be sure.

Close the debugger
Sometimes, when the debugger is active, AX will keep executing ‘old’ code. Close the debugger to make sure the latest code is executing.

Compile forward
When you have modified a class that is inherited by other classes, you might want to compile forward this class.

Synchronize data dictionary
You may have made changes to application objects that haven’t been synchronized with the database. Open the AOT, right click on the Data Dictionary node and choose Synchronize.

Restart AX client
Simple as that, close the AX client and start it again.

Reset usage data
Go to options screen (AX button > Extra > Options) and click the Usage Data button. Click reset to remove this data.

Check the application event log for clues
Open the event viewer on the AOS to see if the AOS service has logged something in it. Messages here can help you a great deal. You can also check the event log on the database server or your client pc.

Google it
If you receive an error, just copy and paste it in Google. Most likely you are not the only one having that problem.

Check your client version
Check your AX client version. You might for example be connecting to a SP1 application with an SP0 client. You can check this in the about screen: AX button > Help > About. The kernel version indicates the client version, below that is the application version.

Refresh AOD, Dictionary and Data
You can flush cashed information using three option in the Tools > Development tools menu: refresh AOD, refresh Dictionary and refresh Data. This can be useful when you just imported an xpo file, or when you are developing for the enterprise portal.

Delete AUC file
The application Unicode object cache file, if there is one, is located at C:\Documents and Settings\[USERNAME]\Local Settings\Application Data for xp, or C:\Users\USERNAME\AppData\Local for vista. Delete this file while the AX client is closed.

Check if other users are having the same problem
Knowing whether you are the only one that’s having that problem or if it’s a general problem is a big step towards solving the problem. For example, if you alone have the problem, restarting the AOS probably won’t solve it, but removing usage data might.

Check security settings
When only some users have a problem, big changes are that it has something to do with security settings. Security can be set up from Administration > Setup > Security, on the Permissions tab.

Check configuration key setup
Some features of AX won’t work if a configuration key is disabled, be aware of this.

Full compile
Open the AOT, right click the AOT node and select compile.

Restart AOS
Sometimes restarting the AOS solves your problem just fine. If you can, it’s worth the try as this doesn’t take long.

Remove .aoi file
When the AOS is stopped, you can delete the .aoi file from the application files. This file will be rebuilt when the AOS starts.

AX2012 Solution for time consuming Deploy SSRS Report Process

When Deploying the report from visual studio in some environments its taking lot of time to deploy, as it is verifying the privileges with the AD and ADServer is slow, some times I found its taking atleast 20mins to deploy a report.

So please use powershell with the following command to deploy the report with the parameters.

Publish-axreport -reportName <raportname> -SkipReportServerAdminCheck