Passing data from Class to Form and back to Class

I have a RunBaseBatch class (Class A) that, when ran, opens a dialog. In that dialog, I have a custom button, that when clicked, opens a Form (Form A). I am able to pass the query form Class A to Form A to manipulate a grid’s data source because I can access Class A via element.args().caller().runbase(). All is well so far. I also have another grid which has a data source is a temporary table. When I add records in Form A to this grid, I would like to save the data and pass it back to Class A. I figured I would simply do this by pass the data source back to the class in Form A’s closeOK() method (which gets automatically called when the OK command button is clicked) using a custom parameter method but that did not work…

While debugging this, I put a break point in the closeOk() method in Form A. The parameter method was being called and it stepped into Class A and assigned the variable the value. Yet when Form A was closed and I am back in the RunBaseBatch dialog (form Class A), I click on the OK button and whatever is in Class A’s run() method get processed but the values of the parameters I had passed while in Form A were all null!

I want to be able to pass the data from the temporary table (or any object in Form A) in Form A back to Class A and iterate through its records, preferably using the queryRun way. How can I do this? What am I missing?

Thank you