I seem to be getting caught more and more by this. I have this line of code:
orderGraph.Document.Current = orderGraph.Document.Search<SOOrder.orderType, SOOrder.orderNbr>(graphBulk.Order.Current.OrderType, graphBulk.Order.Current.OrderNbr);
I believe it should be looking for a sales order record. It worked fine in testing with SO for the order type. Then we added another order type, BK, and this code failed to find the record.
So I switched the code to this:
SOOrder order = SOOrder.PK.Find(graphBulk, graphBulk.Order.Current.OrderType, graphBulk.Order.Current.OrderNbr);
And it finds the record without a problem.
So what is the Search method doing that causes it not to find the record? Sometimes I will need to use a search but I need to be able to understand why it operates differently (and cannot find the SO record when I’ve supplied both key field values).