Showing posts from April, 2013

Microsoft Dynamics AX 2012 development Cook Book

Microsoft Dynamics AX 2012 development Cook BookPaperback: 372 pages Publisher: Packt Publishing (May 4, 2012) Language: English ISBN-10: 1849684642 ISBN-13: 978-1849684644
What you will learn from this book
Explore data manipulation concepts in Dynamics AX Build scripts to assist data migration processes Organize data in Dynamics AX forms Enhance your application by using advanced form controls Create custom lookups using AOT forms and dynamically generate them from the X++ code Create and post Dynamics AX journals from code Create and manage purchase and sales orders from code Create a custom electronic payment format and process a vendor payment using it Integrate your application with Microsoft Office Suite Create various Microsoft Office documents that can be used for exporting/importing business data for further distribution or analysis Integrate the system with external systems using various approaches Improve your development efficiency and experience Learn simp…

Official Dynamics AX 2012 R2 Content (update) - Where is it, and how can you find out about updates?

Official Dynamics AX 2012 R2 Content (update) - Where is it, and how can you find out about updates?Hey friends,

I found a good link for Dynamics AX 2012 Resources/Library contents/MSDN links etc.
I am sharing this like for you all to let you know more about Ax World.
Thanks to Mr. KEES HERTOGH who post this valuable post for all of us.

Official Dynamics AX 2012 R2 Content (update) - Where is it, and how can you find out about updates?

Once again many thanks to Mr. Herthogh.

How to install microsoft dynamics ax 2009 on windows 7

How to install microsoft dynamics ax 2009 on windows 7Here is steps to install AX on Win-7 (non-server OS),

Dynamics AX Basic Installation:
Make sure you are logged in through your domain account (domain\user) on your laptop, not local system account. You should have local admin rights on your laptop. Install SQL Server 2008 with SP1. Service account for this should be local system. Install AX 2009. You need to be connected to your domain while installing AX. Ignore warning that says this operating system is not supported.  AOS again should run under local system, instead of your domain account. Because this way you can use AX when you are out of your domain network.
Hint: At the time of installation select Network service and after successful installation convert AOS service account to Local System.
On the next screen, uncheck checkbox which says start AOS after installation.
Click Install and you are done with the basic AX 2009 installation. To get it running with SQL Server 2008 …

Creating Vendors through X++ in AX 2012- PART II

Creating Vendors through X++ in AX 2012- PART IIPrivious Post:  Creating Vendors through X++ in AX 2012- PART I
--Create vendor and associate with vendor--

publicvoid convertToVendor(VendorRequestCreate          _vendorRequestCreate)
    VendorRequestCreate                  vendorRequestCreate = VendorRequestCreate::find(_vendorRequestCreate.VendorNo,true);
if(_vendorRequestCreate.DirPartyType    == DirPartyBaseType::Person)
        vendTable.Party         = dirPerson.RecId;
        vendTable.Party         = dirOrganisation.RecId;
    vendTable.AccountNum    = NumberSeq::newGetNum(VendParameters::numRefVendAccount()).num();
if(vendTable.AccountNum == '')
        vendTable.AccountNum= int2str(_vendorRequestCreate.VendorNo);
    vendTable.Currency      = _vendorRequestCreate.CurrencyCode;
    vendTable.VendGroup     = _vendorRequestCreate.VendGroupId;
    vendTable.PaymTermId    = _vendorRequestCreate.PaymTermId;
    vendTable.DefaultDimension = _vendorRequestCrea…

Compilation error in SysReportLibraryExport class

Compilation error in SysReportLibraryExport class
Recently I moved some code in live server and while compile the application I found that there was a compilation issue in the Class declaration of SysReportLibraryExport class but it seems to be fine with other environments.
I found that this issue is particular client based not on server. I done some R&D like…
1. I compiled this class on server  and it compiled fine. syntax error is gone and there are no more issues in it even though i have opened it on the application

2. Then I complied the same class on Client desktop, here its shows the error       Compilation error in SysReportLibraryExport class
3. I again compile this class on another client on which reporting extension is installed  (Reporting Extension require a SQL BD server for client), and it compiled fine here.
So the conclusion is  that this error in not show stopper for your application, you can use you environment.


