Monday, September 29, 2014

AX 2012 Issue: Missing module in Dynamics AX module navigation

Issue:
An end user seemed to be missing the entire Accounts Receivable module (Figure 1 below) in AX 2012.

Thought process:
My first thought was that the issue was security: if the user doesn't have permissions to any of the menu items under that module, the module won't show up. The issue is that the user was a power user and should obviously have access to almost all objects under AR. 

The giveaway:
A key indicator that the issue was specific to a single user; other users with the same role were able to to see it. That means it must be something else outside of security.

Solution:
The solution was that the module was unintentionally hidden. Make it visible (or hide it!) by going to File > 'View' > 'Modules' > Uncheck/Check the appropriate module(s) (Figure 2 below). When they are checked, they are visible. If they are unchecked, they are not visible. Once rechecking the AR module, we can see the module is back in place (Figure 3 below)

Note: This is a great way to hide modules that users may not need. It can simplify the modules list for end users who really only need to see specific things. For example, a retail power user may need to see customers, workers, etc. Since those example objects also exist in the AR, sales and marketing, and HR, the user will see the AR, Sales&Marketing, HR, and Retail modules. Since the user can get to everything they need in the Retail module, they may not want to see those other three modules. By hiding the other modules on a user by user basis, it will simplify their view of the system and seem less cluttered. 

Figure 1 - Missing Accounts Receivable module in AX 2012 navigation

Figure 2 - The accounts receivable module is unchecked, meaning that it is hidden.

Figure 3 - The Accounts Receivable module is now visible to the user

Tuesday, September 9, 2014

Dynamics AX 2012 R3 - Complete List of Out Of The Box Workflows

Microsoft Dynamics AX 2012 R3 comes with 75 workflow types in the base product. Identifying and leveraging these base workflow types can be highly beneficial to adding value to customers' implementations. The key is knowing what they are while analyzing a businesses needs to devise the best solution AX can offer with minimal modifications.

Just to clarify, these are the workflow types. There can be multiple workflows setups using one or more of the below workflows.

For total transparency, I used the code below to extract the list from the AOT. I hardcoded the 'en-us' but this can be set for whatever language you want.

