Friday 28 November 2014

Args Class in Microsoft Dynamics Ax

                                        Args class

The Args system class is one of the most widely used classes in Axapta. Args is an abbreviation for arguments and an Args object is used to pass information from one object (caller) to another newly created object.


Using Args for object creation

//This Example explain about opening a Form through Args.

 Args    args = new Args("CustTable");
 FormRun formRun = ClassFactory.formRunClass(args);
 ; 
 formRun.init();
 formRun.run();
 formRun.wait();    or  formRun.detach();

Caller:

public Object caller( [Object _value] )

this method gets or sets the calling object. When creating an args object directly through code, the caller will not be automatically set, so you should set it yourself.

Record:

public Common record( [Common _value] )

this method gets or sets a table buffer (record) attached to the Args. A buffer of any table can be attached to an Args object using this method. Be aware when retrieving the buffer that there will be no compile-time check of table id. You should use the dataset method below to check the contents of the buffer.

If the caller and callee are on different tiers, then the applications will automatically copy the buffer to the target tier.

Dataset:

public tableId dataset()

this method gets the table Id of a table buffer (record) attached to the Args.
To safely retrieve an attached record from an Args object, use code similar to that shown below. This checks to ensure that there is an attached record, and that it is in fact a SalesTable record, before trying to assign it to the salesTable variable.

if (args.record() && args.dataset() == tableNum(SalesTable))
  salesTable = args.record();

parm:

public str parm( [str _value] )
parm is used to pass a string variable to the called object

parmEnum:

public anytype parmEnum( [int _value] )

parmEnumType:

public int parmEnumType( [int _value] )

parmEnum and parmEnumType are used together to pass a Base Enum value through to the called object. An example is shown below.

args.parmEnumType(EnumNum(AddressType));
args.parmEnum(AddressType::Delivery);

parmObject:

public Object parmObject( [Object _value] )
parmObject is used to pass a reference to any object to the called object. Be aware of client-server issues if the caller and callee are on different tiers.

menuItemName:

public final str menuItemName( [str _value] )

menuItemType:

public final MenuItemType menuItemType( [MenuItemType _value] )

A short tutorial on how to open a form in Dynamics Ax (Axapta) by code.

Just take a line of code:

new MenuFunction(MenuItemDisplayStr(CustTable),MenuItemType::Display).run();
The above code will open the CustTable form. That's all it takes.

Now if you want to supply some arguments to the opening form, this is also possible with the optional args parameter.

static void FormOpen()
{
Args args = new Args();
;
args.record(CustTable::find('1002'));
new MenuFunction(MenuItemDisplayStr(CustTable),MenuItemType::Display).run(Args);
}

This code will open the CustTable form and filter out the customer with accountnumber 1002.


Thursday 20 November 2014

Link Type and Join Types in ax 2012

Link Type and Join Types in ax 2012


Link Type:-

1.      Active: - Parent and child- data source is updated immediately when a new record in the parent data source is selected. Continuous updates consume lots of resources consuming.

2. Delayed: - Parent and child - A pause is inserted before linked child data sources are updated. This     enables faster navigation in the parent data source because the records from child data sources are not updated immediately. For example, you can scroll a list of orders where you do not want to review the lines associated with the order until you stop scrolling.

3. Passive: - Parent and child - Linked child data sources are not updated automatically. Updates of the child data source must be programmed on the active method of the master data source.

Join Types:-

1. InnerJoin: - Combined data source – select the record from the main table that matches records in the joined table and vice versa.
There is one record for each match. Records without related records in the other data source are eliminated from the result.

2. Outer Join: - Combined data source – select the records from the main table. The records are retrieved whether they have matching records in the joined table

3. Exist Join: - Combined data source -The data source retrieves a record from the main table for each matching record in the joined table.
The differences between InnerJoin and ExistJoin are as follows:
·         When the join type is ExistJoin, the search ends after the first match has been found.
·         When the join type is InnerJoin, all matching records are searched for.

4. NotExistJoin: - Combined data source -Select records from the main table that do not have a match in the joined table.

Tuesday 18 November 2014

PurchaseOrder Creation Process in Microsoft Dynamics Ax 2012

PurchaseOrder Creation Process:

They are 4 Major Process Steps involved in the Creation Of Purchase Order:
1. Confirmation/PurchOrder.
2. Receipt List
3. Packing Slip/Product Receipt
4. Invoice.

1. Confirmation Class's , Tables and Reports That are related to Confirmation process are following:
               Tables  : VendPurchOrderJour , VendPurchOrderTrans.
               Class's : PurchFormLetter_PurchOrder.

2. ReceiptList  Class's , Tables and Reports That are related to ReceiptList process are following:
            Tables  : VendReceiptListJour , VendReceiptListTrans.
            Class's : PurchFormLetter_ReceiptList.

3. PackingSlip/Product Receipt Class's , Tables and Reports That are related to PackingSlip process are following:
            Tables  : VendPackingSlipJour , VendPackingSlipTrans.
            Class's : PurchFormLetter_PackingSlip.

4. Invoive Class's , Tables and Reports That are related to Invoice process are following:
     Tables  : VendInvoiceJour , VendInvoiceTrans.
     Class's : PurchFormLetter_Invoice.


FORMS : PurchTable,PurchEditLines

Saturday 15 November 2014

SlaesOrder Creation Process:

SlaesOrder Creation Process:

They are 4 Major Process Steps involved in the Creation Of Sales Order:
      1. Confirmation.
      2. Picking List
      3. Packing Slip
      4. Invoice.


1. Confirmation Class's ,Tables and Reports  That are related to Confirmation process are following:
                Tables  : CustConfirmJour , CustConfirmTrans.
                Class's : SalesFormLetter_Confirm.
                Report : SalesConfirm.

2. PickingList Class's ,Tables and Reports That are related to PickingList process are following:
                Tables  : WMSPickingRout , WMSOrderTrans.
                Class's : SalesFormLetter_PickingList.
                Report : SalesPickingList.

3. PackingSlip Class's ,Tables and Reports That are related to PackingSlip process are following:
                 Tables  : CustPackingSlipJour , CustPackingSlipTrans.
                 Class's : SalesFormLetter_PackingSlip.
                 Report : SalesPackingSlip.

4. Invoice Class's, Tables and Reports That are related to Invoice process are following:
                  Tables  : CustInvoiceJour , CustInvoiceTrans.
                  Class's : SalesFormLetter_Invoice.
                  Report : SalesInvoice.

Saturday 8 November 2014

What Is The Difference Between OCC and PCC ?

Optimistic Concurrency Control (vs) Pessimistic Concurrency Control


Pessimistic Concurrency Control :
                                                    On updating the data, the record gets locked and no one else can access that record for updating. It becomes a read-only record till the lock is released. Once the lock gets released, the record can be locked again and get updated for a different user.

Optimistic Concurrency Control :
                                                    This allows multiple user to open up the same record for updation . Record gets locked only while updating the record. This is the most preferred way of locking for the web application.