Monday, February 5, 2018

X++ trick to open a Purchtable form through info log in AX 2012

Hi Daxer's,

Hope all are doing well...

Today I'm gonna tell you small helpful trick, how to open Purchtable form from info log.

static void viewPOthroughInfo(Args _args)
{
    PurchTable  purchTable;

    purchTable = PurchTable::find("PO-000001852");

    info(strFmt("@PAC51058",purchTable.PurchId),"", SysInfoAction_TableField::newBuffer(purchTable));
}


Now click and show button,it will navigate to Purchtable form with respect to the PO number.

Sunday, February 4, 2018

Command format to install a model in AX 2012


Command format to install

  • Run as admin Microsoft dynamics AX 2012 management shell.
  • Install-AXModel -File <Filename.axmodel> (E.g - Install-AXModel -File "C:\Partner models\IDNTAX.axmodel")

How to Parallel compile using command prompt in AX 2012

Steps:
  1. Run command prompt as administrator.
  2. copy and paste the highted cd C:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\bin , press enter.
  3. copy and paste the highted ,AXBuild.exe xppcompileall /s=01,press enter.
  4. It take nearly 45 mins to complete the Parallel compile process,
Happy Compiling... 

Thursday, January 25, 2018

x++ code for how to change common table to required table at run time in AX 2012


common _target; //Declaration


   dictTable = new DictTable(tableNum(VendInvoiceInfoLine));

            _target = dictTable.makeRecord();// here now common buffer is converted to VendInvoiceInfoLine 
            //below I'm using VendInvoiceInfoLine .initfrompurchline() through _target 

            _target.initFromPurchLine(purchline); 


            _target.(fieldnum(VendInvoiceInfoLine,defaultdimension)) = purchline.DefaultDimension;

            if(entity.ReceiveNow)

            {
                 //Assigning value on dixf insert update methoad

                _target.(fieldnum(VendInvoiceInfoLine, Receivenow)) = entity.ReceiveNow; 

                _target.(fieldnum(VendInvoiceInfoLine, LineAmount)) = entity.ReceiveNow * _target.(fieldnum(VendInvoiceInfoLine,PurchPrice));


            }

Friday, December 22, 2017

X++ code read a dynamic query range value in ax 2012 r3

query = new query();

ex :
 query  = Query  object 3300db70: SELECT SUM(AvailPhysical), SUM(PMUOM1Qty), SUM(PMUOM2Qty), SUM(PMNetWeight) FROM InventSum(InventSum_1) GROUP BY InventSum.ItemId, InventDim.inventBatchId, InventDim.configId, InventDim.InventColorId, InventDim.InventStyleId, InventDim.InventSiteId, InventDim.InventSizeId, InventDim.InventLocationId, InventDim.wMSLocationId JOIN * FROM InventDim(InventDim_1) ON InventSum.InventDimId = InventDim.inventDimId AND ((configId = N'C000002')) AND ((InventLocationId = N'WH00002')) AND ((InventSiteId = N'Barcelona'))
TYPE:
 Query


queryRun.query().dataSourceTable(tablenum(InventDim)).rangeField(fieldNum(InventDim, inventLocationid)).value()

Wednesday, August 23, 2017

X++ code to find current legal entity Country region

static void FindCountryregionforLegalentity(Args _args)
{
    CompanyInfo    company;
    #ISOCountryRegionCodes
    boolean         isIsoUS       = SysCountryRegionCode::isLegalEntityInCountryRegion([#isoUS]);
    if(isIsoUS == true)
    {
        info("US");
    }
}

Export a copy of the standard user acceptance testing (UAT) database

 Reference link: Export a copy of the standard user acceptance testing (UAT) database - Finance & Operations | Dynamics 365 | Microsoft ...