static void daxWorkflowAnalyzer(Args _args)
{
    #AOT
    #Properties
    TreeNodeIterator          templateNodes;
    TreeNode                      templateNode;
    SysDictWorkflowType template;
 
    templateNodes = TreeNode::findNode(#WorkflowTypesPath).AOTiterator();
    templateNode = templateNodes.next();
 
    while (templateNode)
    {      
        info(strFmt("%1 - %2", SysLabel::labelId2String2(findProperty(templateNode.AOTgetProperties(), #PropertyLabel), 'en-us'),
                               SysLabel::labelId2String2(findProperty(templateNode.AOTgetProperties(), #PropertyHelpText), 'en-us')));
     
        templateNode = templateNodes.next();
    }
}

WORKFLOW DESCRIPTION
Advanced ledger entry workflow Use this type to create approval workflows for advance ledger entries
Bank reconciliation journal approval workflow Use this type to create approval workflows for Bank Reconciliation journals
Budget account entry workflow Use this type to create review workflows for budget account entries
Budget plan workflows Use this type to create and review workflows for budget plans
Budget register entry workflow Use this type to create review workflows for budget register entries
Case management workflow Use this type to create a workflow for cases
Catalog import product approval Use this type to create review workflows for imported catalog products
Catalog import approval Use this type to create review workflows for imported catalogs
Customer bank remittance workflow Use this type to create approval workflows for customer bank remittance journals
Customer draw bill of exchange workflow Use this type to create approval workflows for customer draw bill of exchange journals
Customer free text invoice workflow Use this type to create approval workflows for free text invoices
Customer payment workflow Use this type to create approval workflows for customer payment journals
Customer protest bill of exchange workflow Use this type to create approval workflows for customer protest bill of exchange journals
Customer recurring invoice workflow Use this type to create approval workflows for recurring invoices
Customer redraw bill of exchange workflow Use this type to create approval workflows for customer redraw bill of exchange journals
Customer settle bill of exchange workflow Use this type to create approval workflows for customer settle bill of exchange journals
Document handling Workflow type for document handling
Human resources actions workflow Use this type to create workflows for personnel actions, such as to create new positions or to modify positions
Worker actions hire Workflows for worker actions of the Hire type
Worker actions terminate Workflows for worker actions of the Terminate worker type
Worker actions transfer Workflows for worker actions of the Transfer worker type
Signing limits workflow Use this template to create a workflow for review of signing limit requests
Time and attendance days total workflow Use this type to create approval workflows for time and attendance days total records
Time and attendance journal registration workflow Use this type to create approval workflows for time and attendance journal registration records
Ledger allocations journal workflow Use this type to create approval workflows for allocation journals
Ledger daily journal workflow Use this type to create approval workflows for daily journals
Ledger eliminations journal workflow Use this type to create approval workflows for eliminations journal
Ledger fixed assets budget journal workflow Use this type to create approval workflows for fixed asset budget journals
Ledger post fixed assets journal workflow Use this type to create approval workflows for post fixed asset journals
Customer rebate workflow Customer rebate workflow type
Review original budget workflow Use this type to review an original budget
Review budget revision workflow Use this type to review a budget revision
Review project invoice proposals Use this type to review project invoice proposals
Review project quotations Use this type to review project quotations
Purchase agreement approval workflow Use this type to create approval workflows for purchase agreements
Commitments approval Use this template to create approval workflows for commitment documents
Delivery due date notification workflow Use this type to create delivery due date notification workflows for unconfirmed product receipts
Invoice received notification workflow Use this type to create invoice received notification workflows for unconfirmed product receipts
Product receipt failed notification workflow Use this type to create notifications workflows for failed product receipts
Unconfirmed product receipt rejection notification workflow Use this type to create notification workflows for rejected unconfirmed product receipts
Purchase order line workflow Use this type to create review- and approval workflows for purchase order lines
Purchase requisition line review Use this type to create review workflows for purchase requisition lines 
Purchase requisition review Use this type to create review workflows for purchase requisitions 
Purchase order workflow Use this type to create review- and approval workflows for purchase orders
Retail catalog approval workflow Retail catalog approval workflow type
Trade allowance workflow Trade allowance workflow type
Vendor rebate approval Vendor rebate workflow approval type
Freight Invoice Approval Workflow to support invoice approval
Cash advance request Use this type to create approval workflows for cash advance requests
Dispute management Use this type to create workflows for credit card dispute management
Expense report auto posting Use this type to create document automatic posting workflows for expense reports
Expense report Use this type to create document approvals for expense reports
Expense line item auto posting Use this type to create line item automatic posting workflows for expense reports
Expense line item Use this type to create line item approvals for expense reports
Travel requisition Use this type to create approval workflows for travel requisitions
VAT tax recovery Use this type to create approval workflows for VAT tax recovery
Review timesheet workflow Use this type to review a timesheet
Review timesheet line workflow Use this type to review a timesheet line
User request workflow Use this type to create user provisioning workflows for user requests
Inactivate user request workflow Use this type to create user inactivation workflows for inactivate user requests
Vendor bank remittance journal workflow Use this type to create approval workflows for vendor bank remittance journals
Vendor disbursement journal workflow Use this type to create approval workflows for vendor disbursement journals
Vendor draw promissory note journal workflow Use this type to create approval workflows for vendor draw promissory note journals
Vendor invoice approval journal workflow Use this type to create approval workflows for vendor invoice approval journals
Vendor invoice journal workflow Use this type to create approval workflows for vendor invoice recording journals
Vendor invoice register journal workflow Use this type to create approval workflows for vendor invoice register journals
Vendor invoice workflow Use this type to create review workflows for vendor invoices
Vendor invoice line workflow Use this type to create review workflows for vendor invoice lines
Vendor redraw promissory note journal workflow Use this type to create approval workflows for vendor redraw promissory note journals
Vendor category application workflow Use this type to create approval workflows for vendor category application requests
Vendor category justification workflow Use this type to create approval workflows for vendor category justification requests
Vendor add application workflow Use this type to create approval workflows for vendor add application requests
Vendor add justification workflow Use this type to create approval workflows for vendor add justification requests
Vendor status change request workflow Use this type to create approval workflows for vendor status change requests
Vendor settle promissory note journal workflow Use this type to create approval workflows for vendor settle promissory note journals

Sunday, August 10, 2014

Business Intelligence Components Part 2: Multidimensional aggregation and allocation

In part two of the 'Business Intelligence Components' series, we'll look at the 'Multidimensional aggregation and allocation' component. For more information about this series and its context, see Part I of the series Overview and the 'Master' BI Components list

Multidimensional aggregation and allocation
This means processing data from many different data sources in a memory efficient way.

Examples of 'multidimensional aggregations' are OLAP (online analytical processing) cubes or 'multidimensional data analysis'. Basically, taking several different data sources (e.g. cities, sales transactions, date of creation, items) and displaying these in a single analytical view which gives the users a view of the information and how they all relate to each other. Depending on the application where the cubes are being leveraged, the users may be able to drill into certain parts of the data (e.g. city) and see even more detailed information around the selected data (e.g. which stores in that drilled into city are selling how much).

Depending on how complex the above links are to display the information from the tables, memory consumption can be quite complicated. It's one thing to process the data accurately. It's another thing to process it quickly and efficiently. Therefore, it is required to allocate the multidimensional information into strategic blocks of memory so it can be equally as strategically removed. While people want all the data in the world, no one wants to wait for it.

To look at these two concepts together, think of a Rubik's cube where each axis represents a different data source. There are nine boxes on each side of the cube. Now picture a fixed multidimensional array variable where we'd declare something to the tune of  int   multiDimArray [9] [9] [9]. The 9s represent the number of blocks on each side of the cube. Think of these as values in the tables. Fixed arrays are more efficient memory wise than dynamic arrays.

I know I skimmed over a bunch of details above but again this is a high level look at these concepts. If I explain in more detail than the above, I'm defeating the whole purpose of these posts.

PART I:      Overview and the 'Master' BI Components list
PART II:    Multidimensional aggregation and allocation
PART III:   Denormalization, tagging and standardization
PART IV:   Realtime reporting with analytical alert
PART V:     A method of interfacing with unstructured data sources
PART VI:   Group consolidation, budgeting and rolling forecasts
PART VII:  Statistical inference and probabilistic simulation
PART VIII: Key performance indicators optimization
PART IX:    Version control and process management
PART X:     Open item management

Monday, August 4, 2014

Business Intelligence Components Part 1: Overview and the 'Master' BI Components list

Business Intelligence (BI) is a hot topic in today's business landscape. Everyone wants it but not everyone knows what they need. In describing a business' needs and analyzing capabilities of existing BI solutions, people often refer to a list of generic classifications of BI components.

The interesting thing about this is that someone (or organization) had compiled a list of BI components in which everyone seems to refer to in all of their BI articles. It's also found on Wikipedia (http://en.wikipedia.org/wiki/Business_intelligence). Whether all these articles are all referring to this source for their information or not is irrelevant. The important thing is this list is out there and is used verbatim and in order in many locations.

Everyone seems to be describing BI as being something along the lines of "made up of an increasing number of components. These include the following" and then including the below list from Wikipedia http://en.wikipedia.org/wiki/Business_intelligence:
  • Multidimensional aggregation and allocation
  • Denormalization, tagging and standardization
  • Realtime reporting with analytical alert
  • A method of interfacing with unstructured data sources
  • Group consolidation, budgeting and rolling forecasts
  • Statistical inference and probabilistic simulation
  • Key performance indicators optimization
  • Version control and process management
  • Open item management

  • Funny thing is no one actually talks about what these are or why their important. They just rely on Wikipedia's BI knowledge to provide generalized talking points. ~95% of the articles mention the components in fancy wording. The other discussions I found on the specific topics got so far under the hood that most people would give up reading after paragraph one.

    The following series of blog posts is meant to provide a high level look at what these components of BI actually mean in layman's terms. I originally had these in one GIANT post but it was getting ridiculous so I made this a ten part series with this being part 1.

    PART I:      Overview and the 'Master' BI Components list
    PART II:    Multidimensional aggregation and allocation
    PART III:   Denormalization, tagging and standardization
    PART IV:   Realtime reporting with analytical alert
    PART V:     A method of interfacing with unstructured data sources
    PART VI:   Group consolidation, budgeting and rolling forecasts
    PART VII:  Statistical inference and probabilistic simulation
    PART VIII: Key performance indicators optimization
    PART IX:    Version control and process management
    PART X:     Open item management

    Monday, July 28, 2014

    AX 2012 Max Buffer Size setting vs AX 2009 and before

    'MaxBufferSize' is a system value for the Dynamics AX that may need to be adjusted to allow large queries or variables to be used. The adjustment becomes especially true when dealing with import/export of data in a single variable (like loading a large XML into an XML variable). It's primary use is to throw an error when a file or query falls outside of the 'expected max' value. This prevents the system from being brought to its knees from an unexpected scenario or file or query 'much' larger than expected. Very large report queries can draw an error triggered from this value as well.

    In Dynamics versions AX 2009 and before, this setting was hidden in the depths of the registry. I streamlined changing this value via a job I posted in the below blog post: 'Insufficient Memory to Run Script - MaxBufferSize'. This was helpful for environments where changing registry values or restricted access was an issue. http://daxdude.blogspot.com/2013/02/insufficient-memory-to-run-script.html 
     
    I think the reason it was hidden was to prevent people from nonchalantly changing the maximum buffer size to something like 500MB in a matter of seconds. Navigating and changing a value in the registry makes people think a little harder about the consequences of changing a value. 
     
    Now in AX 2012, this parameter is available for everyone to use in the AX Server Configuration Utility. Users can change this value without crawling around in the registry but be very careful with changing this value from the default. Depending on application, it can be very useful to change this value quickly and may have little to no impact seen. In other applications, this can potentially take your system down to its knees by allowing a user to run something like a large query that will be 'too' large for the anticipated system load.

     
     

    Friday, July 18, 2014

    Dynamics AX - How to make a table an optional parameter in a method

    I couldn't remember how to make a table value option for a method. I've done it a ton before but just couldn't recall at the time. Tried doing a few searches and didn't find anything so thought it would be a good post.

    Dynamics AX can allow parameters to be optional for a given method. This is accomplished by assigning a parameter to an appropriate value at the top of the method (see below example). If there is no assignment, the parameter is required. The one rule is that all optional parameters must be after the mandatory ones. It is not allowed to have a mandatory following an optional one.

    When calling the method, you can see which parameters are mandatory and which are optional as the optional values will show up with a bracket '[' in them in the intellisense.

    All that being said, below is how you would accomplish making a table optional with a null value in its place. Simple assign the functions parameter to a value of 'null'.

    public void processInbound(Table1 _mandoatoryTableParam, Table2 _optionalTableParam = null)


    For additional information about certain data types being null values, see below:

    Null Values for Data Types [AX 2012]
    http://msdn.microsoft.com/en-us/library/aa846236.aspx
    Type
    Value treated as null
    Date 1900-01-01
    Enum Element with its value set to 0.
    Integer 0
    Real 0.0
    String An empty string
    Time 00:00:00
    Utcdatetime Any value with its date portion as 1900-01-01 is treated as null, regardless of the time portion value. Therefore the value 1900-01-01T22:33:44 is treated as null.
    NoteNote
    Any utcDateTime value with its date portion as 1900-01-01 is displayed as blank by the X++ print statement. Only the value 1900-01-01T00:00:00 is displayed as blank by the Global::info method. That is the value from the DateTimeUtil::MinValue method.

    Friday, July 4, 2014

    AX 2012 Maximum Export to Excel and Performance Data Issues


    One of the most valuable features of AX to an organization is its capability to get the right information to the right people at the right time (e.g. ad hoc reporting). A major way to accomplish this is to leverage AX's tight integration Excel for virtually limitless reporting capabilities across multiple data sources.

    In AX 2012, there is a way to export data to Excel from an AX grid, with possible filters and user form preferences (e.g. MorphX field changes). The shortcut to this has changed over time (ctrl+e vs Ctrl+t) but there may also be an actual Excel Export button on the form. While this feature is incredibly useful, there are a few downsides to this:
    • it does require the AX client's full attention while exporting   
      • User's AX client will be unusable 
    • File generation can take a significant amount of time (sometimes >45 mins for large data set)
    • There is a limit to the number of rows that can be exported
      • CRM to Excel is 10k lines
      • AX to Excel is 65k lines (I believe)
    Depending on the organization, these limitations can be incredibly debilitating. Some limitations can be configurable but others cannot.

    So how would we overcome these limitations? We can address them point by point:
    1. AX client usage -> Move the processing to the server freeing up the user's AX instance to do other tasks  
    2. File Generation time -> Processing on the server should be faster than on the client so file will be ready sooner  
    3. Row Limit -> Create and save an excel file via X++ rather than using AX's export feature
    Unfortunately, we can't leverage this solution for exporting using a keyboard shortcut (e.g. Ctrl+t) but we can add it when exporting using a 'Export to Excel' button. As examples, there are a number of these buttons in base AX already. The key is to change the functionality behind these buttons and utilize the code to alleviate the issues detailed above.

    To accomplish this, we need to:
    • Override the clicked method on the 'Export to Excel' button (or add one to the form)
    • Remove the super() and paste in the code below (includes the file location field which is required)
    • Create a class and action menu item which will loop over a data source and form/usage data of the grid to create a file in Excel which will reflect exactly what the user sees within AX. This should extend run base batch.

    With the above, the user can get a prompt asking if and where they would like to create a file with the specific data to Excel. This will utilize base AX's batch functionality so the user can either run it manually at that exact moment or have it run it batch for a specific time. The later of this option allows the user to continue with their daily functions.
     
    The code is not too complex and shouldn't take too long to assemble including testing. There are a few gotchas in the code like creating the fields in the Excel to the exporting user's usage data preferences, but a pretty fun overall mod. Hopefully the above will give some people a direction to take to extend AX in a very practical application.