Skip to main content
Solved

How to copy custom field creating child orders action


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
Did this topic help you find an answer to your question?

4 replies

RohitRattan88
Acumatica Moderator
Forum|alt.badge.img+4
  • Acumatica Moderator
  • 253 replies
  • July 25, 2023

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


Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • 17 replies
  • July 26, 2023
RohitRattan88 wrote:

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.


Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • 17 replies
  • Answer
  • July 27, 2023
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

    }

 


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • 2755 replies
  • July 27, 2023

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


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings