Alfasith AX

Alfasith AX
اللَّهُمَّ انْفَعْنِي بِمَا عَلَّمْتَنِي، وَعَلِّمْنِي مَا يَنْفَعُنِي، وَزِدْنِي عِلْمًا

Wednesday, July 24, 2013

Cross row manipulation of SSRS reports 2012

Hi,

Cross summation or manipulation in SSRS reports.
Consider the below image has credits and debit, The Balance is calculated by 
=Credit - Debit + Balance.



 From my knowledge it is not possible in Visual Studio. Instead we can make this possible by below procedure.
1.Create a field in the temp table as balance.
2. In contract class just in the insert method make this 
TmpTableName.Balance =  TmpTableName.Balance + TmpTableName.Credit - TmpTableName.Debit ;
3.Refresh the dataset add the fields in to the expected position then observe the application.

Enjoy it 

Tuesday, July 23, 2013

Change company in Dynamics AX 2009

Hi, 

In Microsoft Dynamics AX Axapta, sometimes, we can to insert/update/delete records in different companies or insert/update/delete according to the company we are... 

In Dynamics AX, exists the "changeCompany" function, that allow us to do that easily.

Here's an example:



static void main()
{
    CustTable custTable;
    ;

    //Assume that you are running in company 'aaa'.
    changeCompany('bbb') //Default company is now 'bbb'.
    {
        custTable = null;
        while select custTable
        {
            //custTable is now selected in company 'bbb'.
        }
    }


    //Default company is again set back to 'aaa'.

    changeCompany('ccc') //Default company is now 'ccc'.
    {  
        //Clear custTable to let the select work
        //on the new default company.
        custTable = null;
    

        while select custTable
        {
            //custTable is now selected in company 'ccc'.
        }  
    }

    //Default company is again 'aaa'.

}

SQL code to upate one Legal entity banner to all the legal entity in D365

 Hi, update companyimage set  companyimage.Image  = companyimageA.Image  from  ( select Image from companyimage where dataAreaid = 'USF...