Skip to main content
Solved

How to Make a custom field conditionally availabe.

  • February 27, 2021
  • 2 replies
  • 291 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

Best answer by Naveen Boga

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!!

View original
Did this topic help you find an answer to your question?

2 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3410 replies
  • Answer
  • February 28, 2021

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!!


  • Author
  • Freshman I
  • 4 replies
  • February 28, 2021
Naveen B wrote:

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


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