Solved

How to copy custom field creating child orders action

  • 25 July 2023
  • 4 replies
  • 102 views

Userlevel 1
Badge

 

User Description custom filed copy data create child order action click

icon

Best answer by Rajginoya 27 July 2023, 11:44

View original

4 replies

Userlevel 7
Badge +4

could you please elaborate on what are you trying to achieve for better understanding?

Userlevel 1
Badge

could you please elaborate on what are you trying to achieve for better understanding?

When user clicks “create child order” action on the sales order screen. The “User Description” field from the sales order needs to be pre-populated on the sales order screen details tab.

Userlevel 1
Badge
public class SOOrderEntry_Extension : PXGraphExtension<PX.Objects.SO.SOOrderEntry>
{
#region Event Handlers

public SelectFrom<SOLine>.View SolineView;

protected void _(Events.RowUpdated<SOLine> e)
{
SOLine row = e.Row;
SOLine oldrow = e.OldRow;
if (row !=null)
{
if (row.BlanketNbr == null)
return;
SOLineExt solineext = row.GetExtension<SOLineExt>();
SOLineExt oldsolineext = oldrow.GetExtension<SOLineExt>();
if (oldsolineext.UsrUserDescription == null && solineext.UsrUserDescription == null)
{
if (row.BlanketNbr != null)
{
var SolineItems = SolineView.Select()
.Where(item => item.GetItem<SOLine>()
.OrderNbr == row.BlanketNbr).Where(item => item.GetItem<SOLine>()
.LineNbr == row.BlanketLineNbr);
foreach (SOLine line in SolineItems)
{
if (line.LineNbr == row.BlanketLineNbr)
{
solineext.UsrUserDescription = line.GetExtension<SOLineExt>().UsrUserDescription;
}
}
}
}
}

}
#endregion

}

 

Userlevel 7
Badge

Thank you for sharing your solution with the community @Rajginoya!

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