TempDB access rights - AX 2012 - Permission denied in TempDB

If you got this in your AX 2012 (when you are compiling / synchronizing  or trying to work with temporary tables that have their TableType set to TempDB):

Cannot execute a data definition language command on  (). The SQL database has issued an error.
SQL error description: [Microsoft][SQL Server Native Client 10.0][SQL Server]CREATE TABLE permission denied in database 'tempdb'.


 or see this in Event Viewer:

Object Server 01:  The database reported (session 3 (Admin)): [Microsoft][SQL Server Native Client 10.0][SQL Server]CREATE TABLE permission denied in database 'tempdb'.


you should definitely setup the access rights for the user used for the AOS service. On the SQL Server instance used,  in the TempDB system database add the AOS's account as a user and set it up with the db_datareader, db_datawriter and db_dlladmin role membership.

GAC Location - .NET - Assemblies location

Working with either .Net framework 2.0 or 4.0 and building some dlls to help me in my daily tasks, I realized  that when I registered the dll build in 4.0 they were not listed in the already well known %windir%\Assembly folder that I always check to make sure the files are set ok.
The location for dlls build with version 4.0 has changed to %windir%\Microsoft.NET\Assembly.
This is just a reminder for when you start to think "why my assembly doesn't show in gac folder ?!".

Services & AIF - AX 2012 - Can not configure services

Sometime you may get into issues when you try to configure the Services & AIF either from the Initialization checklist or the Administration Setup Services menu. One of the possible reasons for these to fail when being configured is that the URL registration is done under another user than the current AOS credentials.
Error is something like (taken from Event Viewer):

Object Server 01:  System.OperationCanceledException: AIF service group not activated.  Service group: UserSessionService.  Error: HTTP could not register URL http://+:8101/DynamicsAx/Services/UserSessionService/. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details). ---> System.ServiceModel.AddressAccessDeniedException: HTTP could not register URL http://+:8101/DynamicsAx/Services/UserSessionService/. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details).

To checkout the current setup run the following: netsh http show urlacl.
This will output something like:
URL Reservations:
-----------------

    Reserved URL            : http://+:8102/DynamicsAx/Services/
        User: NT AUTHORITY\NETWORK SERVICE
            Listen: Yes
            Delegate: No
            SDDL: D:(A;;GX;;;NS)

    Reserved URL            : http://+:8101/DynamicsAx/Services/
        User: NT AUTHORITY\NETWORK SERVICE
            Listen: Yes
            Delegate: No
            SDDL: D:(A;;GX;;;NS)



From what I noticed is that you have to register the URLs under the current user in order for these to work.

Do this using:  
netsh http delete urlacl url=http://+:8101/DynamicsAx/Services and then
netsh http add urlacl url=http://+:8101/DynamicsAx/Services user=domain\aos_user

Model management - AX 2012 - Working with models links

Trying to maintain a list of relevant links about models, and how to work with them:
http://technet.microsoft.com/en-us/library/hh352326.aspx 

AX PS Scripts - AX 2012 - Using config parameter

AX 2012 comes with a few useful PowerShell scripts (via the Dynamics AX 2012 Management Shell) that allows you to perform some degree of management; this is also possible using the AxUtil executable, but using the PS seems more nowadays.
Now, one of the things in using the PS scripts is to pay attention to what instance you are running your commands against, in case you have multiple instances running on that machine. So, do not neglect the -Config parameter. You might end up, if you are not careful enough to overwrite another instance that the one you want.
The value of the -Config parameter is the name of the AOS (you take this from the Microsoft Dynamics AX 2012 Sever Configuration -> Application Object Server Instance).

As an example, this is what you will get if the AOS from the Default Configuration doesn't exist anymore:

PS C:\Windows\system32> Uninstall-AxModel -Layer cus
Uninstall-AXModel : The pipeline has been stopped.
At line:1 char:18
+ uninstall-axmodel <<<<  -layer cus
    + CategoryInfo          : OperationStopped: (:) [Uninstall-AXModel], Pipel
   ineStoppedException
    + FullyQualifiedErrorId : Default AOS instance was not found in the regist
   ry.,Microsoft.Dynamics.AX.Framework.Tools.ModelManagement.PowerShell.Unins
  tallAXModelCommand
 

EP - AX 2009 - Deployment of a functionality


Steps that must be taken in order to deploy on EP a newly developed feature (all actions must be done from AX AOT, and not the project):

1. Deploy the web module: expand the Web -> Web Module -> Home -> YOUR_NAME. Right click on the node and select Deploy. A success infolog should be display.

2. Deploy the web controls: Web -> Web Files -> Web controls. Right click on the node and select Deploy. A success window should be display.

3. Deploy the web pages: Web -> Web Files -> Page definitions. Navigate to each individual page you have created; right click on the node and select Deploy page. A success infolog should be display.

4. Deploy the proxies: open the AX menu -> Development Tools -> Web Developemnt -> Proxies. You can either say Generate using the first button if the site is correctly configured, or the second and enter the path to the [iis server path]\[site path]\App_Code\Proxies.

5. To make sure everything is deployed ok, an iisreset  command on the IIS server machine can be issued.

6. Open the EP portal and on the Home page you will see an Administration menu (should be listed first) in the QuickLaunch toolbar (left side). Do a Refresh AOD, Refresh Dictionary, Refresh Data.

7. You're all set.

EP - AX 2009 - Button per line in grid


 Say you want to perform an action on a line directly from the grid and not from a possible menu (working with the menu means you also have to actually select the line first): something like, opening for further action one invoice from a list of invoices presented in a grid.
 The solution mainly consists of:
 - adding an asp:TemplateField with an asp:ImageButton to the grid's fields list;
 - implement the grid's RowDataBound(object sender, GridViewRowEventArgs e) in order to add to the button's attributes list  the value of the line's recId or some other primary index value;
 - implement the action on the button's OnClick.

Now, for some of the code: