Thursday, January 26, 2012

How to Create New Role Center in AX 2009


Create new role center in Dynamics Ax 2009

Compiled from Dynamics Ax Developer help for quick reference.
  1. Open Dynamics Ax enterprise portal (default installation is http://servername/sites/DynamcisAx).
  2. Click on Site Action > Create . Choose Web part page (as most Ax role center using this). Complete the page creation.
  3. Open Ax client > AOT > Web > Web menu item > URLs > New URL.
  4. Specify URL Properties by clicking on the elipsis button. Browse Enterprise portal folder and choose the .aspx page created in the step 2.
    If got error go to here.
  5. Set home page property to YES. (If not the page will not be available to be chosen as user profile role center page).
  6. Right click > Import. This will import the page to AOT under web > web files > page definitions.
  7. Locate the new page definition on step 6. Set the page title properties.
  8. Go to Admin > Setup > User profile. Create a new record. Choose the role center column from drop down.
  9. Click view role center button to test.
Enjoy DAX!!!

Sunday, January 22, 2012

Purchase Order using X++

Hi,
In this post we will learn the below using X++ :

 1) How to Create Purchase Order
 2) How to Create Purchase Order Line
 3) How to Post Purchase Order



static void PurchaseOrder(Args _args)
{
PurchTable pt;
PurchLine pline;
NumberSeq ns;
PurchID pid;
PurchFormLetter pl;
;
//Create Purchase Order
ns=NumberSeq::newGetNumFromCode(SalesParameters::numRefSalesId().NumberSequence);
pt.initValue();
pid=ns.num();
pt.PurchId=pid;
pt.OrderAccount="4202";
pt.initFromVendTable();
pt.insert();


//Create Purchase Line
pline.clear();
pline.PurchId=pid;
pline.ItemId="1109";
pline.createLine(NoYes::Yes,NoYes::Yes,NoYes::Yes,NoYes::Yes,NoYes::Yes,NoYes::Yes);
info("Purchase Order Created Sucessfully");


//Post the PO
pl=PurchFormLetter::construct(DocumentStatus::Invoice);
pl.update(PurchTable::find(sid),sid,SystemDateGet(),PurchUpdate::All,AccountOrder::None,false,true);
info("Posted Sucessfully");
}


Enjoy DAX!!!

Sales Order using X++

Hi,
In this post we will learn the below using X++ :

 1) How to Create Sales Order
 2) How to Create Sales Order Line
 3) How to Post Sales Order


Code :
public static void SalesOrderDemo(Args _s)
{
// Create the Sales Order

SalesTable salesTable;
NumberSeq NumberSeq;
SalesId sid;
SalesLine sl;
SalesFormLetter fl;
;
NumberSeq =NumberSeq::newGetNumFromCode(SalesParameters::numRefSalesId().numberSequence);
sid=NumberSeq.num();
salesTable.SalesId = sid;
salesTable.initValue();
salesTable.CustAccount = "1101";
salesTable.initFromCustTable();
salesTable.insert();

//Create the Sales Line with the created Sales Order
sl.SalesId=sid;
sl.ItemId="1109";
sl.CreateLine(NoYes::Yes,NoYes::Yes,NoYes::Yes,NoYes::Yes,NoYes::Yes,NoYes::Yes);

info("Sales Order Created with Line");

//How to Post the Sales Order Invoice


fl=SalesFormLetter::construct(DocumentStatus::Invoice);
fl.update(SalesTable::find(sid));
info("Sales Order Posted");

}


Enjoy DAX!!!

Friday, January 20, 2012

Common Prefixes in AX 2009

Hi DAXers,

Please see the common prefixes used in AX 2009 :


Prefix Description
Ax Dynamics AX Typed Data Source
Axd Dynamics AX business Document
BOM Bill of Material
COS Cost Accounting
Cust Customer
HRM Human Resources management
Invent Inventory Management
JMG Shop floor management
KM Knowledge Management
Ledger General Ledger
PBA Product Builder
Prod Production
Proj Project
Purch Purchase
Req Requirements
Sales Sales
SMA Service Management
SMM Sales and Marketting Management
Sys Application Framework and development tools
Tax Tax Engine
Vend Vendor
Web Web Framework
WMS Warehouse Management



Tip When creating new elements, make sure to follow the recommended naming conventions.
Any future development and maintenance will be much easier.

Monday, January 16, 2012

Importing Leads into AX 2009

Hi,
   Today we have a discussion of the Procedure to Import Leads into AX 2009 from a XML File :


1.    Basic >Setup > Import > Documents
  • In Documents form:  Name, CRMContacts; Description, CRM Contacts Document Class; Document Class, AxdSysImportLeads.
  • Click “Validate”, close Documents Form

2.    Basic > Setup > Import > Transformations
  • In Transformations form: Name, XmlToContacts; Document Class, CRMContacts;
  • Click “Load”
  • Select file “SysImport.Leads.xsl" from "C:\Program Files\Microsoft Dynamics AX\50\Application\Share\Include" folder.
  • Click “Validate”
  • General Tab, verify that type of transformation is “XSLT”

