Exception of type 'JiwaFinancials.Jiwa.JiwaApplication.Exceptions.RecordNotFoundException' was thrown
The perplexing thing is that we get the error right after saving the order, so we know the order has to exist.
Jiwa6 SalesOrder didn't like saving twice, so we save the order then find it again.
This works fine 99% of the time, but once in a while we get the RecordNotFoundException.
I can only guess that the reason the error occurs is because of system load - Possibly an SQL query timing out or something to do with an asynchronous operation.
The basic process is as follows:
- Code: Select all
SalesOrder jiwaOrder = JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.BusinessLogicFactory.CreateBusinessLogic<SalesOrder>(null);
jiwaOrder.Setup();
jiwaOrder.CreateNew(SalesOrder.NewSalesOrderTypes.e_NewSalesOrder, "1001", false, "", "", "", jc.LogicalWarehouseID);
// more setup
//... add lines etc
jiwaOrder.Save(false, false);
string InvoiceID = jiwaOrder.InvoiceID;
this.jiwaOrder.Find(JiwaFinancials.Jiwa.JiwaApplication.IJiwaNavigable.ReadModes.Actual, "SO_Main.InvoiceID", InvoiceID, "");
Note that the error can also occur if the order is created, saved, reloaded, time elapses (hours to days) then .Find is called again.
For some orders that wouldn't load the SO_History.DateProcessed field was null, but this wasn't always the case.
Looking forward to a response.



