I am creating a BPM that will check to see if there are any attachments on the GLJrnDtl before it posts. I have figured out the relationship between XFileAttch and GLJrnDtl (Key1 = COACode, Key2 = FiscalYear, Key3 = JournalCode, Key4 = JournalNum, Key5 = JournalLine). I am doing a Pre-Processing on GLJrnGrp.CheckBeforePost. Does anyone know how to check the most recent GL Group with an attachment without using code? If this method had temp tables i could easily do it.
Use “designed query has x rows” in a condition?
So i was using that, but there is no way for me to check for the most recent record. It is BAQ lite as I like to call it.

Link bewteen xfileattch and gljrndtl
Company = Company
Key1 = COACode
Key2 = FiscalYear
Key3 = JournalCode
Key4 = JournalNum
Key5 = JournalLine
Link between xfileattch and xfileref
Company = Company
XfileRefNum = XFileRefNum
Ah, but there is. There are examples out here on the forum to create the BAQ. Here’s a great example from @Banderson:
Do you have an example of someone doing one from a BPM? I have done them in a normal BAQ before, but to my knowledge it is light version of BAQ designer. I cannot make custom fields or anything. I cannot even change short order.
Agree the baq designer inside the bpm condition is very minimal.
I’m still not 100% clear what you are trying to do. Why do you need to know what other groups have attachments when you are posting “this” group?
Oh, sorry. What I would do is an Invoke BO Method (Dynamic Query) to call the BAQ and then use the result set (count) for your condition.
But Alisa asks a good question. The TableSet for the posting transaction will have an attachment table in it, and I think you can check the count on that. I’m on Kinetic so the TableSets are Datasets now.
I don’t care about any other groups only the current group. I only need to check for this group, but unlike most methods this one does not have any temp tables tied to it. Unless I am thinking about it wrong, it will just check to see if there has ever been any attachments and if there has been it would return a row and make the condition obsolete.
Right but why is that not sufficient?
wont it always return true? or will it use some backend filtering to only check for the current group and not all groups? @aosemwengie1
No you should only be checking the current group. You can use a widget to set a variable to = the current group num, then use the = to a variable criteria on the table in your condition query, to only get the results for the current group.
how do i check the current group number when there are no temp tables. I have done it before when there were temp tables available, for JobNumbers or OrderNumber on other BPMs.
If you don’t have access to the data for the group, then maybe you need to put your BPM somewhere else?
I agree with Alisa. I had a pre-Post Group that would check to see if the person who added the Journal was also the person posting. If so, it would block the post since journals were required to be reviewed. I had access to the Posting User.
I went to the GLJrnGroupa and, like you, didn’t see those fields. Did you run a trace to find what business object actually runs the GL Group Post?
that is the one that does the check before it posts. I tossed one out there on update, but we will see if accounting is okay with that. We are testing it now.
