Wednesday 19 September 2012

Comparison between IF and SWITCH statement in Axapta

X++ code for IF and SWITCH


IF Statement

static void Job1(Args _args)
{
    int itemid = 1001;

    if (itemid == 3005)
    {
        print "Product 3005";
    }
    else if (itemid == 5001)
    {
        print "Product 5001";
    }
    else if ((itemid == 1001) || (itemid == 1002) || (itemid == 1003)
    {
        print "Product in range of 1001-1003";
    }
    else
    {
        print "Product nothing";
    }
    pause;
}
SWITCH Satement
Required break otherwise depends on the value it may select appropriate case, so break exit the pointer out of the switch case statment, you can see switch statement work batter in some of the situation than if statement

static void Job2(Args _args)
{
    int itemid = 1001;
    switch (itemid)
    {
        case 3005:
            print "Product 3005";
            break;
        case 5001:
            print "Product 5001";
            break;
        case 1001, 1002, 1003:                                  // it work like 1001 OR 1002 OR 1003
            print "Product in range of 1001 - 1003";
            break;
        default:
            print "Product nothing";
            break;
    }
    pause;
}

Product Master in Microsoft Dynamics Axapta 2012

What's new ?
  1. Product creation process is centralised
  2. Reduced managing master data with use of shared product data
  3. New introduction of Process Oriented Product Defination Task Framework
Step by Step
  1. Create a product Master in Axapta 2012 
  2. Create Product Variants
  3. Release Product Variants to legal entities
  4. Finalise Release product
  5. Create Released product -Streamlined



Select all product and product Master


Click on Product


Create a new product, type Product Number, Name, Search name

Select Product subtype as "Product Master"whichwill show more fields


Fill in the product details and select OK

Now will get the entered details in grid

To create Product Variance click on Product Dimention, create new Size dimention

Create new dimention under colour
Create Product Variants


Now can see below complete details for "Prod1"

Now Product to be released to the selected companies, select release product

Select "Select Companies"

Now finally you can see below on right hand side the name of the company DAT. with left hand side Prod1.


now select Release Product


Apply Template this this Product


Select prod1 product and click on validate




 Thank you.


Friday 7 September 2012

Array in Axapta


Array hold same type of variable
arrya can be access thru integer indexes, Index begins with 1
Declaration of Array variable can be Table or Object
One dimention of array can be declare


Three type of Array

1.  Dynamic
     It is declared without integer index value, just put square bracket [ ],
     If you are not sure of row and column size of index use this
     int    myarrya[];

2.  Fixed - Length
      it can hold 30 items
      int    myarray[30];


3.  Partly on Disk
      dynamic integer arrya hold 30 elements in memory
      int   myarray[,30];
    
      string arrya hold 10elements and 30 in memory
      str   myarrya[10,30];
     
to reset all element in myarray do
myarray[0];
 

ADO connection string in Axapta

To do the Integration Job in Microsoft Dynamics Axapta use following Connection string


Create a JOB in Axapta and do the follwing

CCADOCommand         command;

CCADOCRecordSet       recordseta;

CCADOFields                Fields1;

Com                                Coms;

Str                                   Sql;

Str                                   Provider = "192.x.x.x";   // enter here your public ip address of the database server

Str                                   DataBase = "mydatabasename"; //enter here your sql database name

Str                                   UserID = "Myname";  // enter here sql user name like SA etc..

Str                                   PWD = "mypw"; //enter here your sql password

Str                                   ConnectionString = strfmt("Provider=SqlOledb;server="+ Provider + ";trusted_Connection=false;" + "Initial catalog=" + DataBase + ";User id=" + userid + ";password='" + PWD + "';");

sql = "select * from emp";

Connection = new CCADOConnection();

Connection.open(CCADOConnection);

command = new CCADOConnection();

command.commandText(sql);

recordseta = new CCADOConnection();

recordseta = command.execute();

Coms = recordseta.recordset;

if (!recordseta.EOF())

{

//here you can do your further work

}

Truncate decimal value in Axapta

How to Truncate Decimal Value

Licensing in Microsoft Dynamics Axapta


Licensing in Microsoft Dynamics Axapta

License codes and configuration keys are the basic security architecture in Axapta,


License codes controls the modules, Functionality will work depends on the purchase of License Code for Module,

Configuration Key Controls the Functionality and Features in system

Depends on the purchase of license configuration key available

Each configuration key controls the specific features.

What is Client in Axapta 2012


What is Clients?

Microsoft Dynamics Rich Client, it is the primary client design using MorphX Development Environment

EP, Enterprise Portal pages available through web browser

MS Office, It can be used to access Axapta Data

Other Application, like mobile application, .net written application, application cab be integrated utilizing methods like web services or .net business connector

.Net business Connector, it is basically for other application to access Axapta logic, Other application interface that interact with AOS through the .net business connector

Developer tools - In Axapta Support of MorphX IDE or through Visual Studio Tools in visual studio