Skip to main content

 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

 

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
}

 


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