Thursday, 12 December 2013

Joins and Link Types

JOINS
Car Table
CarId
ModelYear
CarBrand
Model
Mileage
ModelYear
CarId
CA101
2008
Mahindra
Scorpio
15
2008
CA101
CA102
2009
Suzuki
800
12
2009
CA102
CA103
2007
Hundai
i20
5
2007
CA103
CA104
2007
Toyato
Inova
3
2007
CA104
CA105
2009
BMW
 
5
2009
CA105
CA106
2010
Benz
AZ12
10
2010
CA106
 Rental Table

RentalId
CustAccount
CarId
FromDate
ToDate
ToDate
FromDate
RE101
1104
CA101
10/12/2010
10/29/2010
10/29/2010
10/12/2010
RE102
1102
CA102
11/17/2010
12/14/2010
12/14/2010
11/17/2010
RE103
1203
CA103
11/24/2010
12/15/2010
12/15/2010
11/24/2010
RE104
1301
CA104
12/10/2010
1/5/2011
1/5/2011
12/10/2010
RE105
1304
CA101
1/3/2011
1/18/2011
1/18/2011
1/3/2011
RE108
1303
 
 
 
 
 
RE107
1202
 
 
 
 
 
RE106
2024
CA103
1/10/2011
1/29/2011
1/29/2011
1/10/2011


1. Inner Join : Records from main table that have matching record from join table .
while select carTable join rentalTable 
        order by carTable.CarId  
        where carTable.CarId == rentalTable.CarId  ;
Output                                                                                

2. Outer Join
Select all records from main table and related records from join table 
while select carTable outer  join rentalTable    
        order by carTable.CarId        
        where carTable.CarId == rentalTable.CarId 

3. Exists Join : Select record from main table only if there is matching record in join table . 
while select carTable Exists  join rentalTable       
        order by carTable.CarId    
        where carTable.CarId == rentalTable.CarId 
4. Not Exists : Selecting record from main table only if there is not matching record in join table.          



           Link Types :
Delayed : 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.

Active : The child data source is updated immediately when a new record in the parent data source is selected. Continuous updates consume lots of resources.
Passive: 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
     

AX TIPS

INDEX : 
1.  Increase performance using CacheAddmethod 
2. 

1. Increase the performance of form when we are using more than two display methods in form level, we can use cacheAddmethod to increase the form performance.

The performance of display methods can be improved by caching them if they are calculated on Application Object Server (AOS). Caching display methods can also improve performance when records are transferred from the server to the client.
The display method's value is set when data is fetched from the back-end database, and the value is refreshed when the reread method is called on the form data source.
Note:    
           edit methods cannot be cached. 


Locate the form that the method is used on.
Expand the Data Sources node.
Right-click the data source that the method is associated with, and then select Override Method > init.
Call the FormDataSource.cacheAddMethod method after the call to super() in the init method.
Like 
this.cacheAddMethod(tablemethodstr(SalesTable, totalQty)); 
we can call all the display methods one by one 
=============================================================================================

Args class in Axapta

Args class in Axapta


 

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
Args    args = new Args("CustTable");
FormRun formRun = ClassFactory.formRunClass(args);
;
formRun.init();
formRun.run();
formRun.wait();

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] )
see parmEnumType

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('CUS-001'));
new MenuFunction(MenuItemDisplayStr(CustTable),MenuItemType::Display).run(Args);
}

This code will open the CustTable form and filter out the
customer with accountnumber CUS-001.

How to Create New financial dimension in AX2009

How to Create New financial dimension in AX2009


Hi friends many of the client  requirement’s  to create a new financial dimension in AX apart from the three standard dimensions "Department", "Cost center" and "Purpose".
Here is a steps to creating a new financial dimension.


To create a new financial dimension modify following objects one by one

