Is it possible to access the joined table in a field updated event without having to add a loop so that you can access the PXResult<> object?
For instance, a graph that looks like this:
<code> 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;
foreach(PXResult<Header, Detail> res in PXSelectJoin<Detail, InnerJoin<Header, On<Detail.hdrId, Equal<Header.id>>>, Where<Detail.id, Equal<@P.AsInt>>>.Select(Base, dtl.Id)
{
Header hdr = res.GetItem<Header>();
//more code here.
}
*/
}
}
</code>
<code> 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;
foreach(PXResult<Header, Detail> res in PXSelectJoin<Detail, InnerJoin<Header, On<Detail.hdrId, Equal<Header.id>>>, Where<Detail.id, Equal<@P.AsInt>>>.Select(Base, dtl.Id)
{
Header hdr = res.GetItem<Header>();
//more code here.
}
*/
}
}
</code>
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;
foreach(PXResult<Header, Detail> res in PXSelectJoin<Detail, InnerJoin<Header, On<Detail.hdrId, Equal<Header.id>>>, Where<Detail.id, Equal<@P.AsInt>>>.Select(Base, dtl.Id)
{
Header hdr = res.GetItem<Header>();
//more code here.
}
*/
}
}
This is for 22 R1.
TIA!