Object reference not set to an instance of an object when viewing an order converted from a quote

G’day folks, trying to finalize our upgrade and have run into an issue with our Frankenform in Sales Order Entry. Would greatly appreciate hearing if anyone has run into this.

Worst of all, it fails on our Pilot environment but not on my DEV environment, and no amount of transferring objects from Dev to Pilot, via customization import or by Solution Workbench has made a difference.

I can reproduce it by creating a quote and converting to an order, and then opening the order. I get the message above, and a fairly short stack trace, below. The Order Release tab opens up with a list of all the releases but no line numbers; however in the DB all the line numbers are correct.

If I refresh the order entry form, the error goes away and the order reloads happily.

If I then enter an SO number for any order, it loads happily regardless of its source.

I’ve attempted to remove all custom code, one method at a time, commenting out the initializers and destructors until there’s nothing left. No change (aside from missing custom functionality).

My challenge is that I am finalizing upgrade issues on this environment and then transferring them to Production; and I don’t want to accidentally infect this problem over onto the other server.

I haven’t found a method called “checkNewReleaseEnable” in any traces I’ve done, nor in the BL tester. We use a UD03 implementation to manage associating VIN’s and it uses GetOrderData. Other than that, all the data we call up in this form comes from dynamic query.

Any ideas out there?

**Edit - I have regenerated the data model, recycled the things, even restarted IIS as a last resort.

======================================
Application Error

Exception caught in: Erp.UI.SalesOrderEntry

Error Detail

Message: Object reference not set to an instance of an object.
Program: Erp.UI.SalesOrderEntry.dll
Method: checkNewReleaseEnable

Client Stack Trace

at Erp.UI.App.SalesOrderEntry.Transaction.checkNewReleaseEnable()
at Erp.UI.App.SalesOrderEntry.Transaction.ordRelTaxView_EpiViewNotification(EpiDataView view, EpiNotifyArgs args)
at Ice.Lib.Framework.EpiViewNotification.Invoke(EpiDataView view, EpiNotifyArgs args)
at Ice.Lib.Framework.EpiDataView.OnEpiViewNotification(EpiNotifyArgs e)
at Ice.Lib.Framework.EpiDataView.InnerNotify(EpiNotifyArgs args)
at Ice.Lib.Framework.EpiDataView.SetChildFilterAndNotifyChildViewWhenHasCurrentRow(EpiDataView childView, EpiNotifyArgs args, Boolean forceIt)
at Ice.Lib.Framework.EpiDataView.SetChildFiltersAndNotifyChildViews(EpiNotifyArgs args, Boolean forceIt)
at Ice.Lib.Framework.EpiDataView.InnerNotify(EpiNotifyArgs args)
at Ice.Lib.Framework.EpiTransaction.NotifyAllOthers(EpiDataView sourceView, Boolean changeGridPropsCurrentRowOnly, Boolean notifyTree, Guid notifyId)
at Ice.Lib.Framework.EpiDataView.InnerNotify(EpiNotifyArgs args)
at Ice.Lib.Framework.EpiDataView.SetChildFilterAndNotifyChildViewWhenHasCurrentRow(EpiDataView childView, EpiNotifyArgs args, Boolean forceIt)
at Ice.Lib.Framework.EpiDataView.SetChildFiltersAndNotifyChildViews(EpiNotifyArgs args, Boolean forceIt)
at Ice.Lib.Framework.EpiDataView.InnerNotify(EpiNotifyArgs args)
at Ice.Lib.Framework.EpiDataView.SetChildFilterAndNotifyChildViewWhenHasCurrentRow(EpiDataView childView, EpiNotifyArgs args, Boolean forceIt)
at Ice.Lib.Framework.EpiDataView.SetChildFiltersAndNotifyChildViews(EpiNotifyArgs args, Boolean forceIt)
at Ice.Lib.Framework.EpiDataView.InnerNotify(EpiNotifyArgs args)
at Erp.UI.App.SalesOrderEntry.Transaction.GetOrderData(Int32 orderNum)

====================================================

Some more info:

  • In another environment on the same server as my Pilot, the problem occurs;
  • If I use search and go to the order created from a quote, it opens perfectly;
  • It only fails if I enter the SONum and leave the field;

I have event triggers on several things that could be activated by leaving that field, either directly or indirectly, and using @hkeric.wci 's client-side logging tip here I can confirm they’re firing; however removing them and/or their functionality makes no difference

For the moment the users will have to use search to open SOs but I don’t like leaving an unknown out there, especially something inconsistent like this.

checkNewReleaseEnable is a client-side method and the line probably failing is this one

else if (!((bool) this.orderDtlView.dataView[row]["OpenLine"]))

It is the only one in the method that doesnt use a null check or .HasRow and given that your Line numbers are blank, something weird is happening likely on Customization Side, GetRows or GetByID BPMs.

GetOrderData does require a valid SO and not a 0. It depends maybe at some point it attempts to pass in 0? It wont do the exists for you, it simply assumes you already confirmed the SO provided is valid, you may need to check if Valid SO before invoking GetOrderData

If you enable developer mode and select Base Only, what happens?

it works just fine, unfortunately!

In my mind that means the customization is at fault… but is it my customization missing some new field that’s only required if there’s a customization?

I haven’t tested Haso’s idea yet, either.

I would probably just start a process of elimination, either start from base or from a fully customized form and work your way forward/backward in small increments.

Once you hit the point of getting the error or stop getting it, you should find the culprit.

1 Like

Thank you!

Yes, I figured it was client side, but
I couldn’t find it by checking “show all code”. Where does it live?

Are you saying that if I use GetRows or GetByID, I should validate their inputs earlier? Maybe in form load or in initialization?

Thanks! Yes, that’s what I’ve been doing, and I’m sure eventually I’ll find it. But with the whole VIN management ecosystem, site-change system, make-vs-buy-per-stocking-site-nearest-customer abomination, etc. there’s 2 weeks of work in that!

My suspicion goes to something related to attribute set. We don’t use that, but a lot of it seems to have turned into mandatory fields or been added to libraries and reports (but nit RDDs, even standard…) , and it has coloured this whole upgrade.

@hkeric.wci , where is this actually found? I haven’t been able to put a finger on it.

It is the inner-workings of GetOrdetData you can only see it by decompiling.

In your code find where you are calling oTrans.GetOrderData you should find that in your Customization, that is where your problem is. You could paste your code too here.

1 Like

When reading a Client Side Trace error message like that, you need to start reading from the bottom not the top. The top may be relevant, but the bottom usually will point you to where the problem is.

1 Like