Question

Trying to write a Process screen that updates SOLine using the order entry screen. It only updates lines selected by the user

  • 5 September 2023
  • 3 replies
  • 81 views

Userlevel 3
Badge

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)

 

 


3 replies

Userlevel 6
Badge +3

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

Can you show us a bigger piece of your code?

 

Userlevel 3
Badge

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();
            
        });
    }

Userlevel 6
Badge +3

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


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved