Add button to grid in Acumatica

Hello everybody,

today I want briefly share how to add button to Grid in Acumatica. Actually button without any dialogs. Just button with posibility to run C# code.

Lets say you have grid, and want name for button Calculate. 

Then in graph you should write something like this:

public PXAction<PRPayroll> Calculate;
[PXButton]
[PXUIField(DisplayName = "Calculate")]
public virtual IEnumerable calculate(PXAdapter adapter)
{
   return adapter.Get();
}

And in grid something like this:

 <ActionBar ActionsText="True">
    <CustomItems>
        <px:PXToolBarButton>
        <AutoCallBack Command="Calculate" Target="ds" >
             </AutoCallBack>
       </px:PXToolBarButton>
     </CustomItems>
 </ActionBar>
</px:PXGrid>

And you'll get in your grid nice button Calculate. Enjoy

3 Comments

  • Prathyusha said

    I have to add a button on the screen and when I click it the Grid rows should be refreshed and new values should be saved in Database? Can you help me how to do that?

  • docotor said

    yes! At which screen you need to add button?

Add a Comment