O'Reilly logo

Learning MS Dynamics AX 2012 Programming by Erlend Dalen, Mohammed Rasheed

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Finding the price of an item for a specific customer

Finding the correct price for an item can be pretty messy if you start to write code that searches the PriceDisc table for the price and, luckily, you don't have to because this has already been taken care of in standard AX. The question is how to use the code that is present in standard AX to get the correct prices when you write your code. The code is as follows:

static void findPrice(Args _args) { PriceDisc priceDisc; InventDim inventDim; Price price; CustTable custTable; InventTable inventTable; InventTableModule sales; // Specify the inventDim that we would like // to get the price for inventDim.configId = "HD"; inventDim.InventSizeId = "50"; inventDim.InventColorId = "01"; inventDim = InventDim::findDim(inventDim); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required