Tuesday, September 2, 2014

Print PDF file from AX

Print PDF file from AX 

This job illustrates how we can print an external PDF file to a printer chosen in AX through X++ code. Here a code sample (X++ job) to do this.


static void theAxapta_pdfprint(Args _args)
{ 
    PrintJobSettings    printJobSettings = new PrintJobSettings(); 
    Dialog              dialog = new Dialog(); 
    DialogField         dialogFileName; 
    str                 adobeExe; 
    str                 adobeParm; 
;
    dialogFilename  = dialog.addField(typeid(FilenameOpen));

    if (dialog.run()) 
    {     
        printJobSettings.printerSettings('SysPrintForm');     
        adobeExe = WinAPI::findExecutable(dialogFileName.value());
       
        adobeParm = strFmt(' /t "%1" "%2" "%3" "%4"',
                           dialogFileName.value(),
                           printJobSettings.printerPrinterName(),
                           printJobSettings.printerDriverName(),
                           printJobSettings.printerPortName());

        winAPI::shellExecute(adobeExe,  adobeParm); 
    }
}

Wednesday, August 20, 2014

How to create new Number Sequence in Ax 2009

Steps to Create Number Sequence in Ax 2009

Step - 1
Create an EDT just like i have created 'ReasonCode'

Step 2
Go to the Module Table : SalesParameters
Create a method:
public client server static NumberSequenceReference numRefReasonCode()
{;
    return NumberSeqReference::findReference(typeId2ExtendedTypeId(typeid(ReasonCode)));

}

Step 3
Go to the module Class : NumberSeqReference_Customer
Select the LoadModule Method:
//Start
    numRef.DataTypeId                 = typeId2ExtendedTypeId(typeid(ReasonCode));
    numRef.ReferenceHelp            = literalstr("Reason Code");
    numRef.WizardContinuous         = False;
    numRef.WizardManual             = NoYes::No;
    numRef.WizardAllowChangeDown    = NoYes::No;
    numRef.WizardAllowChangeUp      = NoYes::No;
    numRef.WizardHighest            = 999999;
    numRef.SortField                = 418;
    this.create(numRef);  
//End

Step 4
Go to the Table :  Override initvalue method just like below
public void initValue()
{
    NumberSeq       NumSeq;
    ;
    super();
    NumSeq =  NumberSeq::newGetNum(SalesParameters::numRefReasonCode(),true);
    this.ReasonCode = NumSeq.num();
}

Step 5
Go to Module Parameter Form and select Number Sequence Tab, There is a line Created for Reason Code which is selected in Given Image


Step 6
Now Go To maint Table form of Number Sequence and Create a line for number sequence and select it for Reason Code as gshown in below image

Step 7
Now Your number sequence setting is up to date and you can create record in form as shown in below image

Thats All!!



Thanks






Wednesday, July 9, 2014

Deletion of Invoiced Orders and Order Lines in AX ...

Armanino Dynamics Blog: Deletion of Invoiced Orders and Order Lines in AX ...: In AX, it is possible to delete an invoiced Purchase Order or Sales Order. You can also just delete an invoiced order line. Further, you can...

Thursday, June 26, 2014

Open Axapta form in Maximize mode

If we want to open any Ax form in Maximize mode than we have to create a Run method of form as Below

