This isn't a big deal, because I can do what I am doing by overriding the form control lookup method, but I am now curious as to why what I originally tried to do wouldn't work.
We added the InventBatch table to the InventRegistrationWMS form in the grid with the InventTrans datasource and joined it to the associated InventDim datasource. However, we had to rename the data source because many of the methods on that form have local InventBatch variables and by naming the new datasource InventBatch, I would have had to refactor many of those methods. so we instead called it ParentBatchRef, because we are trying to assign source parent batches to newly registered batches (we have added new fields to the InventBatch table to allow this.) In order to provide a list of the batches used on the ProdBOM record for the production order, I overrode the lookup method on the InventBatch.ParentInventBatchId field we added to the InventBatch table and wrote a query that should only return the batches used by the ProdBOM record. The lookup worked, but it didn't limit it to just the ProdBOM batch references. When I set a breakpoint on the overridden method, it is completely ignored when doing the lookup.
I went to the Microsoft site looking for answers, and decided to try overriding the lookup method on the control itself. I placed the same code in the overridden lookup method of the form control with one minor modification (in the field lookup method, the form control is passed as a parameter to the method and when invoking the SysTableLookup object you need to pass that parameter, in the control lookup, the control is calling the method so you pass the control as this when invoking SysTableLookup.) When I placed the code in the control lookup override, it worked exactly as I expected it would work in the field lookup override.
Does anyone know why one override works and the other doesn't? Or more to the point, why is the field lookup method being ignored?
Thanks.
Brandt
*This post is locked for comments