Monday, December 1, 2008

Microsoft Dynamics AX 2009 Application Integration Framework(AIF) Benchmark

Microsoft Dynamics AX 2009 Application Integration Framework Benchmark

Microsoft Dynamics AX Application Integration Framework Benchmark exercises Core Sales Order processing thru Invoicing and GL Creation thru posting with high degree of scale

In June 2008, Microsoft Corporation conducted the Microsoft Dynamics® AX 2009 Application Integration Framework (AIF) benchmark to measure the performance and scalability characteristics of Microsoft Dynamics® AX 2009 in a simulated distribution scenario. This benchmark exercised core Accounts Receivables scenario involving sales order creation thru AIF and invoicing of sales orders thru batch jobs. It also exercised core General Ledger scenario involving journal creation thru AIF and posting of journals thru batch jobs. The scenarios generated load on Application Object Server (AOS)—in this benchmark, each AOS instance was hosted on a separate server. In a Microsoft Dynamics® AX system, the AOS processes business logic in communication with clients and the database; the database server provides data to the AOS.

For more information and download please check the following link AX 2009 Application Integration Framework Benchmark

Microsoft Dynamics Snap sample applications for Microsoft Dynamics AX 2009

Release of Microsoft Dynamics Snap sample applications for use with Microsoft Dynamics AX 2009

These samples show the potential of integrating the 2007 Microsoft® Office system with Microsoft Dynamics® AX by providing functioning end-to-end capabilities in source code form. Partners and customers can build on these samples and use the techniques they employ to build solutions that access the data and processes in Microsoft Dynamics AX from the productivity and collaboration tools of the Microsoft Office system. Two snap applications are now available with Microsoft Dynamics AX 2009:

This release contains the following snap-in applications for use with Microsoft Dynamics AX 2009 and Microsoft Office 2007.

Offline Expense - This snap-in enables expenses to be entered in Excel while disconnected from the corporate network, and then posted to Dynamics AX at a later time. This snap-in uses WCF-based services and LINQ to retrieve data from Dynamics AX, and uses the Application Integration Framework, or AIF to send business documents to Dynamics AX.

Business Data Lookup (BDL) - This snap-in enables information workers to access data from Dynamics AX from within Excel, Word and Outlook. This snap-in is an upgrade of the BDL snap-in that was distributed with Microsoft Dynamics AX 4.0.

These applications require .Net 3.5, Microsoft Office 2007, Microsoft Visual Studio 2008 and Microsoft Dynamics AX 2009. Each snap-in contains a document describing the basic architecture, functional footprint, and deployment steps for exploring the sample code.

For more information and download please check the following link Microsoft Dynamics Snap for Dynamics AX 2009

Microsoft Dynamics AX 2009 Service Pack 1

During EMEA Convergence, the release of Microsoft Dynamics AX 2009 SP1 was announced. You can see the announcement of SP1 availability on the Microsoft Dynamics AX Landing Page on PartnerSource.

Similarly, you can see the announcement on the Microsoft Dynamics AX Landing Page on CustomerSource.

With the download of Microsoft Dynamics AX 2009 SP1 the following materials will be made available:

– Service Pack 1 Downloadable Package

– Downloadable Package for Updated Help Files*

– Release Notes (List of known issues)

– Updated What’s New Document – A section on SP1 is added

- Service Pack 1 Install Guide

For further details on SP1 please take the links to PartnerSource and CustomerSource announcements.

Sunday, August 10, 2008

Rapid Configuration Tool for AX 2009

The new release of Rapid Configuration Tool (RCT) for Dynamics AX2009 is now available for download at Partner Source

The Rapid Configuration Tool is integrated into Microsoft Dynamics® AX and provides key assistance to partners and customers during implementation by providing project management features, easier configuration access, communication support and documentation on how to successfully configure Microsoft Dynamics® AX.

Click here to download. (Requires Partnersource Login Access)

Monday, July 28, 2008

Upgrade from AX 3.0 , AX4.0 to AX 2009

