User Description custom filed copy data create child order action click
Best answer by Rajginoya
View original
User Description custom filed copy data create child order action click
Best answer by Rajginoya
View originalcould you please elaborate on what are you trying to achieve for better understanding?
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.
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
}
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.