Configuration and Security Keys in Axapta

Configuration and Security Keys in AxaptaSecurity Keys
Microsoft Dynamics AX consists of a number of modules. For example, General Ledger, Project, and Administration. To make it easier for an administrator to set up security keys, they are organized the same way for all modules. Only nine security keys are allowed for each module in the Navigation Pane.
Security keys allow administrators to set security on a user group level. Minimizing access on a user group level helps to reduce the attack surface against potential attacks.
Applying Security Keys

The main reasons to apply user-level security are to:
Allow users to do only their designated tasks.
Protect sensitive data in the database.
Prevent users from inadvertently breaking an application by changing code or objects on which the application depends.You need to apply a security key to:
Menu items
Form controls
Report controlsTo create security keys in Microsoft Dynamics AX:
Expand the Data Dictionary node in the Applicati…

High Flying PM......

I could not stop my self to post this....... lol
Check out this 

High Flying PM A man is flying in a hot air balloon and realizes he is lost. He reduces height and spots a man down below. He lowers the balloon further and shouts:

"Excuse me, can you help me? I promised my friend. I would meet him half an hour ago, but I don't know where I am."

The man below says, "Yes, you are in a hot air balloon, hovering approximately 30 feet above this field. You are between 40 and 42 degrees North latitude, and between 58 and 60 degrees West longitude."

"You must be a programmer," says the balloonist.

"I am," replies the man. "How did you know?"

"Well," says the balloonist, "everything you have told me is technically correct, but I have no idea what to make of your information, and the fact is I am still lost."

The man below says, "You must be a project manager"

"I am," replies the balloonist, "but how did yo…

Sunday Fun Day............ Cheers ...........

Hi Friends;
Finally its Sunday tomorrow,  Awhhhhh rest is best this day.
Check these funny Lines for you and your buddies check it out........

Types of Project Managers; which one are you? -- 
If you get in my way, I'll kill you! - ideal project manager
If you get in my way, you'll kill me! - somewhat less than ideal project manager If I get in my way, I'll kill you! - somewhat misguided project manager 

If I get in your way, I'll kill you! - A tough project manager (eats glass, live cats, etc.) If get kill in will way I you. - dyslexic, functionally illiterate project manager 
I am the way! Kill me if you can! - messianic project manager Get away, I'll kill us all! - suicidal project manager 
If you kill me, I'll get in your way. - thoughtful but ineffective project manager If I kill you I'll get in your way. - project manager who has trouble dealing with the obvious 
If a you gotta in my way, I gonna breaks you arm. - project manager from New York 

I am quite confi…

X++ code for document attachment

X++ code for document attachment

In Axapta, we can attach document with Purchase order via document handling, if you need to attached a document using your x++ code, we need to use following x++ AOT objects.
DocuRef (table)DocuActionArchive (class)Here is a generic method that will attach record to any table in AX based on parameters passed to it
void attachDoc(RefTableId _refTableId, RefRecId _refRecId, selectableDataArea _refCompanyId, FileName _name)
    DocuRef docuRef;
    DocuActionArchive archive;
    docuRef.RefRecId = _refRecId;
    docuRef.RefTableId = _refTableId;
    docuRef.RefCompanyId = _refCompanyId;
    docuRef.Name = _name;
    docuRef.TypeId = 'File';
    archive = new DocuActionArchive();
    archive.add(docuRef, _name);
To use this method write following code to attache the document.

this.attachDoc(tableNum(PurchTable), purchTable.RecId, purchTable.dataAreaId, filepathname);

Creating Vendors through X++ in AX 2012- PART I

Creating Vendors through X++ in AX 2012- PART I--Create party for the vendor--