The steps below provide a high-level overview of the tasks that you must complete to upgrade from Microsoft Dynamics AX 3.0 to Microsoft Dynamics AX 2009.

•Back up your existing database and application files.

•Import two .xpo files from the installation media to assist with data upgrade.

• UpgradeColumnList.xpo, for 32-bit to 64-bit RecId field conversion.

• LeftJustified.xpo, for removing any trailing spaces from fields.

* Note: To help improve performance, you can apply the LeftJustified.xpo on the database that you create in step 4 after you’ve used the Microsoft Dynamics AX DB Upgrade Preparation tool but before you start the Microsoft Dynamics AX 2009 AOS.

•(Optional) To help improve performance, remove all user data and logs of Microsoft Dynamics AX 3.0. For example, clean up the SysDatabaseLog table.

•Create an empty database for Microsoft Dynamics AX 2009 in SQL Server 2005.

•(Optional) To help improve performance, set initial data and log file sizes so that they don’t increase while you perform the data upgrade process.

•(Optional) To help improve performance, set the recovery model to Simple for the Microsoft Dynamics AX 2009 Database.

•Run AXDBUpgrade.exe (The Microsoft Dynamics AX DB Upgrade Preparation tool). Note: To help improve performance, you can run this tool in Multithreaded mode. For example, to run this tool in 10 threads, enter AxDbUpgrade.exe P/10 at a command prompt.

•(Optional) Apply the LeftJustify file imported in step 2 to the Microsoft Dynamics AX 2009 database created in step 4.

•Back up your Microsoft Dynamics AX database. Your database is ready to be upgraded. •Run the Microsoft Dynamics AX 2009 Setup file from the installation media. During installation, select the database that you created in step 4.

•Copy your upgraded customized file into the correct application directory.

•Start the AOS.

•Start the Microsoft Dynamics AX 2009 client. The Upgrade checklist is displayed automatically.

•Complete the steps in the Upgrade checklist to finish upgrading.

The steps below provide a high-level overview of the tasks that you must complete to upgrade from Microsoft Dynamics AX 4.0 to Microsoft Dynamics AX 2009.

- Back up your existing database and application files. - (Optional) To help improve performance, remove all user data and logs of Microsoft Dynamics AX 4.0. For example, clean up the SysDatabaseLog table.

- (Optional) To help improve performance, set initial data and log file sizes so that they don’t increase while you perform the data upgrade process.

- (Optional) To help improve performance, set the recovery model to Simple for the Microsoft Dynamics AX 2009 Database. - Back up your Microsoft Dynamics AX database. Your database is ready to be upgraded.

- Run the Microsoft Dynamics AX 2009 Setup file from the installation media. During installation, select your existing Microsoft Dynamics AX database.

- Start the Microsoft Dynamics AX 2009 client. The Upgrade checklist is displayed automatically.

- Complete the steps in the Upgrade checklist to finish upgrading.

Upgrading to Microsoft Dynamics AX 4.0 and Microsoft Dynamics AX 2009 -convergence session please check following link Click Here

Friday, July 11, 2008

Web Service Basic

Introduction
We all talk about webservices, webservices can do this and webservices can do that. But when we are asked to make one, we hesitate. Maybe it's because we never made a webservice before, and all the time playing with Webforms and Windows Forms or even Console Applications. By the way, I love Console applications. In this article, I will show you how to create a simple webservice that is consumed by a Console application client.
Making the WebService:
First, start your Visual Studio .NET, and in the project type, select ASP.NET WebService. In the left pane, choose the language of your choice. In this example, I will be using Visual C#.NET. Once you select the project, a page will appear which will be more like a design page, switch to its code view. In the code view, you can see lot of comments and C# code already written for you. You will also see that at the bottom, there is a method HelloWorld which is written for you by default, so you can test your service and of course say hello to the world. After removing the unwanted code and comments, your code will look like this:

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;
namespace WebServiceExample
{
public class Service1 : System.Web.Services.WebService
{
public Service1()
{

InitializeComponent();
}

// Add the Description Attribute so you
// will know the purpose of your WebService
[WebMethod(Description="This Method prints HelloWorld")]
public string HelloWorld()
{
return "Hello World";
}
}
}