1)Base enum "SysDimension" : Find this base enum and right click on this base enum -> Select option "New element". In properties window give a name to this element say "TestDim" and label as "Test dimension". Save the base enum.
2)Extended data type "Dimension" : Find this EDT and then add a new array element in this EDT. Name this array element as "TestDim". In properties window specify label as "Test dimension". Now in the "Relations" tab of this new array element add a new "Normal"  relation first. To this normal relation open properties window and set property Table as "Dimensions" and Related field as "Num". Now add another relation of type "Related field fixed". To this related field fixed relation open properties window and set Related field as "DimensionCode" and property value as "3" (this is the value of the new enum element created in SysDimension). Save the EDT.
3)Extended data type "DimensionCriteria" : Repeat the process of modification as done for EDT "Dimension" above.
4)Extended data type "XMLMapDimension" : Find this EDT in AOT and then create a new array element for this EDT. Label this array element as "Test document value". Save the EDT.
5)Extended data type "MandatoryDimension" : Find this EDT in AOT and then create a new array element for this EDT. Label this array element as "Validate test dimension". Save the EDT.
6)Extended data type "DimensionLedgerJournal" : Find this EDT in AOT and then create a new array element for this EDT. Label this array element as "Test dimension". Save the EDT.
7)Extended data type "DimensionKeepFromTransaction" : Find this EDT in AOT and then create a new array element for this EDT. Label this array element as "Keep transaction test dimension". Save the EDT.
8)Extended data type "COSAllowDimensions" : Find this EDT in AOT and then create a new array element for this EDT. Label this array element as "Test dimension". Save the EDT.
9)Extended data type "DimensionPriority" : Find this EDT in AOT and then create a new array element for this EDT. Label this array element as "Test dimension". Save the EDT.
10)Extended data type "DimensionAllocation" : Find this EDT in AOT and then create a new array element for this EDT. Label this array element as "Test dimension". Save the EDT.
11)Table "LedgerJournalTrans" : Find this table in AOT and add a new relation in the relations tab as follows. Create a new relation in relations tab and name it as say "interCoDimension3" (You can see three more similar relations with suffix 0, 1 and 2 for three standard dimensions). Now set the property table of this relations as "Dimensions". Create a new "Normal" relation under this realtion tab and set the property "Field" = "OffsetCompany" and property "RelatedField" = "dataAreaId". Create another "Normal" relation under this relation tab and set the property "Field" = "InterCoDimension[4]" and property "RelatedField" = "Num". Now create a new "Related field fixed" relation under this tab and set property "Value" = 3 (this is the value of the new enum element created in SysDimension) and property "Related field" = "DimensionCode". Save the changes.

The new financial dimension is successfully created in AX and can be viewed in different forms through out the AX where ever dimensions are used. After that first do compilation and then Synchronization then it will effect.

Monday, 9 December 2013

Data from AX to SQL and vice - versa

public server static void Main(Args _args)
{
    ODBCConnection                  myODBC;
    Statement                       myStatement;
    LoginProperty                   myLoginProperty;
    Resultset                       myResultset;
    SqlStatementExecutePermission   sqlPermission;
    str                             mySQLStatement;
    str                             myConnectionString;

    str myUserName = "BKITECH.COM\\Hmishra8100";
    str myPassword = "Buckeye1";
    ;

    myConnectionString = strfmt("UID=%1;PWD=%2",myUserName,myPassword);
    myLoginProperty    = new LoginProperty();

    myLoginProperty.setServer("STNSR041");
    myLoginProperty.setDatabase("MESDB_PRD");
    myLoginProperty.setOther(myConnectionString);

    try
    {
        myODBC      = new OdbcConnection(myLoginProperty);
        myStatement = myODBC.createStatement();

        //mySQLStatement = "SELECT * FROM BKI_Labels";
        //mySQLStatement  =   strFmt("insert into [MESDB_PRD].[dbo].[BKI_Labels] (printer_name,label_name, lot_no,item_id) values ('%1','%2','%3','%4')", 'Clamp', 'lablename', '123456789','Workbench clamp');
        mySQLStatement  = "insert dbo.BKI_Labels (printer_name,label_name, lot_no,item_id) values ('test', 'lablename', '012345678','Workbench clamp')";
        sqlPermission  = new SQLStatementExecutePermission(mySQLStatement);
        sqlPermission.assert();
        myResultSet = myStatement.executeQuery(mySQLStatement);

        while (myResultSet.next())
        {
            info(strFmt("%1, %2", myResultSet.getString(1), myResultSet.getString(4)));
        }
        CodeAccessPermission::revertAssert();
    }
    catch
    {
        error('Unexpected error');
    }

}
//INSERT dbo.BKI_Labels (printer_name,label_name, lot_no,item_id)    VALUES ('Clamp', 'lablename', '012345678','Workbench clamp')


