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

Wednesday, 17 April 2013

Delete ALL the transactional data in a company

It is interesting that there are times when we keep a TEST company even in production environments. This is a useful procedure but with ever increasing test transactions, the size of database becomes increasingly bigger. There is an in built class 'SysDatabaseTransDelete'. Just follow the steps below to actually delete all the company related transactions in the database.

  1. In the AOT expand Classes node
  2. Find the class 'SysDatabaseTransDelete' .
  3. There is a Main method defined for this class so when you right click and select Open, a message box will appear to ask confirmation. Select Yes.
  4. Depending on the volume of data, an info box will appear once the transactions are deleted.


Note: This only deletes the transactions related to the company selected under AOT. 

Thursday, 4 April 2013

Labels in Version Control Environment | Dynamics AX 2012

In general understanding, label files are generally kept identical within a same layer but in reality they can contain different values even within the same layer. Came across a useful article to understand how label files behave when a version control mechanism is on. This can be read here.