Let's dig into this small code. [WebMethod] Attribute denotes that this method will be used by the clients, also this method has to be public in order for a client to use it. Description inside the WebMethod Attribute just gives the method more meaning. Don't worry about the InitializeComponent() method since it's written by default.
Running the WebService:
OK, now you have made your first kick ass WebService (without even writing a single line of code). Let's run it and check whether it gives the correct result or not. In the Solution Explorer, right click on the .asmx file, and select View in Browser


Once you click on "View in Browser", the next screen you will see will be something like this:

I have erased most of the stuff, so you can only see the method that you need in this example. Below, you can see the method HelloWorld and the description you wrote for the method.
Now, click on the HelloWorld method. I don't want to scare you with all the SOAP and HTTP code produced, so I am only going to paste the screen shot which will be relevant to this example.

Alright, so far so good. Now, just press the Invoke button to see the result of your method named HelloWorld().

This is cool. You have just tested your first webservice and it ran since you didn't coded it. I know what you are thinking right now. Is the client going to see the result like this strange format (this is XML format). Well, of course not. That's why you need to make a Proxy class which consumes this service.
Making a Proxy Client:
Let's make a Console application which consumes this service. You can use any language and platform to consume this service, that's the purpose of XML WebService. Now, this procedure requires some mouse clicking :). So I will write down the steps instead of pasting the screen shots.

  • Start a new project which will be a Console Application in Visual C#.NET.
  • Once you see the code view in the Console application, right click on the project name from the Solution Explorer. Remember that project name will be written in bold.
  • Click on "Add Web Reference".
  • Paste the URL of your WebService. You can get the URL of your WebService when you view your webservice in IE or any other browser.
  • Click GO.
  • Your webservice will be loaded. In the Web Reference Name textbox, write "MyService" and click Add Reference.
  • You will see that the web reference has been added in your Solution Explorer, meaning that webservice is ready to kick some butt.

Now, all you have to do is to make the instance of the WebService class using the reference name that you provided, which is "MyService".

using System;
namespace MyClient
{
class Class1
{

[STAThread]
static void Main(string[] args)
{
// Make an instance of the WebService Class
// using the Web Reference you provided
MyService.Service1 service = new MyService.Service1();
// Assign message what ever is returned
// from HelloWorld in this case "HelloWorld"
string message = service.HelloWorld();
// Prints out the message on the screen
Console.WriteLine(message);
}
}
}

And that's it. You use the webservice class just like any other class. Something you need to keep in mind is that if you decide to make a new method in your webservice and want to make it available to the client, then always remember to build your webservice solution so that the assembly can be updated. If you don't build your webservice, you won't be able to see the methods on the client side.

Wednesday, July 9, 2008

Demo Data for Microsoft Dynamics AX 2009

The demo data for Dynamics AX 2009 has been released. Its "Contoso Entertainment Systems (CES)" . Now the Demo data comes in 2 flavours... standard dat/def & a SQL backup.

The Demo Data set for Microsoft Dynamics® AX 2009 is no longer based on the Global Trade and Manufacturing Company. Based on market feedback we have created a new Contoso Entertainment systems group of companies. It comes with 2 fiscal years of transactional data that enable us to demo our stronger Business Intelligence story and Role Center pages, while allowing us to easily expand the demo data story in future releases as we expand Microsoft Dynamics® AX’s functionality footprint.
Click the link below to download.
Demo Data for Microsoft Dynamics AX 2009 [Requires Partnersource Logon]

How Do I” Videos — Dynamics AX

On this page you will find videos designed for all Microsoft Dynamics AX developers, from the novice to the professional. New videos are added regularly, so check back often. (click here)
Microsoft has added following Videos
1. Forms Series #1 How Do I: Link Parent and Child Forms by Using Dynamic Links?(6 minutes, 47 seconds)
2. Enterprise Portal Series
#1 How Do I: Use Record Context in Enterprise Portal?(14 minutes, 51 seconds)