=======================================================================
Read Data from SQL  to AX :

public void run()
{
      LogInProperty   Lp = new LogInProperty();
    OdbcConnection  myConnection;
    Statement       myStatement;
    ResultSet       myResult;
    str             sqlQuery;
    str             mydatasource = "SADAD_Staging_DB";
    str myDSN="SADAD_Staging_DB";
    str myUserName="shaja";
    str myPassword="dns@123";
    str myConnectionString;
    str       customerId = "1001";
     str sql, sql1, custAccountId;
    str CreatedDate, StagId, modifiedDateTime, queryread;
    SqlStatementExecutePermission perm, perm1;
    SADADBillStagingTable  billStagTable;
    SADADRejectedBillStagingTable   rejectedBillStagTable;
    Resultset                       resultSet, resultSetCount;
    AccountNum  AccountStatus;
    RecId  Id;
    BillID billid;
    str custAccount, batchId,billStatus,BillCategory, serviceType, billingNo, mobileNo;
    utcDateTime billTimeStamp;
    real amount;
    str status,billingaccount;
    SADAD_BillLogTable BillLogTable;
     str Billing_Account, BillStatusCode,BillNumber,DueAmount,LanguageId,LedgerTransType,OfficialId,OfficialIdType,IntegrationIndicator,SuccessfullBillSMS,PaymentNotificationSMS;
    //CodeAccessPermission codeaccessPermission = new CodeAccessPermission();
;
    Lp.setDSN("SADAD_Staging_DB");

    myConnection = new OdbcConnection(LP);

       if (myConnection)
    {
        //queryread = "SELECT * from [SADAD_Staging_DB].[dbo].[SADAD_RajectTable] where [SADAD_Staging_DB].[dbo].[SADAD_RajectTable].Upload = 0 ";

        queryread = "SELECT * from [SADAD_Staging_DB].[dbo].[BillsHistory]"; //where [SADAD_Staging_DB].[dbo].[SADAD_BillLogTable].status = rejected ";
        //Assert permission for executing the sql string.
      ////  perm = new SqlStatementExecutePermission(queryread);
       //// perm.assert();

        //Prepare the sql statement.
        myStatement = myConnection.createStatement();
        // myStatement.executeUpdate(sql);
        myResult = myStatement.executeQuery(queryread);
       //// CodeAccessPermission::revertAssert();

         while (myResult.next())
        {
          billingaccount  = myResult.getString(1);
          billid          = myResult.getString(11);
          status          = myResult.getString(15);

          ttsBegin;
            while select forUpdate BillLogTable where BillLogTable.BillId == billid //BillLogTable.ReferenceBillID == billid
            {
                // billStagTable.UploadStatus = NoYes::No;
                // billStagTable.ReferenceBillID = "";
                BillLogTable.Status = status;
                BillLogTable.update();
            }
          ttsCommit;
        }
            //sql1 = strFmt("insert into [SADAD_Staging_DB].[dbo].[SADAD_BillTable](billid, Billing_Account, BillStatusCode, Billcategory, ServiceType,  BillNumber, BillTimeStamp, DueAmount, LanguageId, OfficialId, IntegrationIndicator,SuccessfullBillSMS,PaymentNotificationSMS, mobileno) select billid, Billing_Account, BillStatusCode, Billcategory, ServiceType,  BillNumber, BillTimeStamp, DueAmount, LanguageId, OfficialId, IntegrationIndicator,SuccessfullBillSMS,PaymentNotificationSMS, mobileno from [SADAD_Staging_DB].[dbo].[SADAD_BillLogTable] where  [SADAD_Staging_DB].[dbo].[SADAD_BillLogTable].status = 'rejected'"); - 31/0713

        sql1 = strFmt("insert into [SADAD_Staging_DB].[dbo].[Bills](billid, Billing_Account, BillStatusCode, Billcategory, ServiceType,  BillNumber, BillTimeStamp, DueAmount, LanguageId, OfficialId, IntegrationIndicator,SuccessfullBillSMS,PaymentNotificationSMS, mobileno) select billid, Billing_Account, BillStatusCode, Billcategory, ServiceType,  BillNumber, BillTimeStamp, DueAmount, LanguageId, OfficialId, IntegrationIndicator,SuccessfullBillSMS,PaymentNotificationSMS, mobileno from [SADAD_Staging_DB].[dbo].[SADAD_BillLogTable] where  [SADAD_Staging_DB].[dbo].[SADAD_BillLogTable].IsRejected = '1'");



           //  sql1 = strFmt("insert into [SADAD_Staging_DB].[dbo].[SADAD_BillTable](billid, Billing_Account, BillStatusCode, Billcategory, ServiceType,  BillNumber, BillTimeStamp, DueAmount, LanguageId, OfficialId, IntegrationIndicator,SuccessfullBillSMS,PaymentNotificationSMS, mobileno) select billid, Billing_Account, BillStatusCode, Billcategory, ServiceType,  BillNumber, BillTimeStamp, DueAmount, LanguageId, OfficialId, IntegrationIndicator,SuccessfullBillSMS,PaymentNotificationSMS, mobileno from [SADAD_Staging_DB].[dbo].[SADAD_BillLogTable] where  [SADAD_Staging_DB].[dbo].[SADAD_BillLogTable].status = 'rejected'");

             perm1 = new SqlStatementExecutePermission(sql1);
             perm1.assert();

            //Prepare the sql statement.
            myStatement = myConnection.createStatement();
            myStatement.executeUpdate(sql1);
            myResult = myStatement.executeQuery(sql1);
        // sql = strFmt(" DELETE  from [SADAD_Staging_DB].[dbo].[SADAD_BillLogTable] where  [SADAD_Staging_DB].[dbo].[SADAD_BillLogTable].status = 'rejected' ");  - 31/07/13

        sql = strFmt(" DELETE  from [SADAD_Staging_DB].[dbo].[BillsHistory] where  [SADAD_Staging_DB].[dbo].[SADAD_BillLogTable].IsRejected = '1' ");
            perm = new SqlStatementExecutePermission(sql);
           // perm.assert();
            myStatement = myConnection.createStatement();
            myStatement.executeUpdate(sql);
            myResult = myStatement.executeQuery(sql);

            CodeAccessPermission::revertAssert();


   //// }
       myStatement.close();
    }
      else
    {
        error("Failed to log on to the database through ODBC.");
    }
    pause;

}
========================================================================
From AX to SQL :


