Skip to main content

Hi I have seen many examples of PXAction being used in conjunction with PXAdapter to get the main DAC from the table the PXAction button is on.  This helps in getting calls from Process screens to an Action button.  So in my case the SOOrder Table is available and I need more.  Is there a way to get the SOLine current record as well using PXAdapter, in the same method the main DAC is accessible?   Keep in mind this is all for a process screen and needs to be Static: No Base or this or the like? 

Thanks in advance. 

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


Reply