Solved

How to Make a custom field conditionally availabe.

  • 27 February 2021
  • 2 replies
  • 269 views

I want to make available a custom button field and a custom text field to be only available when  a given paymentmethod is selected.

 I want  the button “Process FEFT” and Text field Mobileno to be available only when TEMP paymentmethod is selected.


protected void ARPayment_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
{

var row = (ARPayment)e.Row;

if (Base.Document.Current.PaymentMethodID=="TEMP")
{


}
}

Thanks

icon

Best answer by Naveen Boga 28 February 2021, 06:38

View original

2 replies

Userlevel 7
Badge +17

Hi @doyuga ,

 

Here is the code:  

protected void ARPayment_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected InvokeBaseHandler)
        {
            InvokeBaseHandler?.Invoke(cache, e);
            var row = (ARPayment)e.Row;

            if (row != null)
            {                
             PXUIFieldAttribute.SetVisible<ARPaymentExtDACName.mobileNumberFieldName>(cache, row, row.PaymentMethodID == "TEMP");
             ButtonName.SetVisible(row.PaymentMethodID == "TEMP"); 
            }
        }

 

 

Hope this helps!!

Hi @doyuga ,

 

Here is the code:  

protected void ARPayment_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected InvokeBaseHandler)
        {
            InvokeBaseHandler?.Invoke(cache, e);
            var row = (ARPayment)e.Row;

            if (row != null)
            {                
             PXUIFieldAttribute.SetVisible<ARPaymentExtDACName.mobileNumberFieldName>(cache, row, row.PaymentMethodID == "TEMP");
             ButtonName.SetVisible(row.PaymentMethodID == "TEMP"); 
            }
        }

 

Hope this helps!!

 

Thanks @Naveen B  This sorted my issue.

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved