Skip to main content
Solved

Add custom field with link to document

  • November 27, 2020
  • 1 reply
  • 1050 views

SadokHanini
Freshman II

Hello 

I wanna add a custom field in invoice line (APTran) 
this custiom field will contain a number of shipment 
and i want it to be linked to the shipment .

 

Thanks :)  

Best answer by Naveen Boga

Hi @SadokHanini ,

To have a link field for the customization column in the APTran grid. Please refer the below sample action code. 


Extension Graph

public PXAction<ReRunSOSSaaSFilter> ViewSalesOrder;
        [PXUIField(DisplayName = "Sales Orders", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select, Enabled = true, Visible = false)]
        [PXButton(OnClosingPopup = PXSpecialButtonType.Refresh)]
        public virtual IEnumerable viewSalesOrder(PXAdapter adapter)
        {
            if (RunAddressyView.Current != null)
            {
                SOOrderEntry graph = PXGraph.CreateInstance<SOOrderEntry>();
                SOOrder objSOOrder = PXSelect<SOOrder, Where<SOOrder.orderNbr, Equal<Required<SOOrder.orderNbr>>>>.Select(graph, RunAddressyView.Current.OrderNbr);
                graph.Document.Current = objSOOrder;
                PXRedirectHelper.TryRedirect(graph, PXRedirectHelper.WindowMode.NewWindow);
            }
            return adapter.Get();
        } 

.aspx page

<px:PXGridColumn DataField="usrSOOrderNbr" LinkCommand="ViewSalesOrder" />
View original
Did this topic help you find an answer to your question?

1 reply

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3410 replies
  • Answer
  • November 27, 2020

Hi @SadokHanini ,

To have a link field for the customization column in the APTran grid. Please refer the below sample action code. 


Extension Graph

public PXAction<ReRunSOSSaaSFilter> ViewSalesOrder;
        [PXUIField(DisplayName = "Sales Orders", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select, Enabled = true, Visible = false)]
        [PXButton(OnClosingPopup = PXSpecialButtonType.Refresh)]
        public virtual IEnumerable viewSalesOrder(PXAdapter adapter)
        {
            if (RunAddressyView.Current != null)
            {
                SOOrderEntry graph = PXGraph.CreateInstance<SOOrderEntry>();
                SOOrder objSOOrder = PXSelect<SOOrder, Where<SOOrder.orderNbr, Equal<Required<SOOrder.orderNbr>>>>.Select(graph, RunAddressyView.Current.OrderNbr);
                graph.Document.Current = objSOOrder;
                PXRedirectHelper.TryRedirect(graph, PXRedirectHelper.WindowMode.NewWindow);
            }
            return adapter.Get();
        } 

.aspx page

<px:PXGridColumn DataField="usrSOOrderNbr" LinkCommand="ViewSalesOrder" />

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