I don’t think there’s an answer to this (it has been open on StackOverflow - https://stackoverflow.com/questions/70882006/passing-parameters-to-graphaction-in-acumatica-from-toolbar-button - for a little while with no luck, and I’ve looked as best I can at the code) but really hoping someone can either help or shut this idea down so I stop thinking it should be possible!
What we’re trying to do is create an toolbar button action that accepts parameters that the end user can determine without touching any code. We’ll then use those parameters in a class that is called by the action code.
As such, I have a Graph extension that defines a PXAction and PXButton. The C# method for the action accepts parameters and these show up in the action properties UI when “add existing action” is used. Having set up some values for the parameters (have tried data fields from the screen and hard coded values), published the customisation and refreshed everything, when the button on the screen is clicked and the method is debugged in VS those parameters are always null. Likewise the adapter properties (CommandArguments and Parameters) are also null/blank.
The fact that the UI is offering the parameters and knows their names is leading me to hang on to the thought that this should be possible but all testing and debugging into PXAction.cs etc suggests otherwise (the only thing that looks like it might ever pass parameter values is if Automation is involved and that’s something I haven’t touched yet).
I’m fairly new to Acumatica so still at the point of not knowing if the ideas we’re having are possible and we just need to learn more, or not possible and we should think of alternative approaches. If anyone can help either way that would be a benefit (i.e. a definitive “no that is not possible” helps almost as much as “sure, this is how you do it” !).
Thanks