Skip to main content
Solved

Disable an action button.


Michael Ndungi
Varsity I
Forum|alt.badge.img

Hello everyone,
I need to set the VOID button disabled if the specified document type eg check has been reconciled.

Upon reconciliation the Reconciliation checkbox is marked as true.
I need to disable the Void button on checks and payment if that certain doc has been reconciled(Reconcile = True).

Kindly assist on this.
All responses will be highly appreciated.
Thank you all
 

Best answer by Vignesh Ponnusamy

Hi @development93,

You can disable the action in the RowSelected event. Below is an example, 

    public class APPaymentEntry_Extension : PXGraphExtension<PX.Objects.AP.APPaymentEntry>
    {
        #region Event Handlers

        protected void APPayment_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected baseHandler)
        {
            baseHandler?.Invoke(cache, e);
            var row = (APPayment)e.Row;
            CAReconEntry.CATranExt ReconcileCheck = PXSelect<CAReconEntry.CATranExt,
                Where<CAReconEntry.CATranExt.origRefNbr, Equal<Required<APPayment.refNbr>>>>
                .Select(Base, Base.Document.Current.RefNbr);
            if (ReconcileCheck != null && ReconcileCheck.Reconciled == true)

            {
                Base.voidCheck.SetEnabled(false);
            }

        }
        #endregion
    }

 

The above query is to fetch CAReconEntry.CATranExt based on the Check and Payments RefNbr, you can update the query and condition below it to match your requirements.

Thanks, 

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

2 replies

Vignesh Ponnusamy
Acumatica Moderator
Forum|alt.badge.img+5

Hi @development93,

You can disable the action in the RowSelected event. Below is an example, 

    public class APPaymentEntry_Extension : PXGraphExtension<PX.Objects.AP.APPaymentEntry>
    {
        #region Event Handlers

        protected void APPayment_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected baseHandler)
        {
            baseHandler?.Invoke(cache, e);
            var row = (APPayment)e.Row;
            CAReconEntry.CATranExt ReconcileCheck = PXSelect<CAReconEntry.CATranExt,
                Where<CAReconEntry.CATranExt.origRefNbr, Equal<Required<APPayment.refNbr>>>>
                .Select(Base, Base.Document.Current.RefNbr);
            if (ReconcileCheck != null && ReconcileCheck.Reconciled == true)

            {
                Base.voidCheck.SetEnabled(false);
            }

        }
        #endregion
    }

 

The above query is to fetch CAReconEntry.CATranExt based on the Check and Payments RefNbr, you can update the query and condition below it to match your requirements.

Thanks, 


meganfriesen37
Captain II
Forum|alt.badge.img+12

Hi, you may want to check out these related items:

 

The first one, I have already provided a suggestion around how to restrict this access and the second one it an idea request to add this feature as a stock item.

https://community.acumatica.com/ideas/remove-or-secure-the-ability-to-void-a-cleared-check-9648

 


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