Friday, November 13, 2015

Form Method Call Sequence in AX 2012

è Methods call Sequence while opening the Form
Form --- init ()
Form --- Datasource --- init ()
Form --- run ()
Form --- Datasource --- execute Query ()

Form --- Datasource --- active ()

è  Methods call Sequence while creating the record in the Form
Form --- Datasource --- create ()
Form --- Datasource --- initValue ()
Table --- initValue ()
Form --- Datasource --- active ()

è  Methods call Sequence while modifying the fields in the Form
Table --- validateField ()
Table --- modifiedField ()
è Methods call Sequence while deleting the record in the Form
Form --- Datasource --- validatedelete ()
Table --- validatedelete ()
Table --- delete ()
Form --- Datasource --- active ()

è Methods call Sequence while saving the record in the Form
Form --- Datasource --- ValidateWrite ()
Table --- ValidateWrite ()
Form --- Datasource --- write ()
Table --- insert ()

è Methods call Sequence while closing the Form
Form --- canClose ()
Form --- close ()

Wednesday, October 28, 2015

Overview of Buttons Controls in AX 2012

Button Controls in ax 2012

1.     Button:  The button type does not have a predefined action. Use this button to execute custom X++ code. To create the button action, use the AOT to override the clicked method and enter the X++ code that you want to run. Has a clicked method that works like the clicked event in other languages. Use this for maximal flexibility when you want something to happen when the user clicks on a button. You decide on what you want to happen by overriding the click method.


2.     CommandButton:  Like a button except that you have built in commands that you often won’t customize. For example, one command is called “new”. It literally creates a new record against the data source table. Actions like those rarely need customization, so why not just have a quick and easy way to create them? With the commandButton, we change a quick setting and we are in business.

3.     DropDialogButton: Sometimes, users need a small form to popup when they click a button. You can think of this like the irritating popups on websites except that hopefully, you aren’t irritating your users. You link to the small form when you click this control which looks like a button.

4.     MenuButton:  A menu button is a control that displays a list of buttons. Use a menu button to make buttons available that are rarely used and do not have to be visible in the action pane. Careful not to get this mixed up with the “menu.” Menus are those page options that appear when people open up a client module like Accounts Payable Area Page. They are meant more for modular navigation than form navigation. Menu Buttons are groups of organized buttons that give us the ability to sort our buttons in groups. So we could use a menu button control to organize 4 different buttons (menu item) that each open a different form page.

5.     MenuItemButton: A menu item button opens a specified form in a new window. Use a menu item button when you want to open a detailed form to create or update a record. This is the most commonly used button. It’s main purpose is to provide links and respect built in security. So when a user clicks on it, we will often launch a form or a report. The button only works if the user has the permissions for it to work.


6.     Seperator: Usually, you will place a nice little vertical line between groups of related buttons on your action Pane to make things look nicer. Users will usually fiddle around with that vertical separator (which looks just like a vertical line) until they find the look that they like.

Tuesday, October 27, 2015

How to Create X++ Query in Ax 2012 R3

Hi Friends,

Simple Example of how create X++ Query

static void XPPQuery(Args _args)
{
    Query                   query;
    QueryRun                queryRun;
    QueryBuildDataSource    queryBuildDataSource;
    QueryBuildDataSource    queryBuildDataSource1;
    QueryBuildDataSource    queryBuildDataSource2;
    QueryBuildRange         queryBuildRange;
 
    CustomerTable           customerTable;
    CardTable               cardTable;
    TransactionTable        transactionTable;
 
 
    query = new query();
    queryBuildDataSource    = query.addDataSource(tableNum(customerTable)); //Add Query
    queryBuildDataSource.addSortField(fieldNum(customerTable,AccountNumber),SortOrder::Descending);
 
    queryBuildRange =    queryBuildDataSource.addRange(fieldNum(customerTable,AccountNumber));
    //queryBuildRange.value(queryValue('11')+('*'));
 
    queryBuildDataSource1   = queryBuildDataSource.addDataSource(tableNum(cardTable));
 
    queryBuildDataSource1.relations(true); // define Relations
    queryBuildDataSource1.joinMode(JoinMode::InnerJoin); //define Join Mode
 
    queryBuildDataSource2   =  queryBuildDataSource1.addDataSource(tableNum(transactionTable));
    queryBuildDataSource2.relations(true);
    queryBuildDataSource2.joinMode(JoinMode::ExistsJoin); // only shows trasancton customers no dublicate;
    queryBuildDataSource2.joinMode(JoinMode::NoExistsJoin);// no did transactions
    queryBuildDataSource2.joinMode(JoinMode::InnerJoin);// all trasaction details with multple times
    queryBuildDataSource2.joinMode(JoinMode::OuterJoin);
 
    queryRun    = new QueryRun(query);  //Passsing Query to Queryrun
 
    while(queryRun.next())
    {
        customerTable = queryRun.get(tableNum(CustomerTable));
        cardTable     = queryRun.get(tableNum(cardTable));
        transactionTable    =queryRun.get(tableNum(transactionTable));
     
        info(strFmt("%1,%2,%3,%4", customerTable.AccountNumber, customerTable.AddressCity,cardTable.Amount,transactionTable.TransID));//customerTable.Name));
 
 
    }
    
 
}

