Sales Order Header DMT throwing NullReferenceException

We are trying to perform a DMT to update the notification e-mail and UPS Ship From Name fields in the Sales Order Header.

We are providing the required fields: Company, OrderNum, and CustomerCustID which is the CustID from the Customer table joined against the OrderHed table on CustNum.

More specifically, we are getting the data using the following SQL query:

SELECT OrderHed.Company,OrderHed.OrderNum,Customer.CustID,OrderHed.NotifyEMail,OrderHed.UPSQVShipFromName
FROM OrderHed
JOIN Customer
ON OrderHed.CustNum = Customer.CustNum
WHERE

After getting the data into CSV we are then we are modifying the NotifyEMail and UPSQVShipFromName fields appropriately and then trying to DMT the results back in with “Update” checked. We have about 20,000 rows, and every single one of them throws this exception:

<Sales Order #> BPM runtime caught an unexpected exception of ‘NullReferenceException’ type.
See more info in the Inner Exception section of Exception Details.
BPM runtime caught an unexpected exception of ‘NullReferenceException’ type.
See more info in the Inner Exception section of Exception Details.
at Epicor.ServiceModel.Channels.ImplBase`1.ShouldRethrowNonRetryableException(Exception ex, DataSet dataSets)
at Erp.Proxy.BO.SalesOrderImpl.GetList(String whereClause, Int32 pageSize, Int32 absolutePage, Boolean& morePages)
at Epicor.DMT.Lib.SalesOrderHeaderImporter.Import(ImportData data, ExtendedBackgroundWorker worker)

As a result, no records are updated.

This is from the full error log, so I’m not sure what it’s referring to by “in the Inner Exception section of Exception Details”.

At first I thought it was because some of the latter two fields were empty but I get this even if no fields are empty, and it happens on every single record.

What could be causing these exceptions? What is the “Inner Exception section of Exception Details” referring to? Is there some place I can look for this information?

I have found that generally, when DMT cannot find a unique record, I will get the NullReferenceException instead of a more helpful “Record not found” error. Make sure that you have all the keys required for that record so DMT can find one and only one record.

Thanks, Mark.

The only key fields I see for OrderHed are Company and OrderNum, which I’m providing. I also tried adding CustNum since the key fields for Customer are Company and CustNum, but I get the same error.

Am I missing something else?

I would try updating one manually and then run your BAQ and look at the layout to see if it would have matched.

I’m not sure what you mean “look at the layout to see if it would have matched”. I assume when you say updating one manually you mean from the Sale Order Entry screen.

I had another thought, I tried adding SysRowID, presumably it would be in the OrderHed table. I’m not sure how to format it, so I just put the hex string in quotes, e.g. “{E7BEDE99-3481-E5A8-E222-3456783A9B78}”. Didn’t work. (edit: to clarify, it didn’t seem to have any issues with the field, it just produced the same error as before.)

Yes, update in Sales Order Entry and then run this query again for the one order you updated and see what an import file would look like. I would use a BAQ instead of SSMS query to get the same formatting according to the Data Dictionary. Also try adding the SySRowID into that BAQ.

I also try to do it in an updatable BAQ to see if I can get that to work first. A lot of times there is an obscure relationship to another table that is required yet not obvious. If you can get it to work in a BAQ update then it will have a better chance of working in DMT.

Thanks Eric. I can’t seem to get an updatable BAQ that doesn’t have the error “Updatable Business Object and method are not properly specified”. By default I just left the default mandatory fields as is and only tried to make NotifyEmail and UPSQVShipFromName updatable but it also didn’t work with no mandatory fields, no updatable fields, everything mandatory, or everything updatable.

@Mark_Wonsil could it be that it’s not possible to update these fields? They are grayed out in Sales Order Entry and I can’t change them.

1 Like

In previous versions of Epicor, I was able to but maybe they’ve tightened it up if you don’t own whatever the shipping program is called today. :man_shrugging: If so, you’re looking at UD Fields.

Had a cockpit error, I can now update the field from the BAQ. I don’t see any additional information in the BAQ about what I could be missing.

I’m using Business Object Erp.SalesOrder, Update Method: UpdateExt
Tables to update: OrderHed

In the input column mapping there is one column checked as required: OrderHed.OrderNum
and there are two key fields: OrderHed.Company and OrderHed.OrderNum.

2 Likes

Looks like it’s the wrong DMT object… I tried same exact same data on “Sales Order Combined” and my test works, no problem. Now to see if the other ~20k work…

2 Likes