Skip to main content
Solved

How to copy custom field creating child orders action ?

  • Jul 25, 2023 10:17 AM UTC
  • 5 replies
  • 231 views
  • Translate All

Forum|alt.badge.img

User Description custom filed copy data create child order action click

 

Best answer by Rajginoya

@Rajginoya Have you tried with the InventoryID field updated event and verified?

 

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

5 replies

Naveen Boga
Captain II
Forum|alt.badge.img+20
  • Captain II
  • Jul 25, 2023 10:54 AM UTC

Hi @Rajginoya  Blanket Order and its Child Order reference details are available in the SOBlanketOrderLink table.

 

For the above requirement, Please write a simple query to check if this line belongs to child Order or not, if yes, you can fetch the User Description from the Blanker Order line and assign it to the Child Order line.

 

 

Translate

Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • Jul 25, 2023 11:28 AM UTC

  

Translate

Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • Jul 25, 2023 11:29 AM UTC

Hi @Rajginoya  Blanket Order and its Child Order reference details are available in the SOBlanketOrderLink table.

 

For the above requirement, Please write a simple query to check if this line belongs to child Order or not, if yes, you can fetch the User Description from the Blanker Order line and assign it to the Child Order line.

 

 

Which Event Call?

Translate

Naveen Boga
Captain II
Forum|alt.badge.img+20
  • Captain II
  • Jul 25, 2023 12:56 PM UTC

@Rajginoya Have you tried with the InventoryID field updated event and verified?

 

Translate

Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • Answer
  • Jul 27, 2023 9:44 AM UTC

@Rajginoya Have you tried with the InventoryID field updated event and verified?

 

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