Search code examples
c#acumaticaacumatica-kb

Acumatica Add new button to screen


In my acumatica customisation project . I want to add a new button in Vendor edit screen . I added the below code in graph .

namespace TestcustomPlugin
{
    public class VendorMaint_Extension : PXGraphExtension<VendorMaint>
    {
        public static bool IsActive() => true;

        public PXAction<Vendor> TestBtnCheck;
        [PXButton]
        [PXUIField(DisplayName = "Test Check")]
        protected virtual IEnumerable testBtnCheck(PXAdapter adapter)
        {
            return adapter.Get();
        }

        public delegate void PersistDelegate();
        [PXOverride]
        public void Persist(PersistDelegate baseMethod)
        {
            baseMethod();
           throw new PXException("Saved!".ToString());
        }
    }
}

but after publish the button is not visible there . But when i added the button same way to customer screen it came there and worked . Why ?


Solution

  • The underlying VendorMaint graph shows other button Actions using the VendorR DAC:

    public PXDBAction<VendorR> viewBusnessAccount;
    

    Please try:

    public PXAction<VendorR> TestBtnCheck;