是否可以在字段更新事件中访问连接表,而无需添加额外的查询来获取连接记录?
例如,一个如下所示的图表:
public class MyGraph : PXGraph<MyGraph>
{
public PXSelectJoin<Detail, InnerJoin<Header, On<Detail.hdrId, Equal<Header.id>>>> MyView;
public void _(Events.FieldUpdated<Detail.someField> e)
{
//TODO: find the Header record that is joined to the Detail record that fired this event?
/* Don't want the overhead of doing something like this:
Detail dtl = (Detail)e.Row;
Header hdr = PXSelect<Header, Where<Header.id, Equal<@P.AsInt>>>.Select(this,dtl.HdrId);
if(hdr != null)
{
//more code here.
}
*/
}
}
这是 22 R1 的。
蒂亚!
不。该事件是按缓存类型进行的,并且不了解我所知道的有关您的视图的任何信息。
PXSelect 标头将进入查询缓存,并且在第一次调用后仅使用缓存的结果,因此应该有很少的开销(如果通过键选择则更是如此)。