Skip to main content
Solved

How to copy custom field creating child orders action

  • Jul 25, 2023 6:32 AM UTC
  • 4 replies
  • 164 views
  • Translate All

Forum|alt.badge.img

 

User Description custom filed copy data create child order action click

Best answer by Rajginoya

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

}

 

View original

4 replies

RohitRattan88
Acumatica Moderator
Forum|alt.badge.img+5
  • Acumatica Moderator
  • Jul 25, 2023 3:18 PM UTC

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

Translate

Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • Jul 26, 2023 7:03 AM UTC

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.

Translate

Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • Answer
  • Jul 27, 2023 9:44 AM UTC
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

}

 

Translate

Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • Jul 27, 2023 8:40 PM UTC

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

Translate