‘findItemPriceAgreement’ is obsolete. Use the instance method PriceDisc.findPrice instead.

This is an example of a code upgrade from Ax 2012 R3 to D365FO. It is not so hard to figure out but might save 30-60 minutes for someone else out there. PriceDisc::findItemPriceAgreement(…) call needs to be replaced by ¬†priceDisc.findPrice(…) as stated in the compilation error, but ‘findPriceAgreement’ has many parameters while ‘findPrice’ has only one. The solution is to use the ‘PriceDiscParameters’ class. Using its ‘parm’ methods, set the parameters that were before separate parameters of the ‘findPriceAgreement’ static method, after that call ‘PriceDisc::newFromPriceDiscParameters(priceDiscParameters)’ to create an intance of PriceDisc See an example below:

AX2012 code:

Code upgraded to D365FO:

https://github.com/PeterProkopecz/AX/tree/master/D365FO_Upgrade_PriceDisc_FindPrice

Leave a Reply

Your email address will not be published. Required fields are marked *