I’m just wondering if a BAQ can do a file search to see if a file exists or not? I can do it in excel if I need to, but it would be slick in a BAQ,
Short answer, no… longer answer… if you create a function in SQL and call that function within your BAQ… then yes…(Maybe) but right tool / right job…
If I customize a dashboard could I do it in C#?
Absolutely
Heck you can even do it with an Updatable BAQ… now that I think about it… post Processing BPM on GetList set the value of a calculated field… something like
foreach(var x in ttResults)
{
x.MyCalculatedField= System.IO.File.Exists(x.FileLocationFromBAQField);
}
off to see the google!!
If I’m aggregating stuff on a job, (just looking to see if I’ve created the NC files), it probably won’t work that way though right? I need specific Assembly sequences for any BO to work wouldn’t I?
Back to the C# idea I think.
Not sure I follow…
An “Updatable” BAQ doesn’t have to have any actual updates. But it will execute the “GetList” code (C#) which can do some C# magic with your fields and populate some data’s
Something like this
Made a BAQ which looks at XFileRef table
Added a calculated Boolean called FileExits and set it to true
Made the BAQ Updatable and added PostProcessing Directive on GetList() which checks if file exists and assigns True/False to my calculated field.
Run BAQ
Sample BAQ
FileExists.baq (27.8 KB)
I attached the BAQ, have a look
For some reason it’s not changing the value. It just reads whatever I have in the calculated field.
Any idea why that would be happening?
What does the code look like?
Never mind, I forgot to check the enable check box, now it changes them all to false so, Now I have some file naming problems, but I think that has to do with mapped drives. I need to get the actual server name in there.
Fixed that now it works!!!
Thanks for your help. This will help me save a lot of time.
Here’s your Gold star for the day
Hey, Old thread I know, but I have a question on this. If you have a field being updated by a BAQ BPM, is there a way to filter by that result in the query? I want to use it for a baq gadget where there is no filtering so it needs to be done in the BAQ. The Subquery filter seems to run before the change of the field.
Thanks