#2 How Do I: Create a Simple List Page in Enterprise Portal?(4 minutes, 52 seconds)

#3 How Do I: Create a Simple Task Page in Enterprise Portal?(4 minutes, 39 seconds)

#4 How Do I: Create a Simple Wizard Page in Enterprise Portal?(7 minutes, 39 seconds)

#5 How Do I: Call an X++ Class From an EP User Control?(7 minutes, 26 seconds)

#6 How Do I: Add a Range to a Dataset in an EP List Page?(5 minutes, 13 seconds)
3. User Interface Series #1 How Do I: Navigate the Client User Interface?(8 minutes, 53 seconds)
4. Application Integration Framework (AIF) Series #1 How Do I: Create a Custom AIF Pipeline Component?(7 minutes, 28 seconds)

Monday, July 7, 2008

Installing Ax 2009

Installing Microsoft Dynamics AX 2009 requires more than the installation DVD. This post will provide you with an overview of the software components and their download sources to get you better prepared for the installation.

Following Components are required to install Ax 2009

  • Microsoft Dynamics AX 2009 Release DVD ISO which You may download from download the Microsoft Dynamics 2009 Release May Edition DVD ISO file (1.7 GB in size) from PartnerSource Since it is in ISO format, you may use any Virtual DVD software to mount it as a DVD disc to use it directly or to extract the files to a physical location.

  • Microsoft .NET Framework 3.5 Microsoft Dynamics AX 2009 utilized the latest features from Windows Presentation Foundation, etc. You need to install Microsoft .NET Framework 3.5 before you are able to install Microsoft Dynamics AX 2009. The table bellow shows the options you have to get the .NET Framework 3.5 installed. Pick one that suits your need best

Microsoft .NET Framework 3.5 Live Installer

Microsoft .NET Framework 3.5 Full Package

  • Service Pack 2 for Microsoft SQL Server 2005 If you are hosting your Dynamics AX 2009 data with Microsoft SQL Server 2005, you will need Service Pack 2 or later. This service pack has been released for over a year. In case you have not updated your Microsoft SQL Server 2005 to SP2, you may download the update at Microsoft Download: SQL Server 2005 SP2.

  • Dynamics AX 2009 Demo Data Microsoft has not realeased any official demo data for Dynamics AX 2009 Release yet. but you can download and use Demo data AX 2009 CTP3 VPC Ver02

  • Microsoft Windows Sharepoint Services 3.0 with Service Pack 1 Sharepoint Services 3.0 SP1 is required to host the Role Centers and Enterprise Portal. It is not included in the Dynamics AX 2009 Installation DVD. You have an option to use Microsoft Office Sharepoint Server 2007 or Microsoft Windows Sharepoint Services 3.0. It is available for download at Microsoft Download. Windows SharePoint Services 3.0 with Service Pack 1

  • Microsoft Visual Studio 2008 Shell (isolated mode) Redistributable Package This package is required for the Reporting Extension to work. There are two Microsoft Visual Studio 2008 Shell redistributable package; isolated and integrated. Make sure you are having the isolated package. When you install this package, please note that the executable Microsoft Visual Studio 2008 Shell (isolated mode) Redistributable Package

Thursday, June 26, 2008

The Enterprise Portal team introduces new blog for Microsoft Dynamics AX 2009

The EP team has just created a blog about their stuff. These guys know their stuff, and are heavy users of managed code interoperability with X++.
Check it out http://blogs.msdn.com/epblog/

Thursday, June 12, 2008

Microsoft Dynamics AX 2009 SDK


Microsoft Dynamics AX 2009 SDK
Together with the release of the actual product, documentation for the Microsoft Dynamics AX 2009 SDK has been released on MSDN. There is a lot stuff there including lots of info on the new EP 2009 framework here. Check it out. Also check out the Microsoft Dynamics AX Developer Center.

Open table or browse from editor code


Many times Developer needs to open the table or browse while coding. Developer has to go to AOT then search for that table. To ease of this situation by following code developer can easily open the table or browse from Editor windows itself.

