BKS Active Record Getting Table Class With Table Name String

Hi Everyone,
I’m having a little trouble putting my thoughts together, but I’m hoping you guys can give me some help on this. I am hoping that there is a method in active record that allows me to give it a table name and have it return to me an instance of that table as ActiveRecord.Base. From there I have written a method that grabs the field names and values as a JSONItem.
I need this because I am trying to write a method that allows the user to group records from the database by specific fields. I want to allow them to group by fields from related tables. So to make this modular I need to be able to get the field value pairs from the table without knowing ahead of time which table this will be.

Hopefully that makes sense…
Thanks in advance,
Sean O.

I don’t think you’ll want to use ActiveRecord. Seriously. It’s not a great fit for your use case.

AR uses tables and views that are static. Doing something on the fly like you want is pretty much akin to rewriting the entire AR framework.