Tuesday, 7 January 2014

Find On Hand through X++ in ax 2009


static void findOnHand(Args _args)

InventDim inventDim;
InventDimParm inventDimParm;
Itemid itemid;
InventOnHand inventOnHand = new InventOnHand();
;

// take a sample item for testing
itemid = "20 MM RMC";

// take a combination of dimension , against which you want to find the stock
inventDim.InventLocationId = "GW";

//Set the flag for the selected dimensions as active.
inventDimParm.initFromInventDim(inventDim);

//initialize the inventonhand with item,dimension and dim paramter
inventOnHand = InventOnHand::newParameters(itemid, inventDim, inventDimParm);

// Retrieve the onhand info
info(strfmt("Available Physical: %1", inventOnhand.availPhysical()));
info(strfmt("Physical Invent: %1", inventOnhand.physicalInvent()));
info(strfmt("On order: %1", inventOnhand.onOrder()));

}

No comments:

Post a Comment

SQL/SSRS Interview questions I thought of blogging some SQL/SSRS interview questions.

Below are some. I will add more, when I complete the compilation 1. What is OLTP(Online Transaction Processing)? OLTP stands ...