Copy paste the following methods in EditorScript Class of axapta
//------------------------
void AX_openTable(Editor e)
{

#AOT
TreeNode tr;
XInfo xInfo = new xInfo();
str selection;
;
selection= strltrim((strrtrim(Editorscripts::getSelectedText_n(e)))); // modified standard method getSelectedText
tr = TreeNode::findNode(#TablesPath + '\\'+selection);
if(tr)
tr.AOTnewWindow();
else
Throw error(strfmt("Table %1 not found",selection));

return;

}

//----------
static str getSelectedText_n(Editor e)
{
int i;
str text;
str line;
int startLine = e.selectionStartLine()+1;
int endLine = e.selectionEndLine()+1;
int startCol = e.selectionStartCol();
int endCol = e.selectionEndCol();

if (startLine == endLine && startCol == endCol)
{
e.firstLine();
while (e.moreLines())
{
text += e.getLine();
e.nextLine();
}
}
else
{
e.firstSelectedLine();
for (i = startLine; i <= endLine; i++)
{
line = e.getLine();
if (i == startLine && i == endLine)
{
line = substr(line, startcol, endCol-startCol);
}
else
if (i == endLine)
{
line = substr(line, 1, endCol-1);
}
else
if (i == startLine)
{
line = strrep(' ', startCol-1)+substr(line, startCol, strlen(line));
}

text += line;
e.nextSelectedLine();
}
}
return text;
}

//---------
To Browse the Table Add
//-------
void AX_browseTable(Editor e)
{

#AOT
TreeNode tr;
TableId TableId;
XInfo xInfo = new xInfo();
str selection;
SysTableBrowser SysTableBrowser;
;
selection= strltrim((strrtrim(Editorscripts::getSelectedText_n(e)))); // modified standard method getSelectedText
tr = TreeNode::findNode(#TablesPath + '\\'+selection);
if(tr)
{
TableId = tablename2id(selection);
if(TableId)
new SysTableBrowser().run(tableID);
}
else
Throw error(strfmt("Table %1 not found",selection));

return;

}

Wednesday, June 11, 2008

Data Authorization in axapta through coding

Data authorization in Microsoft Dynamics AX is performed in three ways:
1.Implicit Authorization
Implicit authorization means that the kernel performs the check. An example of this would be when you are accessing a data source from a form or report. Record level security is used to determine whether the user has access to run the form or report.
2.Checks Done by Setting Security Properties on AOT Objects
An example of this is setting the security key and needed access level properties on menu items and on form or report controls.
3.Checks done in X++
Examples:
if (hasSecurityKeyAccess(securitykeyNum(mySecurityKey), AccessType::View))
{
myMethod();
}

if (hasMenuItemAccess(menuItemDisplayStr(myMenuItem), MenuItemType::Display)))
{
myMethod();
}

DictTable dictTable = new DictTable(tablenum(myTable));
if (dictTable.rights >= AccessType::Insert))
{
myMethod();
}

