How To Pass Data Into Processing Method With Help Of Lambda Expression
Hello everybody,
today I want to leave a short note on how to pass some additional parameters into Processing method of processing page with help of lambda expression. Syntax is pretty simple:
public class SSShipmentDateResetter : PXGraph<SSShipmentDateResetter> { public PXFilter<ShipmentFilter> ShipmentFilter; public PXFilteredProcessing<SOShipment, ShipmentFilter> ShipmentsForProcessing; public SSShipmentDateResetter() { var shipmentFilter = ShipmentFilter.Current; ShipmentsForProcessing.SetProcessDelegate(shipments => { ResetDate(shipmentFilter, shipments); }); } public static void ResetDate(ShipmentFilter filter, List<SOShipment> shipments) { } }
for me such approach is a bit easier to use as it involes a bit less amout of typing.
If you want to have even simpler syntax, then following sample also may work for you:
public SSShipmentDateResetter() { var filter = ShipmentFilter.Current; ShipmentsForProcessing.SetProcessDelegate(shipments => ResetDate(filter, shipments)); }
For simplicity sake, I've showed only constructor.
Ready to Simplify Your Acumatica Development?
If you found this approach helpful, imagine what custom solutions tailored to your business could do! Whether you're looking to fine-tune your Acumatica setup or need advanced customization, we’re here to help. Leave a request for a personalized development solution, and let’s make your Acumatica experience even more seamless and efficient.
Don't hesitate—reach out today for your custom needs!