Missing Method Exeception Error

Everytime I try to add an item in my sales line, the following error pops up and it will not let me perform any actions on my sales order form. I know it’s a huge error, but that’s what makes it so surprising, something I have not seen before.

Error:

System.MissingMethodException: Method not found: ‘System.Collections.Generic.IList`1<Microsoft.Dynamics.Commerce.Runtime.DataModel.SalesLine> Microsoft.Dynamics.Commerce.Runtime.DataModel.SalesTransaction.get_SalesLines()’.
at Dynamics.Ax.Application.RetailSalesOrderCalculator.Setpriceoncurrentline()
at Dynamics.Ax.Application.SalesPurchLine.Setpricediscpriceunit(PriceDisc_Price _priceDisc, PriceDiscPolicyCheckPolicy _checkPolicy, RetailOrderCalculator _retailCalculator, Boolean ) in SalesPurchLine.setPriceDiscPriceUnit.xpp:line 30
at Dynamics.Ax.Application.SalesPurchLine.Setpricediscpriceunit(PriceDisc_Price _priceDisc, PriceDiscPolicyCheckPolicy _checkPolicy, RetailOrderCalculator _retailCalculator)
at Dynamics.Ax.Application.SalesLine.Setpricediscpriceunit(PriceDisc_Price _priceDisc, PriceDiscPolicyCheckPolicy _checkPolicy, RetailSalesOrderCalculator _retailCalculator, Boolean ) in SalesLine.setPriceDiscPriceUnit.xpp:line 18
at Dynamics.Ax.Application.SalesLine.Setpricediscpriceunit(PriceDisc_Price _priceDisc, PriceDiscPolicyCheckPolicy _checkPolicy, RetailSalesOrderCalculator _retailCalculator)
at SalesLine::setPriceDiscPriceUnit(Object , Object[] )
at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeInstanceCall(Object instance, String MethodName, Object[] parameters)
at Dynamics.Ax.Application.SalesPurchLine.Setpricediscpriceunitmarkup(PriceDisc_Price _priceDisc, PriceDiscPolicyCheckPolicy _checkPolicy, RetailOrderCalculator _retailCalculator, Boolean , Boolean ) in SalesPurchLine.setPriceDiscPriceUnitMarkup.xpp:line 28
at Dynamics.Ax.Application.SalesPurchLine.Setpricediscpriceunitmarkup(PriceDisc_Price _priceDisc, PriceDiscPolicyCheckPolicy _checkPolicy, RetailOrderCalculator _retailCalculator)
at Dynamics.Ax.Application.SalesLine.Initfrompricedisc(PriceDisc_Price _priceDisc, PriceDiscPolicyCheckPolicy _checkPolicy, Boolean _initDateFields, RetailSalesOrderCalculator _retailCalculator, Boolean , Boolean , Boolean ) in SalesLine.initFromPriceDisc.xpp:line 17
at Dynamics.Ax.Application.SalesLine.Initfrompricedisc(PriceDisc_Price _priceDisc, PriceDiscPolicyCheckPolicy _checkPolicy, Boolean _initDateFields, RetailSalesOrderCalculator _retailCalculator)
at SalesLine::initFromPriceDisc(Object , Object[] )
at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeInstanceCall(Object instance, String MethodName, Object[] parameters)
at Dynamics.Ax.Application.SalesPurchLine.Setpriceagreement(InventDim _inventDim, Boolean _doCallPriceDate, PriceDiscPolicyCheckPolicy _checkPolicy, Boolean _initDateFields, RetailSalesPurchLineMap _retailSalesPurchLineMap, Boolean , Boolean , Boolean , Boolean ) in SalesPurchLine.setPriceAgreement.xpp:line 31
at Dynamics.Ax.Application.SalesPurchLine.Setpriceagreement(InventDim _inventDim, Boolean _doCallPriceDate, PriceDiscPolicyCheckPolicy _checkPolicy, Boolean _initDateFields, RetailSalesPurchLineMap _retailSalesPurchLineMap)
at Dynamics.Ax.Application.SalesLine.Setpriceagreement(InventDim _inventDim, PriceDiscPolicyCheckPolicy _checkPolicy, Boolean _initDateFields, RetailSalesLine _retailSalesLine, Boolean , Boolean , Boolean ) in SalesLine.setPriceAgreement.xpp:line 6
at Dynamics.Ax.Application.SalesLine.Setpriceagreement(InventDim _inventDim, PriceDiscPolicyCheckPolicy _checkPolicy, Boolean _initDateFields, RetailSalesLine _retailSalesLine)
at Dynamics.Ax.Application.SalesLine.Setpricedisc(InventDim _inventDim, Boolean _initDateFields, RetailSalesLine _retailSalesLine, Boolean , Boolean ) in SalesLine.setPriceDisc.xpp:line 34
at Dynamics.Ax.Application.SalesLine.@Setpricedisc(InventDim _inventDim, Boolean _initDateFields, Boolean )
at Dynamics.Ax.Application.SalesLine.Setpricedisc(InventDim _inventDim)
at Dynamics.Ax.Application.SalesLine.modifySalesQtyIL(Object[] _inputContract) in SalesLine.modifySalesQtyIL.xpp:line 48
at SalesLine::modifySalesQtyIL(Object[] )
at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeStaticCall(Type type, String MethodName, Object[] parameters)
at Dynamics.Ax.Application.SysDictTable.invokeStaticMethod(Object[] _params) in SysDictTable.invokeStaticMethod.xpp:line 32
at SysDictTable::invokeStaticMethod(Object[] )
at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeStaticCall(Type type, String MethodName, Object[] parameters)
at Microsoft.Dynamics.Ax.Xpp.PredefinedFunctions.runAsInvoke(String className, String staticMethodName, Object[] parms, Object[]& exportInfolog)

Have you done the CIL? If yes,

Turn off the CIL (in options → development) and see if you get any error. If you are not getting any error then it could be problem with the IL code generated.

Was there a Model update or any recent code changes to those forms/objects ?

Then well it could also be a caching issue, The new changes couldn’t have been updated in the cache.

Resolution :

Find the object by its name under “Usage data form” that you think has changed recently.

Select and delete those records that are associated to that Form & functionality and Re-test. You should be good.

pastedimage1488421652422v1.png

Hi, thank you for your suggestions.
[mention:d16d1631a7404018a8e6312528e48961:e9ed411860ed4f2ba0265705b8793d05]
When i turn off the CIL and try to add an item in the salesline, the AX debugger opens and then nothing happens. The empty debugger page just stays there. Does that mean anything?

[mention:16365c73cee442d1bc74db5cf6e4bd52:e9ed411860ed4f2ba0265705b8793d05]
So I tried to delete all user cache from my instance and re-tested it to find the same error popping up again. So to add a little context to this, there are a few mods which a third party vendor does for us, and they have been working on CU12 for the past of couple of days and releasing that new CU in all the dev instances. When I reached out to them about this issue, they explain that whatever they are doing shouldn’t affect my instance at this point of time. But I am somehow not convinced about this though.
Is there anything else that I can try to get past this, if not, what other questions can I ask that vendor to get more info on this error?

Compare the differences in hotfixes, there shouldn’t be any differences in Binaries nor Application hotfixes between the environments. Request the KB numbers and do the analysis first to make sure there isn’t any application fix missing.

If you can reproduce the same error on another DEV machine then that itself confirm there is something missing.

Lets Isolate the issue first, Try to reproduce the error in another DEV instance. If you cannot reproduce that then we will comeback & continue to triage this issue in your environment that has issues.

Hi, Thanks for looking into this.

I have tried to reproduce this error in our test instance, but to no avail. This doesn’t seem to be a error in response to the mods and customizations I have been making. I even exported the xpo’s of some projects (mods) that I made, deleted them in my instance and yet this error persists.

Hello Lohit,

can you give more details what exactly your vendor is changing and what do you mean by " your dev instance and vendor is working on other dev instance?"

did you try to do full CIL?

Hi Kunal, There are several modifications which the vendor does for us, which tend to use the same objects (tables/forms/classes) that I use for my own development tasks. It turns out that my instance incompletely picked up some objects and code change which the vendor has been working on, and hence throwing errors.

I however did get past the problem. After debugging, I commented out all the code which looks for objects not present in my instance and it works fine now.

I was finally able to debug the entire code used by the Sales Table form and it turns out there are a lot of objects and code (not completely) which my instance picked up from the vendor(don’t know how and why). So although it was showing the vague missing method exception, the code was trying to use objects which are not there and some method calls which are not present. I commented out all the code which was problematic and it works fine now. So when the vendor does a full CU, hopefully my instance will be in sync with the newest changes. Thank you for your help and I’ll keep you posted on any new things that come up past the CU 12.

Good to hear that you were able to crack the issue.
But…
If that’s just a problem with your DEV machine why don’t you restore database backups from another machine which you think are healthy and proceed. Rather waiting for your vendor to sync next time.

Take a backup of the transaction database and Model database of your current system before proceeding on the restores.