As I wrap my brain further around the framework I’m starting to ask myself questions on the ‘why’ I am coding things the way that I’ve coding so I get better at all of this.
I’m not entirely certain what the first graph parameter of a PXSelect is being used for. I think I’ve read somewhere that I shouldn’t generate a generic PXGraph for the first parameter.
So, in this example, I can see how my soOrderEntry graph becomes the source of the query so that it will return the lines from the soOrderEntry record that it currently holds.
var lines = SelectFrom<SOLine>.
Where<SOLine.orderType.IsEqual<SOOrder.orderType.FromCurrent>
.And<SOLine.orderNbr.IsEqual<SOOrder.orderNbr.FromCurrent>>>
.OrderBy<Desc<SOLine.lineNbr>>
.View.Select(soOrderEntry);
But, in the case where I need to find, say, a warehouse code and I use:
INSite iNSite = INSite.PK.Find(this, siteID);
I’ve used ‘this’ because this code resides within a Graph Extension. This is a stand alone query so my question is, what is the purpose/relevance to what graph that I use for the INSite lookup?
Is it in relation to the cache of ‘this’ so that a subsequent call would potentially be more efficient?
Is there a disadvantage or an unintended consequence to calling:
INSite iNSite = INSite.PK.Find(soOrderEntry, siteID);
Best answer by Leonardo Justiniano
View original