Thursday, 4 December 2014

Get list of all Projects in AOT

There's many times when we tend to get the list of all the projects existing in the AOT. This is helpful to keep the development documentation up-to-date. The code below provides an easy list of all the projects and saves them in a csv file.

static void GetProjectNames(Args _args)

{
    #AOT
    #File
    #Properties
   
    TextIo csvIO;
    str description;
    TreeNode projects;
    int total, counter;
  ; 
    csvIO = new TextIo(@"C:\HBProjectsList.xls", #IO_WRITE);
    csvIO.write("Project Name\n");
    projects = TreeNode::findNode(@"\Projects\Shared");
   
    total = projects.AOTchildNodeCount();
    projects = projects.AOTfirstChild();
   
    info(int2str(Total));
   
    for(counter = 1; counter <= total; counter++)
    {
        description += projects.AOTname();
        description += "\n";
        projects = projects.AOTnextSibling();
    }
   
    csvIO.write(description);
}

Sunday, 19 October 2014

DIXF / DMF Issue with Entities

Using DIXF requires a set of versatile skills from Excel to X++. I came across this issue where I kept getting the error below every time I uploaded various entities particularly Customer.

Results. Record ('XXX') . A record with RecId 0 does not exist.
Results. Record ('XXX') . Account  does not exist.
Results. Record ('XXX') . Update has been cancelled.
This issue was caused by incorrect lincence configuration when a field was passed on and the key was not enabled. Below code can be used to clean the data in the staging on the fly.
static void CLearCustomerEntityState(Args _args)
{
    DMFCustomerEntity cust;
    int counter;
    ;
        counter = 0;
    while select forUpdate cust where cust.TransferStatus == 2
    {
        ttsBegin;
             cust.State = "";
             cust.County = "";
        cust.AccountBalance = 0;
        cust.update();
        ttsCommit;

        counter++;
    }
    info(strFmt("Cleared : %1",counter));

}

Wednesday, 15 October 2014

Create Security Roles Using X++

There is times when we need to create security roles in a good number particularly to deal with workflow. The below code would do the job just well.

static void InsertSecurityRoles(Args _args)
{
SecurityRole role;
;
 ttsBegin;
  
        select forUpdate role;
        role.Name='SEC_Group'; 
        role.AOTName='SEC_Group'; 
        role.description='Description of the security role'; 
        role.insert();
 ttsCommit;

info("Groups Created");
}

Thursday, 3 October 2013

Native boot Dynamics AX 2012 V3 VM

The latest version of Microsoft Dynamics AX 2012 is 3 (release Aug, 2013). The VM is made with Windows 2012 Server. After many tries, I discovered the native booting process has actually been simplified by Microsoft. It is just a very simplified process this time. The same restrictions apply that you need to have Windows 7 professional or above and later OS in order to boot the machine with a VM. Lets begin the journey.
  1. Download and extract the VM on your hard drive.
    Partnersource (https://mbs.microsoft.com/customersource/downloads/servicepacks/AX2012DemoToolsMaterials.htm)
  2. Right Click My computer and click Manage.
     
     

  3. Computer Management window will pop up. Click on Disk Management in the right hand navigation. Under Action Menu click Attach VHD.
                                     
  4. A dialog box will appear to browse the VM file.
                                 
  5. Once the VM is attached, it will appear in the lower left section of the window.
  6. Just make a note of the drive letter. For assumptions I will use J: as my VM drive.
  7. Open DOS prompt with Admin privileges
  8. Type ‘bcdboot J:\windows

That will add Windows 2012 Server as an option to your boot loaded and would enable you to boot with Windows 2012 VM.

Thursday, 29 August 2013

Error "Account number for transaction type Purchase, receipt does not exist"

This error occurs when the item group of an item has not got a receipt account specified and this error appears when posting the invoice for the purchase order containing the item without the receipt account specified in the item group. Procedure to fix it is:

Solution:
Go to the item and check its item group. Under the tab Purchase Ledger, there's a field ''Receipt" for which we need to provide the account number. 



Sunday, 2 June 2013

Modules of Dynamics AX 2009 and AX 2012 R2

There is many of Dynamics AX 2009 users who will soon be transiting to AX 2012 R2 upgrades. After thousands of hours of analysis, Microsoft has simplified the modules and also has relocated many of the options within the modules to their more pertinent areas. The change has also occurred in module names and some modules have been further broken down 2 or 3 modules. Also, as before, this is an inter-related system where the forms of one module can still be accessed from the other module provided the permissions are granted. The below table give a brief overview of the naming and placement changes that Microsoft has brought in with AX 2012 R2 release:

MODULES IN Dynamics AX 2009
MODULES IN Dynamics AX 2012 R2
 Inventory Management
·       Inventory Management
·       Product Information Management
Accounts Payable
·       Procurement and Sourcing
·       Accounts Payable
Accounts Receivable
·       Sales and Marketing
·       Accounts Receivable
General Ledger
·       General Ledger
·       Budgeting
·       Fixed Assets
·       Compliance and Internal controls
Cost Accounting
·       Cost Accounting
Bank
·       Cash and Bank Management
CRM
·       Moved to Sales and Marketing module
Master Planning
·       Master Planning
Production
·       Production control
Product Builder
·       Moved to Product Information Management
Shop floor Control
In 2012 R2, this modules has been splitted into three modules and is accessible through Home, Production Control and HR modules.
·       Time and Attendance  (HR)
·       Clock In and Out (Home)
·       Manufacturing execution (PC) 
Human Resource
·       Human Resources
Questionnaire
·       Moved to Home
Expense Management
·       Travel and Expense
Projects
·       Project Management and Accounting (PSA)
Service
·       Service Management
Basic
·       Organizational Administration
Administration
·       System Administration