Keep Daxing....!

Thursday, October 22, 2015

How to open Form through X++ or JOB in Ax 2012

Hi friend,

Toady,  I am going to help you how to open Form through code or X++  in AX 2012.
It is very simple, I think most of the people knows any way i am sharing my thoughts.


It has two ways to open the form

1. Open the FORM Name
2. Open the FORM, with Form Display Name. 


1. Open the FORM with Form Name

static void FormOpen(Args _args)
{
   
    Args  args;
    FormRun formRun;
   
    args = new Args();
    args.name(formstr(FormA)); // mention Form Name
    formRun = new FormRun(args);
    formRun.run();
    formRun.wait();
   
}


2. Open the Form with Form Display Name

static void FormOpen(Args _args)
{
 
MenuFunction menuFunction;
menuFunction = new MenuFunction(MenuItemDisplayStr(FormA), MenuItemType::Display);
menuFunction.run();
   
   
}


Happy Daxing...

Thursday, May 7, 2015

Passing Records from one Form to another Form in dynamics Ax 2012

Hi every one today I am going to publish "Passing the record from one form to another from using Args In AX 2012R3".

Step1_ first create TableA with fields as Name, Number, City.
Step2_ Create a from as SampleFormA, using data source TableA, then in design take Grid and  BUTTON. In button clicked write this below code 
void clicked()
{   Args args;
    FormRun formRun;
    super();
    args = new args(formStr(SampleFormC));
    args.record(SampleTable2);
    formrun = classFactory.formRunClass(args);
    formRun.init();
    formRun.run();
    formRun.wait();
}

drag and drop the fields to From Grid.

Step3 _ Create Another TableB and SampleFormC , same as above except button and clicked method (No Button and clicked method)

Step4_ In SampleFormC , drag and field to grid , then override form init method, write below code

public void init()
{
    super();
    sampleTable2 = element.args().record();
    this.insertSampleTable3();
   // record filter
    sampleTable3_ds.query().dataSourceTable(Tablenum(sampleTable3)).addRange(fieldNum(sampleTable3,Name)).
    value(SysQuery::value(sampleTable2.Name));

    }
Step5_ Then write insert method in SampleFromC  below code
private void insertSampleTable3()
{
    sampleTable3Loc.Name           = sampleTable2.Name;
    sampleTable3Loc.Number         = SampleTable2.Number;
    sampleTable3Loc.AddressCity    = sampleTable2.AddressCity;

    sampleTable3Loc.insert();
}

Step6_ Declaration in SampleFromC
 public class FormRun extends ObjectRun
{
    sampleTable3    sampleTable3Loc;
    SampleTable2    sampleTable2;
    QueryBuildRange qbrName;
}

Note : This below code is shows only for same record
// record filter
 sampleTable3_ds.query().dataSourceTable(Tablenum(sampleTable3)).addRange(fieldNum(sampleTable3,Name)).
    value(SysQuery::value(sampleTable2.Name));


____ Thank you.



















Wednesday, April 22, 2015

Microsoft Azure

Azure is an open and flexible cloud platform that enables you to quickly build, deploy, and manage applications across a global network of data centers that are managed by Microsoft.

Azure enables cloud computing. Cloud computing is the delivery of computing capabilities as a service. Cloud computing makes it easy to access IT resources such as computers, networking, and storage. As with any utility, you generally only pay for what you use with cloud computing. By using cloud services, you can harness the power of massive datacenters without having to build, manage, or maintain costly, complex IT building blocks. With the cloud, much of the complexity of IT is abstracted away, letting you focus on the infrastructure, data, and application development that really matter to your business.

You can deploy AX 2012 R3 on Azure. When you do, you may realize the following benefits:
  • Reduce costs:
    • Since you don’t have to build out or manage infrastructure with Azure, IT costs may be greatly reduced
  • Save time
    • An on-premises AX 2012 R3 environment may take weeks to plan, acquire necessary hardware, and deploy. By using the Cloud-hosted environments tool in Lifecycle Services, you can deploy an AX 2012 R3 environment on Azure in hours.
  • Gain flexibility
    • The cloud enables you to easily scale up (or scale down) to meet the changing needs of your business.
Azure offers three types of services: Software-as-a-Service (SaaS), Platform-as-a-Service (PaaS), and Infrastructure-as-a-Service (IaaS).

1. Software-as-a-Service (SaaS) You use a web browser to use applications that are hosted in the cloud.

2. Platform-as-a-Service (PaaS) :You don’t manage or control the network servers or operating system. PaaS is more developer-oriented. It allows you to focus on the business logic of applications and quickly move applications from concept to launch.

3. Infrastructure-as-a-Service (IaaS)You have control over your virtual machines and the network configuration, but you don’t have to worry about hardware.