Skip to main content

So It is really a process for the SOLine Table not the SOOrder table.  But the main DAC of the soOrderEntry screen is the SOOrder. If I am using the soOrderEntry screen to update the record then I can only pass the SOOrder record and the SOOrderEntry graph to the delegate.  

How do I communicate the soLines to update as well that were selected on the Process Screen if set process delegate only allows one DAC as Below? 

SOOrder.SetProcessDelegate( delegate(SOOrderEntry graph, SOOrder order)

 

 

SOOrder.SetProcessDelegate doesn’t look valid for me at all.

Can you show us a bigger piece of your code?

 


The code would be something like this see question in bold: 

 

 public PXProcessingJoin<SOOrder, InnerJoin<SOLine, On<SOOrder.orderType.IsEqual<SOLine.orderType>.And<SOOrder.orderNbr.IsEqual<SOLine.orderNbr>>>
            , InnerJoin<SOLineSplit, On<SOOrder.orderType.IsEqual<SOLineSplit.orderType>.And<SOOrder.orderNbr.IsEqual<SOLineSplit.orderNbr>>.And<SOLine.lineNbr.IsEqual<SOLineSplit.lineNbr>>>> 
            >, 
            Where<SOOrder.status.IsEqual<
            SOOrderStatus.open>.And<SOOrder.orderType.IsEqual<SOOrderTypeConstants.salesOrder>>.And<SOLineSplit.isStockItem.IsEqual<True>>.And<SOLineSplit.isAllocated.IsEqual<True>>>> orders;

    
    public SOOrderEntry_Process()
    {
       orders.SetProcessCaption("MyProcess");
       orders.SetProcessAllCaption("MyProcess All");
       orders.SetProcessDelegate<SOOrderEntry>(
        delegate (SOOrderEntry graph, SOOrder order)
        {

            graph.Clear();
            var graphext = graph.GetExtension<SOOrderEntry_Extension>();
           

            // line below and spt would be the SOLine and SOLineSplit structures

            // I get the SOOrder from the delegate call (graph and DAC passed)  

            // how to get the line and spt? 

            graphext.Test(order, line, spt, false);

            //graph.Actions.PressSave();
            
        });
    }


You can query the lines ans splits, for example:

var lines = SelectFrom<SOLine>
.Where<SOLine.orderType.IsEqual<@P.AsString>.And<SOLine.orderNbr.IsEqual<@P.AsString>>>
.View.Select(graph, order.OrderType, order.OrderNbr)
.RowCast<SOLine>()
.ToList();

Or, if you don’t need the orders at all, you can modify your PXProcessing like this:

public PXProcessingJoin<SOLine, InnerJoin<SOOrder, On<SOOrder.orderType.IsEqual<SOLine.orderType>.And<SOOrder.orderNbr.IsEqual<SOLine.orderNbr>>>
, InnerJoin<SOLineSplit, On<SOOrder.orderType.IsEqual<SOLineSplit.orderType>.And<SOOrder.orderNbr.IsEqual<SOLineSplit.orderNbr>>.And<SOLine.lineNbr.IsEqual<SOLineSplit.lineNbr>>>>
>,
Where<SOOrder.status.IsEqual<
SOOrderStatus.open>.And<SOOrder.orderType.IsEqual<SOOrderTypeConstants.salesOrder>>.And<SOLineSplit.isStockItem.IsEqual<True>>.And<SOLineSplit.isAllocated.IsEqual<True>>>> orders;

and your process will be something like this:

 orders.SetProcessDelegate<SOOrderEntry>(
delegate (SOOrderEntry graph, SOLine line)
{.....

 


Reply