Solved

Add all relevant operation lines to Move screen AM302000 after updating Production Order Nbr

  • 25 March 2024
  • 4 replies
  • 36 views

Userlevel 4
Badge

Hi,

A client is wanting to be able to add all the BOM operation lines related to the production order they have added into the grid on the Move screen (AM302000). For example, if they were to add a new line and select Production Order PO1234, they would like all the relevant lines to appear, rather than manually adding in a row for each record they want to process.

The code below is how I have tried setting it up, but all it does is make the screen load for ages and I am not sure why that is happening.

This is the process I am trying to enable using the code below:

  1. Add a new row to the grid and select a Production Nbr.
  2. Once this has been selected, all BOM operations associated with this order are added underneath.
  3. If there are any records that are not needed, remove them from the grid.
  4. Repeat these steps for any other Production Orders.

 

Here is the code I have so far. What would be the best way to structure this?

protected void AMMTran_ProdOrdID_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
{

var row = (AMMTran)e.Row;

if (row == null || string.IsNullOrEmpty(row.ProdOrdID))
{
return; // Exit if the ProdOrdID is null or empty
}

var selectOperations = new PXSelectJoin<AMBomOper,
InnerJoin<AMProdItem, On<AMBomOper.bOMID, Equal<AMProdItem.bOMID>>>,
Where<AMProdItem.prodOrdID, Equal<Required<AMProdItem.prodOrdID>>>>(this.Base);

List<AMMTran> transactionsToAdd = new List<AMMTran>();
foreach (AMBomOper bomOper in selectOperations.Select(row.ProdOrdID))
{
AMMTran newLine = (AMMTran)cache.CreateInstance();
newLine.ProdOrdID = row.ProdOrdID;
newLine.InventoryID = row.InventoryID;
newLine.OperationID = bomOper.OperationID;

cache.Insert(newLine);
}

 

Let me know if I can clarify anything about the information above.

 

Kind regards,

Andrew

icon

Best answer by angierowley75 25 March 2024, 12:08

View original

4 replies

Userlevel 7
Badge +3

Reporting the quantity complete on the last operation will assume all prior operations have completed the same quantity - what is the business case for creating a move line for each operation?

Userlevel 4
Badge

Hi Angie,

Thanks for your response. I just did the below in a test environment to see what happens. The operation included here is the last one from the Production Order.

Is there a way to check that the previous lines have been processed, or has this been handled behind the scenes and we can assume it has been processed correctly?

The reason the client wanted to have each line was because they wanted to process each step that was completed. But if this isn't required and they can just add the last step, it would make their lives much easier.

Kind regards,

Andrew

 

Userlevel 7
Badge +3

On the Events tab of the Production order, they can look at the relate cost and inventory transaction which were triggered by the final move of the production item on the last operation.

Userlevel 4
Badge

Angie, you are a gem, thanks so much for your help on this! This process is exactly what they need, and so much more efficient than what I was trying to make the system do.

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