Noticed that when you set a context variable to a window, and then you search for another record using the same window, that setted variable (related to previous record) stays there. And it shouldn't.
How to reproduce:
1) Create sales order A (price list X)
2) Create sales order B (price list Z)
1) Open sales order A and add a line with product Elm Tree
2) Go back to main tab, search (toolbar icon) for sales order B and try to add product Elm Tree. Price is incorrect (getting from price list X of sales order A!
This would be the patch to implement the latest suggestion (run always callouts on key records):
Hi , your patch work.
but why you think "I'm not sure if that can be done with window event validator"?
maybe reason callout flexible than event, callout can be done by script but event validator isn't.
Yep, question is for example how to load context variables when you navigate to a record using window event validator? Is that possible with what we have actually?
just for read/write context variable, i see no problem. event handle do in same thread, and you can pass anything with WindowValidatorEvent (gridTab, Grid field,...)
To implement my own recommendation above:
> Running read-only callouts (callouts that don't change values, but maybe just load
> context variables) could be safe on completed documents