Monday, 24 September 2018

putting debugger in visual studio in ax 2012

some times we need to debug the batch job in ax 2012 so  we need to attach the process

which is as given below:


Thursday, 13 September 2018

get VAT percentage of purchase line

static void purchsalestax(Args _args)
{
    TaxOnItem       TaxOnItem;
    TaxGroupData    TaxGroupData;
    real            TaxAmount;
    TaxValue        TaxValue;
    PurchLine       PurchLine;
    ;

    select firstOnly PurchLine where PurchLine.PurchId == '00002622'
    && PurchLine.LineNumber == 1;   

    if(PurchLine.TaxItemGroup && PurchLine.TaxGroup && PurchLine.LineAmount != 0)
    {
        while select TaxOnItem
        where TaxOnItem.TaxItemGroup == PurchLine.TaxItemGroup
        join TaxGroupData
        where TaxGroupData.TaxGroup == PurchLine.TaxGroup
        && TaxGroupData.TaxCode  == TaxOnItem.TaxCode
        {
            if(TaxGroupData)
            {
                TaxValue  =  TaxData::find(TaxOnItem.TaxCode, Systemdateget(), 0).TaxValue;
                TaxAmount = (PurchLine.LineAmount * TaxValue) / 100;
                info(strFmt("Rate = %1, Tax Amount = %2",TaxValue,TaxAmount));

            }
        }
       
    }


}

Tuesday, 11 September 2018

creating DPK file and saving the changes


Creating the DPK 
  1. In CoreXT type sdp pack -c <changelist number> <file name>.dpk, for example: 
sdp pack -c 6959294 TMSProjects.dpk 

If the -c parameter is not used, then the default change list is used. 


  1. The file is located in the root folder for the enlistment, for example: 
E:\RainMain\TMSProjects.dpk 

  1. Copy the file on your own machine or some place on which it will not get deleted. 

Applying the DPK 
  1. Copy the file to the root folder of the enlistment (on the other machine), for example: 
E:\RainMain 

  1. In CoreXT type sdp apply <file name>.dpk -a, for example: 
sdp apply TMSProjects.dpk -a 


If you open SDB, you can see that a new change list has been created. 

  1. In CoreXT type sd resolve -a and resolve the co

intercompany PO multiple product receipt by x++

public void processStampICPO(PackingSlipId _deliveryNote,                             Transdate _deliverydate,                             ...