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
Brandon,
That worked. Thanks for the tip.
Brandt
Of course the client must be closed. In fact shut down the AOS and the client, and delete the AUC files only then, just to be certain.
I was only suggesting AUC files.
Brandon,
Should I delete the AUC or clear the SysSQMSettings.GlobalGUID value as well?
Brandt
I've only seen this behavior when AUC files are corrupted. Have you deleted those?
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,151 Super User 2024 Season 2
Martin Dráb 229,963 Most Valuable Professional
nmaenpaa 101,156