publicvoid TheAxaptaCreateParty(VendorRequestCreate          _vendorRequestCreate)
if(_vendorRequestCreate.DirPartyType        == DirPartyBaseType::Person)
        dirPerson.Name                          = _vendorRequestCreate.VendorName;
        dirPerson.NameAlias                     = _vendorRequestCreate.FirstName;
        dirPerson.NameSequence                  = dirNameSequence::find('First Last').RecId;
        dirPersonName.FirstName                 = _vendorRequestCreate.FirstName;
        dirPersonName.MiddleName                = _vendorRequestCreate.MiddleName;
        dirPersonName.LastName                  = _vendorRequestCreate.LastName;
        dirPersonName.ValidFrom                 = DateTimeUtil::newDateTime(systemDateGet(),str2time ('00:00:00'),DateTimeUtil::getUserPreferredTimeZone());
        dirPersonName.ValidTo                 …

Standalone Installers Of .NET Framework

Standalone Installers Of .NET Framework 4.5, 4.0, 3.5, 3.0 & 2.0 From Microsoft Download Center
Updated: May 6, 2017.

Hi All, Here i am sharing some links to download all .net fromaworks (standalone installations) from microsoft download center.

.NET Framework 4.7.NET Framework 4.6.2.NET Framework 4.6.1.NET Framework 4.5.2
.NET Framework 4.5 Setup
Download 32 bit & 64 bit versions.NET Framework 4.0 Setup
Download 32 bit & 64 bit versions.NET Framework 3.5 Setup
Download 32 bit & 64 bit Versions.NET Framework 3.5 SetupService Pack 1
Download .NET 3.5 Service Pack 1.NET Framework 3.0 Setup
Download 32 bit versionDownload 64 bit version.NET Framework 2.0 Setup
Download 32 bit versionDownload 64 bit version.NET Framework Client Profile Offline Installer
Download .NET Client Profiler Offline Installer-Harry

Multi Tab Lookups in AX

Multi Tab Lookups in Dynamics AXIts a tricky post, just go through it and try to develop yours.
For example you  have a requirement in which you want to show multiple tabs on a lookup form. You have a field in which you want your user to either select a customer or vendor from a lookup then this could be the best option to show multiple tabs and let user select either customer or vendor.

Following are the steps to get this done.
* Create a new form "TheaxaptaLookupForm" with multiple tabs on it ( same as other forms)
* Create a new EDT and The FormHelp property of the EDT should be set to the form you just created "TheaxaptaLookupForm".

For reference you can chcek this form.


How to deploy all AX2012 report

Deploy all AX2012 reportWe have 3 different ways to deploy Dynamics AX2012 reports:
Through AOT
AOT > SSRS Reports > Reports > right click on report > Deploy Element Through Visual Studio
Open the report project > Right click on the project or solution node > Deploy Through PowerShell
Publish-AXReport -ReportName *Through AOT
- Go to AOT > SSRS Reports > Reports > right click > Deploy Element

Through Visual Studio
- Open your AX/Report project
- Right click on the project or solution node
- Click "Deploy"

Through PowerShell
- Go to: Start > Administrative Tools > Microsoft Dynamics AX 2012 Management Shell
- Then enter Publish-AXReport -ReportName *

For Complete post follow below link...


Container and unbounded string (text) fields are not allowed in a WHERE expression in AX.

Container and unbounded string (text) fields are not allowed in a WHERE expression in AX.Error: Container and unbounded string (text) fields are not allowed in a WHERE expression in AX.

Reason: Axapta does not allow you to use an unbounded string in a where clause.


You must use a ‘bounded’ string. To do this you must declare your string with a numerical limiter e.g. str 50.


PurchTable getFirstByCustomerPOId(str 50 customerPOId)
PurchTable purchTable;
select firstonly purchTable
where purchTable.My_CustomerPurchaseOrderId == customerPOId;
return purchTable;


Post a Ledger Journal in AX using X++

Create a From through X++ Job

Here is small code for create a AX From through X++ Job code.

