If you want to get rid of the annoying login prompt when starting AX if you have EP installed. Follow this two step solution:
- Start Server Manager. Go to Local Server and IE Enhanced Security Configuration. Turn it off. You might have to log out and in again for this to take effect.
- Start an AX client. Go to SysAdmin\Setup\EP\Web sites. Copy the address at the bottom of the form. Open it in a browser. There is a button for it in the right part of the form. To the top left, click Site Actions and Site Access. Add your user and give it access to the site.
Now you can open AX without getting harassed by a login prompt each time.
If you try to start the AOS service and get Error 5: Access is denied you should check that the service account is Local Admin. We have had installations the work fine but after a modelstore update run into problems and it was because this. Why the service was allowed to start before the update is unclear but should be seen more as pure luck. The account should be part of Local Admin.
After patching Windows on the server sometimes the user profile can get corrupted. You may not be able to Run As Admin, get errors for the user when logging in to AX, etc. Here is a link how to fix it:
I found this nice piece of code some time back that allows you to run a PowerShell script with Admin privileges. I cant remember where I found it but thanks whomever you are.
Say for example you want to allow the developers to trigger a script each time they have imported code. They are local admin but you don´t want to risk the script failing just because they forgot to Run As Admin.
Add this to the top of the script:
# Get the ID and security principal of the current user account
# Get the security principal for the Administrator role
# Check to see if we are currently running "as Administrator"
# We are running "as Administrator" - so change the title and background color to indicate this
$Host.UI.RawUI.WindowTitle = $myInvocation.MyCommand.Definition + "(Elevated)"
$Host.UI.RawUI.BackgroundColor = "DarkBlue"
# We are not running "as Administrator" - so relaunch as administrator
# Create a new process object that starts PowerShell
$newProcess = new-object System.Diagnostics.ProcessStartInfo "PowerShell";
# Specify the current script path and name as a parameter
$newProcess.Arguments = $myInvocation.MyCommand.Definition;
# Indicate that the process should be elevated
$newProcess.Verb = "runas";
# Start the new process
# Exit from the current, unelevated, process
I wanted to check which forms created for a customer that were missing a style set. It is best to have a style set for all forms in AX 2012 if you want a smoother transition to the new AX. The best way is to use the templates when creating a new form. To get a better picture of how much work it would be getting a list is nice. Checking each form manually is not so nice so borrowing some code from https://blogs.msdn.microsoft.com/dsiebold/2010/08/13/use-x-to-loop-through-the-aot/ I just changed it to suit my needs. The following code will give you a list of forms
public static void main(Args _args)
formNode = treenode::findNode(#FormsPath);
nodeCount = formNode.AOTchildNodeCount();
form = formNode.AOTfirstChild();
for (i=1; i<=nodeCount; ++i)
formName = form.AOTgetProperty('Name');
if (formName like 'XXX_*') // if you have named the forms CUSTNAME_SomeName
actualForm = formNode.AOTfindChild(formName);
style = actualForm.design().style();
if (style == 0)
info(strFmt("Form %1 missing style", formName));
form = form.AOTnextSibling();
A nice blog post regarding credit limit functionality in AX 2012
When having to check a sum for current post and its siblings it is best to do a sum without the current post and then add its value. This is because the post could have been posted prior or maybe not. The way this code is written you do not have to take that into account which makes it more generic. The result could otherwise change depending on if the post is new or just changed.
x = select sum(field) from table
where table.RelationField == this.RelationField
&& table.RecId != this.RecId;
x += this.field;