Saturday, August 15, 2015

AX 7 - New Features

Recently, I came across a white paper providing summary of new features that have been implemented in AX7.  The paper needed partner source access so I am providing highlights here for those who don't have access to partner source. Please note that the White paper is draft and subject to change.

AX  NEW FEATURES:
FOUNDATION
What can you do?
AX 2012
‘AX 7’
Access the client, anytime, anywhere
The AX 2012 desktop client provided a full set of forms, but was limited to running on Windows machines and required installation. Terminal Server was often used with the desktop client to enable access over a WAN. The Enterprise Portal web client provided a reduced set of forms.
The two AX 2012 clients have been replaced by a single, standards based web client that provides the full set of functionality of the desktop client with the reach of the Enterprise Portal client.



FINANCIALS MANAGEMENT
What can you do?
AX 2012
‘AX 7’
Export account structures to Excel

Not supported
You can now select an account structure and export that to Excel.
View ledgers and advanced rule structures associated with an account structure on a single form
In AX 2012, the user has to navigate to multiple forms to see the ledger that the account structure is using.
Fact boxes have been added to the account structure form.
Filter Management Reporter (labeled Financial reporting in ‘AX 7’) reports based on dimension, attributes, dates, and scenarios
All filtering of Management Reporter reports was handled through the design of the report. If a user with viewing privileges wanted to view a report for a different date, for example, this required a report designer to make the modification
Report options have been added so when viewing a report, different filters can be applied and a new report is generated based on those filters.
View Management Reporter (financial reports) within the ‘AX 7’ client
A separate web client was used for viewing Management Reporter reports.
A list of all financial reports can be accessed within the ‘AX 7’ client. The user selects a report to view, and the report is rendered within the ‘AX 7’ client.
Monitor budget vs actuals and create ledger forecasts using the Ledger budgets and forecasts workspace and additional inquiry forms
Not available
The workspace can be accessed through the ‘AX 7’ dashboard. It includes links to a number of new inquiry forms: Actuals vs budget summary, Budget control statistic summary, Budget register entries, Budget plans.
Create layouts for budget plans and forecasts
The Budget plan document is viewed as a list of lines with effective dates and amounts for financial dimension combinations. The user must create and use Excel templates to view budget plan data in a pivot.
An unlimited number of layouts is available for budget plans and forecasts. You can combine selected financial dimensions, user defined columns, and other row attributes (such as comments, projects, assets, etc.) in the layout. Users can switch the layout for the budget plan document on the fly and edit data using any selected layout. Budget planning configuration is simplified by eliminating scenario constraints and using layouts to define which data can be viewed and edited in each budget plan document stage.
Print the Vendor Invoice Transactions report with information from the Detailed Due Day List which includes the days past due.
In AX 2012, you had to print two different reports: the “Detailed Due Day List” and the “Vendor Invoice Transactions” report.
The information contained on the two reports were consolidated onto the “Vendor Invoice Transactions” report. The Detailed Due Day List was deprecated.


HUMAN CAPITAL MANAGEMENT
What can you do?
AX 2012
‘AX 7’
Transfer skills and certificates to class participants upon course completion
Manual process in AX 2012.
Upon completion of a course a new option will be available to update participant’s records with the new skills and certificates.
Quick employment verification capability
Manual process in AX 2012
Accessed from a workspace or the employee form HR can quickly verify employment.
Enable employees to view, update, and delete information from the system
Available in AX 2012 with limited view and update capability.
This feature is enabled for employees and contractors to view a wide range of personal data with optional workflow when creating new, updating existing, or deleting information from the system.
Enable managers to view or edit employee information
Available in AX 2012 with limited view and update capability.
Managers are empowered based on configuration settings and security to view or edit employee information.
Encrypt ID numbers
Not Available
All Employee ID (SSN) numbers are encrypted.
Access compensation processing results
Available only at time of processing
Compensation processing results can now be accessed at any point after the process has run.
Access benefit processing results
Available only at time of processing
Benefits processing results can now be accessed at any point after the process has run.
View Date Effective timeline changes
Not Available
This comparison tool is available for Employees, Positions, and Jobs. It provides a comprehensive view of changes from one version of a record to another.
View employees by company
Manual process in AX 2012 through filtering
Employee and Contractor lists are automatically filtered by the company you’re logged into.
Update course participants list
Not Available
Course participants can be removed from the participants list.
Manage compensation events in mass
Not Available
This feature provides a streamlined processing of compensation changes for employees.


