Bill Blake
Bill Blake

Reputation: 104

Add Custom action to GI Mass Actions dropdown

I have extended the Shipments graph and have included 3 new actions. These 3 new actions are not listed in the Mass Actions dropdown of the Generic Inquiry page:

GI Mass Actions

I have compared the PXAction<> definition but have not been able to identify an attribute either in the Graph or in the ASPX to enable this option.

Is it possible to add custom actions to that dropdown?

Upvotes: 1

Views: 468

Answers (1)

Simon ML
Simon ML

Reputation: 1839

To make it available in the list, make sure you set the PXAction.IsMass flag to true

using PX.Data;

namespace PX.Objects.SO
{
    public class SOShipmentEntry_Extension : PXGraphExtension<SOShipmentEntry>
    {
        public override void Initialize()
        {
            MyAction.IsMass = true;
        }

        public PXAction<SOShipment> MyAction;
        [PXButton]
        [PXUIField(DisplayName = "My Action")]
        public void myAction()
        {
            throw new PXException("My action !");
        }
    }
}

Upvotes: 3

Related Questions