Last date when BAQ was used

Hello,

I want to know which BAQs are no longer in use. Is there any way to know when was BAQ used last?

Binita

I wish! I was hoping the ice.QueryHdr table would have a hidden date
column but it didn’t when I queried the table in SQL. We’re SQL maybe if
you’re Progress it’ll have one.

Only thing I have found is to copy baq to name-old. Delete the Baq.
Wait for phone to ring. Restore if phone rings.

2 Likes

In our E10 system I created a Method Directive on the DynamicQuery.Execute that fires on all non-system BAQ runs that creates a record in the UD25 table which contains the QueryID, RunDate and ClientUserName,

Then I created a BAQ that does a count/group on that table.

I have not got around to re-creating this in our E9 system, it will require some custom code in the BPM which the E10 version does not require. But the flow is still all the same.

3 Likes

I will probably be writing it up in our E9 system so I will post that when its done, if somebody hasn’t done it already. I am pretty sure the BO has changed for DynamicQuery though, and the BPM will probably need to be fired on .Execute and .ExecuteByID in both E9 and E10.

Jason, that’s an awesome idea, I may have to make that BPM in our e10 system

1 Like

That’s really clever. I’m inspired to create the same – I can guess what’s in the Condition and Update Table by Query objects, but what’s contained within Invoke BO Method?

Many Thanks
Mark

Thank you Jason, that is very nice idea. I will try and see if I am able to do it on our E9 system. Please share if you are able to do it on E9.

Here is a quick run down of the BPM for Ice.DynamicQuery.Execute (Pre)

Global Variable for UD25Tableset (This can be any UDTable)

Condition 0 : Check if BAQ is a System BAQ or not. We don’t want to log System BAQs

Query for above condition statement

Invoke BO Method : Ice.UD25.GetaNewUD25 method (not sure what the difference between GetaNew and GetNew is) This is where we start to create the log record in UD25.

Parameters for first Invoke BO Method. This is where the variable for the UD25 tableset is originally created.

Next step is Update Table by Query

The query is just the ttDyanmicQuery table (Which is a copy of QueryHdr with current BAQ)

The mapping that is used to fill the myUD25 tabletset from the ttDynamicQuery table we are querying from. This is where we actually define what is in the log record in UD25

The final Invoke BO Method is the Ice.UD25.Update which updatse the UD25 table on the server with our temporary UD25 tableset that was modified in the previous action.

The parameters for the UD25.Update method. This is just the variable object tablset for UD25

3 Likes

Are you on 10.1 ? I don’t have invoke BO method.

That was on 10.1.500.8.

Last Used, No.
But you can see all the BAQ’s that were created, not used and the user is not longer enabled so the BAQ is useless: Create a BAQ on ‘Exports’ (that’s the BAQ Header table in E9) and UserFile, where Exports.IsShared = False and UserFile.Disabled = true with an Inner Join on DcdUserID.
For one client we found over 700 BAQ’s like this. They had allowed several users have access to BAQ and they had a lot of turnover.

If you have enabled tracking of System Activities then you can also join Exports and SysActivityLog on TableName = Exports and ActivityType = Updated or Created. The SysActivityLog has an Activity date that can tell you when the BAQ was either created or last changed.