Wednesday, August 12, 2015

AX 2012 Get Item purchase price using x++

Question: I need to get Item purchasing price using x++ code.

Answer:

container result;

result = PriceDisc::findItemPriceAgreement(ModuleInventPurchSales::Purch, ItemId, InventDim, Unit, today(), Qty, VendAccountNum, CurrencyCode, "0");

purchPrice            = conPeek(result, 0);

Note: The variables shown above to pass as parameters are self explanatory and should be replaced with your variables.

Monday, August 10, 2015

Redirect page to some other page when dialog closed on EP

Recently, we had a requirement to open a dialog page from list page and when user closes the dialog, we had to redirect our page to some other page. I know it can be done very easily by handling the close dialog event handler. However, we are talking about list page here. Where we don't have option to write c# code. This is where the web development skills comes into play and can help you achieve some fast results where you don't have much time to modify sharepoint web parts etc.

I was able to accomplish this using Javascript. I registered the closeWindow handler when the dialog was loaded, built the URL for the EP menu item using c# code and registered the script. Whenever the dialog would close, a javascript function would execute to redirect the page. Remember, in my case, the requirement was to redirect the page but if you have some other requirement when closing the dialog, you can achieve that as well. Sample code:

protected void Page_Load(object sender, EventArgs e)
    {
        String linkOneURL;
        String clientScriptName = "CloseWindow";
        Type clientScriptType = this.GetType();
        ClientScriptManager cs = Page.ClientScript;
        System.Text.StringBuilder javaScript = new System.Text.StringBuilder();
        AxUrlMenuItem shoppingCartPageMenuItem = new AxUrlMenuItem("EPCSSSalesBasket");
        String shoppingCartUrl = shoppingCartPageMenuItem.Url.OriginalString;
        String buildUrl = String.Empty;

        if (!IsPostBack)
        {
        
            linkOneURL = this.dsCustTable.GetDataSet().DataSetRun.AxaptaObjectAdapter.Call("BuildLinkOneURL").ToString();
            this.LinkOneFrame.Attributes.Add("src", linkOneURL); // I am loading some third party page here under IFrame.

            if (!cs.IsStartupScriptRegistered(clientScriptType, clientScriptName))
            {
                buildUrl = "window.frameElement.navigateParent('" + shoppingCartUrl + "');"; // This is the URL i want to redirect.


                javaScript.Append("<script type='text/javascript'>");
                javaScript.Append("function UnLoadWindow() {");
                javaScript.Append(buildUrl);
                javaScript.Append("}");
                javaScript.Append("window.onbeforeunload = UnLoadWindow;");
                javaScript.Append("</script>");

                cs.RegisterStartupScript(clientScriptType, clientScriptName, javaScript.ToString()); // Registering the Javascript function - this would be executed when the dialog is closed.

            }
           
        }
    }

AX 2012 showing third party website in EP/Sharepoint dialog

We recently had a requirement to show a third party website in our EP site. The requirement was to show the website in Enterprise Portal dialog and URL was not static. We had to build URL at runtime by using fields from the selected record. As you know, we cannot write code on EP list page (we can use interaction class but we cannot write c# code for list page), so options were very limited. We added a Menu item button on List page and passed the selected record as context to that button. The button was pointing to a new web control (or sharepoint page) and we kept this page blank. All it had was an IFrame. See sample HTML below.

<dynamics:AxDataSource ID="dsCustTable" runat="server" DataSetName="dsCustTable" ProviderView="CustTable"></dynamics:AxDataSource>
<div style="height: 100%">  
    <iframe id="LinkOneFrame" runat="server" height="800" width="100%" ></iframe>
</div>

Now, we need to load our page in that IFrame. First thing was to get the URL as it is not a static URL but we need to build that on fly. We created a static method on table to build that using x++ and returned the URL from x++.

Following is the c# code to get the URL and load the page in URL.

linkOneURL = this.dsCustTable.GetDataSet().DataSetRun.AxaptaObjectAdapter.Call("BuildLinkOneURL").ToString();

this.LinkOneFrame.Attributes.Add("src", linkOneURL);

When you click the button on list page a new popup dialog would open and it would show the page in Iframe.