Run Custom Action through Customization Code

I am still struggling with this issue. This is also related to another post:

The code looks straightforward, but returns an error:

		DynamicQueryAdapter dqa = new DynamicQueryAdapter(this.oTrans);
		DataTable results = new DataTable();
		dqa.BOConnect();
		string baqname = "ChangeOpenJobResGrpIDs";		
		dqa.RunCustomAction(baqname, "ChangeResGrpID", results.DataSet, true);
		LoadMyBAQwParam(baqname, epiUltraGridC1, "OldResGrpID", epiTextBoxC1.Value.ToString());
		dqa.Dispose();

The error is:

Object reference not set to an instance of an object.

The error occurs when processing the custom action line. I can’t seem to figure out the simple process of executing a custom action for a BPM from code. I have gone through dozens of iterations that didn’t work (I won’t bore you with them here). I assume someone else must have done this once before.

Any ideas are welcome!
Thanks!
Nate