Skip to main content

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

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