Hello everybody,
today I want to write a few words about two types of buttons in Acumatica.
- usual form of declaration
- unusual form of declaration
What is difference from code prospecitve?
In the begining they are equal:
public PXAction<Shipment> CancelShipment;
Even very similar with attributes:
1.
[PXButton(CommitChanges = true)]
[PXUIField(DisplayName = "Cancel Shipment")]
2.
[PXButton]
[PXUIField(DisplayName = "Release")]
But different with declaration:
- protected virtual void cancelShipment()
- protected virtual IEnumerable release(PXAdapter adapter)
and different with last statement. Those with PXAdaapter should return adapter.get(); Like this:
[PXButton]
[PXUIField(DisplayName = "Release")]
protected virtual IEnumerable release(PXAdapter adapter)
{
...
return adapter.Get();
}
And one more. Unusual should be used when click on button initates background operation or is called from processing pages