3.    Basic > Setup >Import > Formats
  • In Formats form:  Name, XmlFormat; Description, Process Xml Files; Extensions, *.xml; Document Class, CRMContacts; Active (checked)
  • Save, then click “Transformations”
  • On the Format transformations form:  Transformation:  XmlToContacts, close the form
  • On the Formats form, click “Validate”
  • The Import form will appear; select the file “Leads.xml”; click OK

Now you can start and complete the import process.  CRM >Periodic > Import > Leads


Note :
       Format of Leads.xml must be as displayed below :

<Leads xmlns="http://schemas.microsoft.com/dynamics/2006/02/documents/SysImportLeads">
  <Lead>
    <LeadID>9999</LeadID>
    <Memo>Fair customer</Memo>
    <Subject>Intersted in our products</Subject>
    <Name>Kuldeep Singh</Name>
    <Address>
      <Name>Work</Name>
      <City>New York</City>
      <CountryRegionId>US</CountryRegionId>
      <County>LOUDOUN</County>
      <Email>help4mcts@gmail.com</Email>
      <Phone>(123) 456-7</Phone>
      <PhoneLocal>09811480042</PhoneLocal>
      <State>VA</State>
      <Street>NE 1st Street</Street>
      <URL>http://blogs.gtechlearn.com</URL>
      <ZipCode>00346</ZipCode>
    </Address>
    <Address>
      <Name>Home</Name>
      <City>Somewhere else</City>
      <CountryRegionId>US</CountryRegionId>
      <County>LOUDOUN</County>
      <Email>Kuldeepsingh_godara@yahoo.co.in</Email>
      <Phone>(123) 765-4</Phone>
      <PhoneLocal>0</PhoneLocal>
      <State>VA</State>
      <Street>666 N 2nd Street</Street>
      <URL>http://dynamicspost.blogspot.com</URL>
      <ZipCode>00346</ZipCode>
    </Address>
    <ContactInfo>
      <CommunicationTypeId>Email</CommunicationTypeId>
      <Email>help4mcts@gmail.com</Email>
    </ContactInfo>
    <ContactInfo>
      <CommunicationTypeId>PrimaryPhone</CommunicationTypeId>
      <Phone>(123) 456-1</Phone>
    </ContactInfo>
  </Lead>
 </Leads>

Enjoy DAX!!! 

Thursday, December 29, 2011

Global Number Sequences in AX 2012 (Going Global)


Number sequences in Dynamics AX probably only get technical types and a few bean counters excited.  But one man’s trash is another’s art.  In AX number sequences as in most ERP systems provide unique identifiers to transactions (SO, PO, JE, etc.) or master data (e.g. customers, items, vendors, etc.) In AX these user friendly identifiers can be maintained in continuous or non-continuous alphanumeric sequences.
With previous releases (AX 2009 and earlier) number sequences were system generated sequential strings with hard coded system or user (administrator) specified prefixes or suffixes. Size of the number sequence (number of digits) and smallest, largest, and next numbers can be specified as well as a unique code and name. AX 2009 also supports number sequence groups and additional advanced functionality.  In AX 2009 and earlier versions, the number sequences were specific to a company, and if the organization  maintained and supported multiple companies within the AX environment unique number sequences had to be maintained for each company.
With the introduction of the Organizational Model concept in AX 2012, number sequences functionality has been enhanced to allow sharing of number sequences across organizations and organization types. Without veering into a separate discussion of Organizational Models in AX, from a number sequence perspective the change allows association of a sequences to   not only multiples companies (or the comparable “legal entity” in AX2012), but  also multiple organizations such as operational units and legal entities or literally “shared”, with options within that matrix. This allows an association of a master data number sequence such as a product to be shared globally.
Two new concepts have been introduced in AX 2012 to the number sequence framework. These are scope and segment. A segment is a data entity such as a legal entity, operational unit, or perhaps a fiscal calendar. A number sequence can have more than one segment.   As scope is a valid combination of segments used for a specific transaction or master data entity.
AX 2012 ships with the following valid segment combinations (scope)-
  • Shared
  • Company (DataArea)
  • Company (DataArea) and fiscal calendar period
  • Legal entity
  • Operating unit
  • Legal entity and fiscal calendar period

Although scope is predefined for a data entity, the segments within that scope are configurable.
Shared scope uses a generated number across an instance of Microsoft Dynamics AX 2012, and has no segments.
Company or (DataArea) is essentially the same functionality as previous releases.
Combinations are apparently at face value, although there are limitations.
As one can see with AX2012 the number sequence framework is significantly enhanced. Users and partners are still learning the explosion of technical and functional improvements that the MS Dev team has created. Number sequences have greater power and complexity than presented in this brief entry. For a more in depth look please read the White Paper by Microsoft’s Madan Natu, Senior Program Manager-Using the Enhanced Number Sequence Framework in Microsoft Dynamics AX 2012, which was released earlier this week. Many of us have much to learn.