public void run()
{
    #WinApi
    ;
    super();
    WinApi::showWindow(this.hWnd(), #SW_SHOWMAXIMIZED);
}


Thanks

Sunday, August 4, 2013

Microsoft Dynamics AX 2009 - Sytem architecture


Microsoft Dynamics AX 2009 - Sytem architecture
Understanding the internal architecture of Microsoft Dynamics AX can help you make decisions when planning, customizing, and deploying a system. This topic provides a high-level overview of the system architecture of Microsoft Dynamics AX. 

The diagram below provides a high-level overview of Microsoft Dynamics AX system architecture. This diagram does not depict the system topology or physical infrastructure required for the deployment. 

Your infrastructure can consist of many Microsoft Dynamics AX components on a single physical server or on multiple physical servers. For considerations in planning your deployment infrastructure, see Planning system topology

For details on Microsoft Dynamics AX components, see Component architecture. For up-to-date hardware and software requirements for Microsoft Dynamics AX, see the system requirements Web page


Dd362112.System_architecture(en-US,AX.50).gif



All users accessing Microsoft Dynamics AX require Windows authentication and mapping of their Windows IDs to the Microsoft Dynamics AX system. Authenticated Windows users are not required to log in separately to the Microsoft Dynamics AX application. 

Access to data, business functionality, and presentation elements (forms, menus, fields and reports) is governed by Microsoft Dynamics AX security. Anonymous Web users can access Enterprise Portal with limited functionality.
A client provides an interface to Microsoft Dynamics AX data and functionality. An external application integrates programmatically with Microsoft Dynamics AX to consume functionality or exchange data. 
  • The Microsoft Dynamics AX Windows client is a native 32-bit Windows program that provides a rich user interface.
  • Supported Web browsers give access to Microsoft Dynamics AX functionality and data through Enterprise Portal.
  • External applications interact with Microsoft Dynamics AX via the Application Integration Framework (AIF). The AIF is an extensible framework that enables XML-based enterprise application integration (EAI), business-to-business (B2B), and service-oriented architecture (SOA) scenarios.
It is possible for an external application or a custom client to interact with Microsoft Dynamics AX using the .NET Business Connector, another integration component. However, using the AIF is the recommended approach for integration with the Microsoft Dynamics AX application.
If you use AIF Web services or you consume external Web services, we recommend that you deploy Windows SDK for Windows Server 2008 and .NET Framework 3.5. The SDK includes additional configuration tools that simplify advanced configuration and reduce the risk of manual configuration errors. To download the SDK, visit the Microsoft Download Center.
The application tier consists of one or more of the following Microsoft Dynamics AX components or computer roles. 

Windows Active Directory Domain Controller

Microsoft Dynamics AX requires Windows authentication and uses Windows integrated security. 
An Active Directory domain controller is a prerequisite for installing Microsoft Dynamics AX.

Application Object Server

The Application Object Server (AOS) controls communication among Microsoft Dynamics AX clients, databases, and applications. You can deploy the AOS on a single computer or create a load-balanced cluster of multiple AOS servers. 

The AOS is a Windows service and requires a Windows Server operating system. For up-to-date hardware and software requirements for Microsoft Dynamics AX, see the system requirements Web page.

Enterprise Portal

Enterprise Portal and its applications allow you to interact with Microsoft Dynamics AX from a Web browser. Enterprise Portal enables internal users (employees) and external users (vendors, customers, business partners) to access data and functionality through a highly customizable, role-based Web portal. 

You can also create Internet-facing public sites with restricted functionality for anonymous users. Enterprise Portal requires ASP.NET, Microsoft Windows SharePoint Services or Microsoft Office SharePoint Server, and Internet Information Services (IIS).

Reporting Services

Microsoft SQL Server Reporting Services is a solution that enables users to create and view both traditional, paper-based reports and interactive, Web-based reports. 

To integrate Microsoft Dynamics AX and Reporting Services, you must install the reporting extensions on a server running Reporting Services. 
After you install the reporting extensions, you will be able to deploy Microsoft Dynamics AX reports to Reporting Services.

Analysis Services

Microsoft SQL Server Analysis Services is a server-based solution that provides online analytical processing (OLAP) functionality. OLAP reports help users analyze business data and identify trends that they might not otherwise discover when viewing traditional reports. 
To integrate Microsoft Dynamics AX and Analysis Services, you must install the analysis extensions on a server running Analysis Services. 
When you install the analysis extensions, a default OLAP database and cubes are deployed to Analysis Services.

Workflow

Microsoft Dynamics AX 2009 supports workflow processes, such as the approval of purchase requisitions. The workflow infrastructure consists of AOS and IIS workflow runtimes. The Microsoft Dynamics AX workflow component is automatically installed on the AOS and the Microsoft Dynamics AX Windows client computers during installation. Workflow requires Internet Information Services (IIS) and the Windows Workflow Foundation, which is part of .NET Framework 3.5.

Application Integration Framework (AIF)

The Application Integration Framework provides a programming model, tools and infrastructure support for XML-based integration of application functionality and data with Microsoft Dynamics AX 2009. AIF enables Microsoft Dynamics AX to expose its functionality via WCF-based services and documents. AIF also enables Microsoft Dynamics AX to consume functionality exposed by external applications as Web services. 
You will need to deploy additional software depending on the transport adapter you are using: 
  • AIF Web services requires IIS.
  • The file system adapter relies on the Windows file system (a folder or a network share).
  • BizTalk Server requires the BizTalk adapter for Microsoft Dynamics AX to be installed on the BizTalk server host.
  • The MSMQ adapter requires Microsoft Message Queuing (MSMQ).
The following common roles are also found in infrastructures that are running Microsoft Dynamics AX. 

Microsoft Office Project Server 2007 integration

The Microsoft Dynamics AX synchronization service synchronizes project data in Microsoft Dynamics AX with data in Microsoft Office Project Server 2007. To use this functionality, you must install both the synchronization service and the Microsoft Dynamics AX synchronization proxy. For more information about Project Server 2007 integration, see Synchronization service and synchronization proxy architecture.

Messaging server

A messaging server enables the sending and receiving of e-mail messages and instant messages, and can be used to send alerts to users. Microsoft Dynamics AX requires a messaging server that supports SMTP.

Firewall

A firewall is part of a security system that helps protect a local network from external threats.
The data tier consists of one or more of the following Microsoft Dynamics AX components or computer roles. 

Relational database

A Microsoft Dynamics AX database stores your Microsoft Dynamics AX data on Microsoft SQL Server or Oracle Database Server installation. Windows SharePoint Services requires a SQL Server database, as does SQL Reporting Services. Support for OLAP cubes requires a SQL Server Analysis Services database. 
Microsoft SQL Server is required for Analysis Services and Reporting Services regardless of the database server that is used for the Microsoft Dynamics AX transactional database.

Application File Server

An application file server manages the files containing Microsoft Dynamics AX application objects and business logic. An AOS instance accesses this folder or file share to load the required application objects for execution. We recommend a Windows Server operating system, instead of the client operation systems such as Windows Vista or Windows 7, for the application file server. For up-to-date hardware and software requirements for Microsoft Dynamics AX, see thesystem requirements Web page.

Friday, July 26, 2013

Basics of Fetch Method in Ax Report

It is my first Blog...expecting it will help freshers..

// #. A Fetch Method Override for A Date Range Data Retrial from Cust Trans Table as on ...
public boolean fetch()
{
    // 0. Declare Variables
    QueryRun qr;
    QueryBuildDatasource QueryBuildDatasource1;
    QueryBuildRange rangeTransDate;
    Boolean ret;
    CustTable custTable;
    CustTrans custTrans;

    // 1. A QueryRun object called qr is initialized with the active query of the report,
    qr = new QueryRun(element);

    // 2. Get DAtaSource from current element query
    QueryBuildDatasource1 = element.query().dataSourceTable(tablenum(CustTrans));

    // 3. A range for the customer transaction date field is added to Datasource
    rangeTransDate = QueryBuildDatasource1.addRange(fieldnum(CustTrans, transDate));

    // 4. Actusl Date Range Value is added to qr
    rangeTransDate.value(queryRange(systemdateGet() - daysBack, systemDateGet()));

    // 5. The range is locked, so the user cannot change it.
    rangeTransDate.status(RangeStatus::LOCKED);

    // 6. The transaction date range is added to the caption of the report.
    element.design().caption(strfmt("%1, %2", element.design().caption(), rangeTransDate.value()));

    // 7. At this point, the query is looped. The standard loop of the query and the printout of the
    // record is what the super() call in fetch() handles. Before the query is looped, there is a
    // check to see whether the dialogs for the query and the report are called.These are the two dialogs which are wrapped by RunBaseReportStd
    if (qr.prompt() && element.prompt())
    {
        // 8. query is looped
        while (qr.next())
        {
            // 9. Within each loop, the tables CustTable and CustTrans are initialized.
            // If no records are found, the loop breaks and the report ends.
            // If a data source has changed, a new record is found
            // and the record is printed using the send() method.
            custTable = qr.get(tableNum(CustTable));
            custTrans = qr.get(tableNum(CustTrans));

            if (!custTable)
            {
                ret = false;
                break;
            }
            // 10. Note the second parameter in the send() method.
            // The second parameter defines the level of the record. CustTable is on the first level of the query and
            // CustTrans is on the second level. This is important since, if it is not set correctly,
            // auto sums will not be printed.
            if (qr.changed(tableNum(custTable)))
            {
                 element.send(custTable, 1);
            }
            if (qr.changed(tableNum(custTrans)))
            {
                 element.send(custTrans, 2);
            }
        }
    ret = true;
    }
    else
        ret = false;
    return ret;
}
// 11.     ------Tactics of reports---
// In the fetch example, the query of the report was looped. The case could also be looping
// a WHILE statement, SELECT statement, or a combination of both. For each record
// looped in the query, you might want to select a record from a table which is not part of
// the query, or even build a temporary table to be printed. For each record to be printed,
// all you have to do is call the send() method
Thanks

Customer transaction automatic settlement for specific customer groups only

Hi Friends, Recently I come to the requirement of my company where I have to automatic settle the customer transaction for the speci...