if (isConfigurationkeyEnabled(configurationkeyNum(myConfigurationKey))
{
myMethod();
}

How to print a query name on a report in Axapta

The sysQueryForm form is used to create multiple queries for a report. This form is used by most reports in Microsoft Axapta.

The sysQueryForm form contains a name field. The contents of this name field are printed on the report. However, there is no direct relation between the contents of this name field and the query name.

You can customize Microsoft Axapta to print the query name on the report. To do this, follow these steps:
1. Modify a method to capture the value of the name field. This value holds the query name.
2. Create a method to perform the following tasks:
• Obtain the value of the name field.
• Print this value on the report.


The following code applies to the QueryLoad method. This example code indicates how to modify a method to perform the following tasks:
• Capture the query name.
• Set this variable to a global variable.
switch (_name)
{
case sysQueryForm.queryLastUsedLabel():
saveBtn.enabled(false);
deleteBtn.enabled(true);
break;
case sysQueryForm.queryActiveLabel():
saveBtn.enabled(false);
deleteBtn.enabled(false);
break;
default:
saveBtn.enabled(true);
deleteBtn.enabled(true);

// Add the following two lines to display the query name value.
globalCache = classfactory.globalCache();
globalCache.set("Query","ReportQuery",_name);

break;
}

The following code applies to the Display method. This example code indicates how to create a method to perform the following tasks:
• Obtain the value of the name field.
• Print this value on the report.
Display custAccount Queryname()
{
SysGlobalCache globalCache;
Name queryName;
;

globalCache = classfactory.globalCache();
queryName = globalCache.get("Query","ReportQuery",null);

return queryName;
}

How to call Axapta methods from .net

Using .NET Business Connector, you can access Microsoft Dynamics AX data or business logic from a .NET-connected application.
To add a reference to .NET Business Connector
•Open Visual Studio.
•In Solution Explorer, right-click References and select Add Reference.
•In the Add Reference window, select the Browse tab.
•Specify the location of Microsoft.Dynamics.BusinessConnectorNet.dll, and then click Add.
Add code to call a Microsoft Dynamics AX method in Visual Studio C#.
using System;
using Microsoft.Axapta.BusinessConnector;
namespace AXMethodCall
{
class Class1
{
static void Main(string[] args)
{
// Create the .NET Business Connector objects.
Axapta ax;
object o;
bool b;
try
{
// Login to Microsoft Dynamics Ax.
ax = new Axapta();
ax.Logon(null, null, null, null);
}
catch (Exception e)
{
Console.WriteLine("An error occurred in object creation or Axapta logon: {0}", e.Message);
return;
}
// Logon was successful.
try
{
// Call a static class method.
o = ax.CallStaticClassMethod("Class Name ", "Method Name",Argument);
}
catch (Exception e)
{
Console.WriteLine("An error has been encountered during CallStaticClassMethod: {0}", e.Message);
b = ax.Logoff();
return;
}
// Log off from Microsoft Dynamics AX.
b = ax.Logoff();
}
}
}

Block Comment in axapta Editor Script(class)

To Comment a code axpta in a Block Like
/*
Some Code
*/
Add the Below Code in Editor Scripit Class in Axapta

void AX_BlockComment(Editor e)
{
int FLine,Eline;
int FCol,ECol;


FLine = e.selectionStartLine();
FCol = e.selectionStartCol();

ECol = e.selectionEndCol();
Eline = e.selectionEndLine();
e.unmark();

e.gotoLine(FLine-1);
e.gotoCol(1);
e.insertLines('//'+' Commented by ' + curUserId()+', on '+date2str(today(),123,2,1,3,1,4 ) + ',' +time2str(timeNow(), 1, 2)+'\n');

e.gotoLine(FLine);
e.gotoCol(FCol);
e.insertString('/*');

e.gotoLine(Eline+1);
e.gotoCol(1);
e.insertString('*/');


}

Send Alert to user from code in AX 4.0

// To send Alert to User From Code
void sendAlertToUsers()
{
SysMailer mail;
UserInfo UserInfo;
EventInbox inbox;
EventInboxId inboxId;
;

select UserInfo where UserInfo.id == CurUserId();
inboxId = EventInbox::nextEventId();

inbox.initValue();
inbox.ShowPopup = NoYes::Yes; // To show Pop up
inbox.Subject = "Aleart Message Through Code";
inbox.Message = "Testing Alerts";
inbox.AlertedFor = "This alert is just for information(Testing)";
inbox.SendEmail = false;
inbox.UserId = UserInfo.Id;
inbox.TypeId = classnum(EventType);
//Enter Table and Field Details
inbox.AlertTableId = TableNum(EmplTable); // Table for which Alert is Generated
inbox.AlertFieldId = fieldNum(Empltable ,Name); // Field for which Alert is Generated
inbox.TypeTrigger = EventTypeTrigger::FieldChanged;
inbox.CompanyId = CurExt();
inbox.InboxId = inboxId;
inbox.AlertCreatedDate = systemdateget();
inbox.AlertCreateTime = timeNow();
inbox.insert();
}