how to run predefined query as a job?

Hello, I would like to run a predefined Product Builder query (PBAQuery*) as an AOT job in AX2009. Does anyone have any code to accomplish this? The PBA queries are not under the AOT Query selection. Thank you, Kevin

You can write job as follows:

Query query = new Query();

QueryRun queryrun = new QueryRun(queryStr(PBAQuery*));

while (queryrun.next())

{

// your code

}