Solved

How to add an action to a grid without modifying the aspx?

  • 2 August 2022
  • 4 replies
  • 260 views

Userlevel 2
Badge

Hi,

How to add an action to a grid without modifying the aspx?

 

Thanks,

EV

icon

Best answer by Leonardo Justiniano 2 August 2022, 17:02

View original

4 replies

Userlevel 7
Badge +5

You can add the action using the screen editor and thus avoid touching the .aspx file directly. 

What have you done so far?

Userlevel 6
Badge +4

Hi @edsonvelez64 

There is not other way but to add a piece of aspx code to the page:

<px:PXGrid  .....>   
<ActionBar>
<CustomItems>
<px:PXToolBarButton Text="Grid Action" DependOnGrid="gridThings">
<AutoCallBack Target="ds" Command="GridAction">
<Behavior CommitChanges="True" ></Behavior>
</AutoCallBack>
</px:PXToolBarButton>
</CustomItems>
</ActionBar>
</px:PXGrid>

This assumes you have an PXAction defined like:

public PXAction<MYThings> GridAction;
[PXUIField(DisplayName = Messages.Thing, Enabled = true)]
[PXButton(CommitChanges = true)]
protected virtual IEnumerable gridAction(PXAdapter adapter)
{
return adapter.Get();
}

Hope this helps

Userlevel 2
Badge

Hi,

Ok thanks. What happens if someone need to add a new action to a page in another customization project?  

 

Thanks,

EV

Userlevel 6
Badge +4

Hi @edsonvelez64 

 

Normally Acumatica merge the code when publishing. When 2 or more customizations are touching same objects a warning / error message is thrown. You have to use Level attribute on the customization package to tell Acumatica which package has priority over another.

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved