Solved

How to add custom Action Buttons into GI Mass Action

  • 19 January 2023
  • 2 replies
  • 397 views

 Hello,

I made a Custom Screen that has two Action Buttons

I want that these Action Buttons appear into my GI screen in Mass Actions but I dont know how

 

 

Both buttons have the same structure

#region Actions
public PXAction<USRCBVCVacations> Approve;
[PXButton(CommitChanges = true, Category = "Processing")]
[PXUIField(DisplayName = "Approve")]
protected virtual IEnumerable approve(PXAdapter adapter)
{
USRCBVCVacations vacations = Vacation.Current;

USRCBVCVacationsEntry graph = PXGraph.CreateInstance<USRCBVCVacationsEntry>();

PXLongOperation.StartOperation(this, delegate ()
{
vacations.Status = Vacations.Helper.Constants.Status.Approved;
graph.Vacation.Update(vacations);
graph.Actions.PressSave();

});

return adapter.Get();
}
#endregion

 

icon

Best answer by davidnavasardyan09 12 May 2023, 22:24

View original

2 replies

Userlevel 5
Badge +1

try to create a constructor. Inside this constructor, set the property 'IsMass' to 'true' for the action. It should look something like this.

 

    public class USRCBVCVacationsEntry : PXGraph<USRCBVCVacationsEntry>
{
#region Selects
public PXSelect<USRCBVCVacations> Vacation;
#endregion

#region ctor
public USRCBVCVacationsEntry()
{
Approve.IsMass = true; // <-
}
#endregion

#region Actions
public PXAction<USRCBVCVacations> Approve;
[PXButton(CommitChanges = true, Category = "Processing")]
[PXUIField(DisplayName = "Approve")]
protected virtual IEnumerable approve(PXAdapter adapter)
{
USRCBVCVacations vacations = Vacation.Current;

USRCBVCVacationsEntry graph = PXGraph.CreateInstance<USRCBVCVacationsEntry>();

PXLongOperation.StartOperation(this, delegate ()
{
vacations.Status = Vacations.Helper.Constants.Status.Approved;
graph.Vacation.Update(vacations);
graph.Actions.PressSave();

});

return adapter.Get();
}
#endregion
}

 

Badge +11

Try adding the [PXMassAction] attribute into the action definition:

 

public PXAction<USRCBVCVacations> Approve;
[PXButton(CommitChanges = true, Category = "Processing")]
[PXMassAction]
[PXUIField(DisplayName = "Approve")]
protected virtual IEnumerable approve(PXAdapter adapter)
{
//...
}

 

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