public void run()
{
    LogInProperty   Lp = new LogInProperty();
    OdbcConnection  myConnection;
    Statement       myStatement;
    ResultSet       myResult;
    str             myConnectionString;
    SqlStatementExecutePermission perm;
    CustTrans        custTrans;
    CustTable        CustTableloc, custtableloc1;
    str              sql, sql1,  custAccountId, AccountStatus,BillStatusCode,BillNumber,BillTimeStamp,DueAmount,LanguageId,LedgerTransType,OfficialId,OfficialIdType,IntegrationIndicator,SuccessfullBillSMS,PaymentNotificationSMS, Billcategory, ServiceType ;
    BillID billid;
    str             queryread,queryread1, ReferenceID,custAccountId1,tmp, mobileno;
    SADADOfficialIdMaster officialIdMaster;
    SADADIntegIndi      integInd;
    SADAD_BillLogTable BillLogTable;
    str upperlimit,lowerlimit;
    str duedt, billCycle,createdOn;
    str a,b,temp;
    str N = N;
    real amount;
    str zeroamt,tmpBillHistBillAcct, tmpBillHistBillCycle, tmpBillHistBillAcct1, tmpBillHistBillCycle1;

    int counter;
    ;

    Lp.setDSN("SADAD_Staging_DB");
    myConnection = new OdbcConnection(LP);

    if (myConnection)
    {
        while   select CustTableloc
            where   CustTableloc.SADADCust == NoYes::Yes            &&
            (CustTableloc.SADADAccStatus == SADADAccStatus::Activate || CustTableloc.SADADAccStatus == SADADAccStatus::NewAccount)
            /**/
             //&& CustTableloc.AccountNum == "3231073"
            /**/
        {
            counter++;
            select  sum(AmountMST) from custTrans
                where custTrans.AccountNum == CustTableloc.AccountNum;
            if(custTrans.AccountNum == "3282139") break;
            custAccountId  = CustTableloc.AccountNum;
            Billcategory   = "ICDocBills";
            ServiceType    = "UTIL";
            BillNumber     = custAccountId;
            BillTimeStamp  = DateTimeUtil::toStr(DateTimeUtil::getSystemDateTime());//datetime2str(DateTimeUtil::getSystemDateTime());
            DueAmount      = num2str(custTrans.AmountMST,10,2,0,0);
            LanguageId     = "1";
            OfficialId     = SADADOfficialIdMaster::findbyAccountNumIsPrimary(CustTableloc.AccountNum).OfficialID;
            OfficialIdType = SADADOfficialIdMaster::findbyAccountNumIsPrimary(CustTableloc.AccountNum).OfficialIDType;
            duedt          = DateTimeUtil::toStr(DateTimeUtil::getSystemDateTime());
            upperlimit     = num2str(CustTableloc.SADADUpperLimit,10,2,0,0); //num2str(0,10,2,0,0);
            lowerlimit     = num2str(CustTableloc.SADADLowerLimit,10,2,0,0);
            a = int2str(mthOfYr(today()));
            if(strLen(angel) == 1)
            {
                a = '0' +a;
            }
            b = int2str(year(today()));
            billCycle      = a + b;
            createdOn      =DateTimeUtil::toStr(DateTimeUtil::getSystemDateTime());

            select officialIdMaster
                where officialIdMaster.AccountNum == CustTableloc.AccountNum;
            select integInd
                where integInd.FacilTypeId == officialIdMaster.OfficialIDType;
            IntegrationIndicator =SADADIntegIndi::findbyFacilitytypeId(officialIdMaster.OfficialIDType).IntegrationIndicator;

            select custtableloc1
                where custtableloc1.AccountNum == CustTableloc.AccountNum;
            mobileno       = custtableloc1.phone();

            //if(!mobileno)
                mobileno = "966591117959";
            /*else
                info(mobileno);*/

            if(CustTableloc.AccountNum)
            {
                    SuccessfullBillSMS = "عميلنا العزيز لقد صدرت فاتورتك، يرجى تسديد المبلغ الإجمالي المستحق"
                + DueAmount
                +  "  ريال سعودي قبل مرور 30 يما بحد اقصى مستخدما رقم الحساب "
                + custAccountId
                +  "عبر قنوات سداد" ;
                PaymentNotificationSMS = custAccountId+"ريال سعودي في حسابك رقم  #####   عميلنا العزيز شكرا لقد تم استلام مبلغ " ;// عميلنا العزيز"
            }

            queryread = "SELECT * FROM [SADAD_Staging_DB].[dbo].[Bills] where BillingAcct ='"+custAccountId+"'";
            myStatement = myConnection.createStatement();
            myResult = myStatement.executeQuery(queryread);

            while (myResult.next())
            {
                    ReferenceID = myResult.getString(1);
                    tmp = myResult.getString(devil);
            }

            queryread1 = "SELECT * FROM [SADAD_Staging_DB].[dbo].[BillsHistory] where BillingAcct ='"+custAccountId+"' and BillCycle = '"+billCycle+"'";
            myStatement = myConnection.createStatement();
            myResult = myStatement.executeQuery(queryread1);

            while (myResult.next())
            {
                tmpBillHistBillAcct = myResult.getString(devil);
                tmpBillHistBillCycle = myResult.getString(7);
                if(tmpBillHistBillAcct == BillNumber && tmpBillHistBillCycle == billCycle)
                {
                    tmpBillHistBillAcct1 = tmpBillHistBillAcct;
                    tmpBillHistBillCycle1 = tmpBillHistBillCycle;
                }
            }

            amount = any2real(DueAmount);
            info(strFmt("%1. Customer %2: Amount: %3", counter, custAccountId, amount));

            /*Check if the same amount has been uploaded recently.. it should not then*/
            if(SADAD_BillLogTable::existLastBillAmount(billCycle, custAccountId, amount))
                continue;// do not send the same amount again
            /**/
            /*Check in case any bill has been uploaded for the same customer within 24 hours, which is wrong*/
            if(SADAD_BillLogTable::existsBillInTheSameDay(billCycle, custAccountId))
                continue;
            /**/
            if((amount > 0.00) )
            {
                if(custAccountId != tmp)
                {
                    if(BillNumber == tmpBillHistBillAcct1 && billCycle == tmpBillHistBillCycle1)
                    {
                        BillStatusCode = "2";
                    }
                    else
                    {
                        BillStatusCode = "1";
                    }
                    if(!mobileno) break;
                    sql = strfmt("insert into [SADAD_Staging_DB].[dbo].[Bills](BillingAcct, BillStatusCode, BillCategory, ServiceType,  BillNumber, BillTimeStamp, AmountDue, UpperLimit, LowerLimit, DueDt, Language, SuccessfullBillSMS,PaymentNotificationSMS, MobileNo, BillCycle, CreatedOn) values ('%1','%2','%3','%4','%5','%6','%7','%8','%9','%10','%11', N'%12', N'%13','%14','%15','%16')",custAccountId, BillStatusCode, Billcategory, ServiceType, BillNumber, BillTimeStamp, DueAmount, upperlimit,lowerlimit,duedt, LanguageId, SuccessfullBillSMS, PaymentNotificationSMS, mobileno, billCycle, createdOn);

                }
                else
                {
                    /*Added by Amer, To check if the bill is processed already (exists in Bill History) or not*/
                    if(custAccountId == tmpBillHistBillAcct1 && billCycle == tmpBillHistBillCycle1)
                        BillStatusCode = "2"; // bill has been proceessed before, which means it needs to be updated
                    else
                        BillStatusCode = "1"; // bill has not been processed yet, which means we will need to process it
                    sql = strFmt(&quot..

Builds in AX

INDEX :
1. Links
2. AX 2012 R2 With CU7 Compilation
3.  Installation of Help Server AX 2012
4. Pre-requisites 
============================================================================================
(http://hotfixv4.microsoft.com/Microsoft%20Dynamics%20AX%202012%20R2/nosp/KB2885603_FullPackage/6.2.1000.4051/free/470086_intl_i386_zip.exe)  - CU 7 build 


http://www.microsoft.com/en-us/download/details.aspx?id=40894 -- > Installation Doc for CU7

=============================================================================================

AX 2012 R2 with CU7- compilation


If the AX version is R2 with CU7, then don’t waste your time for compilation around 6 hours.

Use the following steps to have the compilation with 30 to 1 hour based on the system speed. Use the Command prompt to run the compilation.
There is new AXBuild.exe tool available from MS in the server folder. Path is
[Drive:]\Program Files\Microsoft Dynamics AX\60\Server\<YOUR AOS NAME>\bin

Use the path in CMD using cd command. And run the following command.

axbuild.exe xppcompileall /aos=01 /altbin="C:\Program Files (x86)\Microsoft Dynamics AX\60\Client\Bin" /workers=4               

where  
/aos = 01 is number of the AOS available in the server. AOS number will be identified in the AX Server configuration utility. It will be like 01,02,etc..
/worker = 4, give based on the server processor core. Count the number of code in the processor in Device Manager and give the number after “/worker =”.

You can the compilation output in the folder C:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\Log\ as a HTML file.
You can import it in AX output window in Dev environment and resolve the errors.


Hope it will save your time.
=======================================================================

Installation of Help Server AX2012

Microsoft Dynamics AX Help is a client and server based system that distributes and displays documentation.
1.       The Help client is the Help viewer application that requests and displays documentation and gets installed with the Microsoft Dynamics AX client application.
2.       The Help server responds to the Help viewer request for documentation. In addition, the Help server stores the files that contain the Help documentation.
Important: This Server-client Help system does not supply Help documentation for Enterprise Portal. You will have to install Enterprise Search to support help documentation for EP.

Other information about Ax 2012 Help server which is good to know:
ü  Typically, you can initiate a help request from either the client or developer workspace by pressing F1 /button / via command.
ü  The client identifies the Help topic to retrieve. To identify the documentation for the form from where Help is initiated, the documentation has an ID property that has the same value as the ID of the form.
ü  The client retrieves the URL of the Help web service. The first time that you request help, the client contacts the AOS to retrieve the URL of the help web service. The client then caches the URL and uses the cached URL for additional help requests.
ü  The client calls the Help viewer. If the Help viewer is not running, the viewer is started. The call to the Help viewer includes the URL of the help server and the ID of the form.
ü  URL can be updated/modified under path AX2012 > System Administration > Setup > System > Help system parameters.

How to Install the Help server:
1.       Start Microsoft Dynamics AX Setup. Under Install, select Microsoft Dynamics AX components.Advance through the initial wizard pages.
2.       On the Select installation type page, click Custom installation, and then click Next.On the Select components page, select Help Server, and then click Next.


3.       Check for prerequisites, When no errors remain, click Next.
4.       On the Connect to an AOS instance page, enter the name of the computer that is running AOS and other port. Click Next.Note that, If you entered AOS information for other Microsoft Dynamics AX components that you have installed on this computer, this screen is not displayed.
5.       On the Configure a Web site for Help Server page, select the web site that you have chosen to host the Help server. Verify that the location of the physical directory for the web site is displayed. Click Next.


6.       On the Specify the Help Server account page, enter a domain user account and password.This account must be the same as the .NET Business Connector proxy account for the AOS, and it must be a user in Microsoft Dynamics AX. This should be a service account that does not expire. Click Next.
7.       On the Language and content selection page, select the Help languages and content types to install. EN-US must be installed, and is checked by default. Click Next.
8.       On the Prerequisite Validation page, resolve any errors.
One possible error which you might observe when you have SharePoint / Enterprise portal already installed in the machine is shown below:




Error: Web site (Help Server) is shown because the Default web site is not started. And this could be because SharePoint installation has taken over the Port 80 and kicked off the Default web site.

Solution: Go to IISManager (inetmgr) and then Edit bindings for the Default site to change the port number from 80 to something else (say 81).
After doing so, you can start the Website. This should resolve the issue shown above.





9.       When no errors remain, click Next.
10.     On the Ready to install page, click Install.After the installation is complete, click Finish to close the wizard.
After the Microsoft Dynamics AX Help files are installed, they must be indexed by Windows Search Service before you can view them. Depending on system load and the number of files, it may take up to an hour for indexing to finish.
More information on how to Install the help server [AX 2012]
==========================================================================
4. Pre-Requisites for Installation  : 
Following snap will give you an insight into the Dynamics Ax 2012 components and their supported operating systems.





Sunday, 1 December 2013

AX 2009 report not fetching data when run in server.

Data is not fetched when I run ax 2009 report  in server , while it fetches data when run at client and called on :

qr.setRecord(this.inittmp()); 


When we work on reports, The most important difference is the use of .setRecord() instead of .setTmpData().