If the adapter is coming from an action of a particular graph, you can cast adapter.View.Graph
as the graph type:
var orderGraph = adapter.View.Graph as SOOrderEntry;
Once you have a graph, you can use it the way you normally would use Base:
SOOrder order = orderGraph.Document.Current;
var lines = orderGraph.Transactions.Select();
SOLine line = orderGraph.Transactions.Current;
For example:
public virtual IEnumerable Test(PXAdapter adapter)
{
var orderGraph = adapter.View.Graph as SOOrderEntry;
SOOrder order = orderGraph.Document.Current;
if (order is null) return adapter.Get();
var lines = orderGraph.Transactions.Select();
SOLine line = orderGraph.Transactions.Current;
// do stuff
return adapter.Get();
}
@edwardmcgovern97 Can you please share the code of your processing screen and let us know what you want to try to achieve by modifying code so that it will be helpful for us to review and suggest the best solution?
Hey Naveen,
No need Daryl nailed it.
I was use to grabbing the main table from adapter.Get like below:
foreach (RSSVWorkOrder order in adapter.Get()) { list.Add(order); }
But never accessed other tables in my actions. I needed to grab several layers from the Order Entry Screen and now that I know where the graph is in PXAdapter thats not an issue.
But thanks anyway