static void theaxapta_formJob(Args _args)
    Form                    form;
    FormRun                 formRun;
    Args                    args;
    FormBuildDesign         formBuildDesign;
    FormBuildControl        formBuildControl;
    FormBuildTabControl     formBuildTabControl;
    FormBuildTabPageControl formBuildTabPageControl;
    FormBuildGridControl    formBuildGridControl;
    FormBuildDatasource     formBuildDatasource;
    FormBuildStringControl  formString;
    form = new Form();
    formBuildDatasource     = form.addDataSource(tableStr(PurchTable)); // Main Data Source for FORM
    formBuildDesign         = form.addDesign('design');// Add design in FORM
    formBuildTabControl     = formBuildDesign.addControl(FormControlType::Tab, 'Tab');
    formBuildTabPageControl = formBuildTabControl.addControl(FormControlType::TabPage, 'TabP…

UTC DateTime Null Value in Ax

UTC DateTime Null Value in AxSome times we need to pass or check null value in UTCDateTime field.
so here is the logic to pass null value in UTCDateTime,

just try utcdatetimenull() function in your code, it will return the same value as 

DateTimeUtil::minValue() function.

In X++ The utcdatetimenull() value is '1900-01-01T00:00:00'.


Finding unused lables

Finding unused labels in AxaptaHere is a small job for finding labels, from a particular label file, that are not used in your whole application code. You need an updated cross reference to use the job. I assumed that you are familiar with label files.

static void findUnXedLabels(SysOperationProgress _progress = null) { Label label = new Label('da');// The languageto use for finding the labels str 250 labelId = label.searchFirst(''); Map mapLabels = new Map(types::String, types::String); MapEnumerator mapEnumerator; ; setPrefix("Finding UnX'ed labels"); while (labelId) { if (label.moduleId(labelId) == "XYZ") // The particular label file { if ((select xRefNames index hint Name where xRefNames.Kind == xRefKind::Label && xRefNames.Name == labelId && x…

Large collection of Free Microsoft eBooks for you, including: SharePoint, Visual Studio, Windows Phone, Windows 8, Office 365, Office 2010, SQL Server 2012, Azure, and more.

AX 2012 Developer Resources

AX 2012 Developer ResourcesIn this post i am sharing AX 2012 resources links, including development helps, Downloads, Articles  Blogs. All links are grouped by Topic

Eventing Basics (code walkthrough)
Managed Handlers for Pre/Post events (code walkthrough)
Managed Code Handlers for Delegates (limitations) (code walkthrough)
Microsoft Whitepaper: Eventing (download)
Eventing Terminology and Keywords (MSDN Article)
Naming Conventions for Delegates and Event Handlers (MSDN 

X++ Language
X++ as a Managed Language in the .NET Runtime (code walkthrough)
AX 2012 X++ Language Changes, Stricter Syntax (MSDN Article)
.NET Interop to X++ Issues when X++ runs as CIL (MSDN Blog)
Deploying AX 2012 Code
New Query Object Features (code walkthrough)
Creating Code Snippets and method templates (code walkthrough)

Data Access
Computed View Columns (code walkthrough)
Valid Time State/Date Effective Framework - Part 1: Creating the table (code walkthrough)
Valid Time State/Date Effective Framework - Part …

Get Current Company in AX

Get Current Company in AXBelow is the example on how to get current company in AX 2009.
In AOT > Jobs, paste the following code:

static void curExtExample(Args _arg)
    str curCompany;
    // Sets curCompany to the extension of the current company.
    curCompany= curExt();
    print "Current extension is " + curCompany;

You can use this code in your forms and reports also to parameterized your reports/Forms.


Get the latest exchange rates in Dynamics AX 2012 [Using X++]

Get the latest exchange rates in Dynamics AX 2012 Using X++Below small snippet will help you to get the latest exchange rates as on today.
I am using x-rates URL to pull the exchange rates for this example. 
Note: Please check and verify this web URL before using it [free source or not].

staticvoid SR_getExchangeRates(Args _args)
int curPos, endPos, startPos;
TextBuffer tb = new TextBuffer();
System.Net.WebRequest webRequest;
System.Net.WebResponse webResponse;
str page;
System.IO.StreamReader streamReader;
webRequest = System.Net.WebRequest::Create("");
// this will throw an webexception if cannot be reached.
webResponse = webRequest.GetResponse();
streamReader = newSystem.IO.StreamReader(webResponse.GetResponseStream());
page = streamReader.ReadToEnd();
curpos = 1;
startPos = 1;
tb.find(‘<a href="/d/INR/USD/graph120.html" class=&…