Hi
I want to use the results of a BAQ inside a BPM (PO.Update method). I think that I can use the DyamicQuery BO to call an existing BAQ. The BAQ will return a set of data (or not) and then I want to see whether the PO and Line are present in that data and do something if they are not. I can use the GetByID method to link to the BAQ but I’m not sure how to get the resulting data out? Any thoughts?
Do a trace on running your baq and replicate that in your BPM.
Search the forum for DynamicQuerySvc and you should find some examples
you can search to find your matched record in the BPM class without the need to use DynamicQuery, can i ask why have you decided to do your requirement this way ?
This is a cross company BAQ.
What I want to do is take the PO number and line (from the company where the BPM is running) and then find the job from the other company that has those numbers in the UD fields JobHead.PO_c and JobHead.POLine_c
I then want to look at the status of that job and decide on what to do based on that status. I thought that I could only access the one company from a BPM?
You can access any company from a BPM
OK. I’ll give that a go …
Yes, the BAQ is cross company and works a treat when it is run from the BAQ form but I want to run it from within a BPM:
When a user changes a PO line (specifically either changes the Qty or the due date). The BPM needs to check the “Linked” Job in the other company to see whether it has been released etc and then stop the changes from happening in that scenario. I’ve written the Intercompany BAQ so that it finds POs where the changes are allowable. Now I want to call that BAQ from within the BPM and see whether the results include the PO/Line which is about to be modified. I could also put Parameters on the BAQ for PO and Line and see whether the BAQ returns anything at all to the BPM. But I don’t know how to do either.
Does the user running the BAQ (not you) have access to that company under Company Maintenance? If there’s security on the BAQ, does the user have access?
Yes they do but I can’t get it running under my log in anyway. I’m sure I’m missing something but I don’t know what …
OK I tried that but I’m getting a syntax error:

MyPONum and MyPOLine are integer variables in the BPM and JobNum is a string variable in the BPM
It’s ExecutionParameter, not ExecuteParameter
Also, in BPm you can use Ctrl+space to get some auto-complete going for you. That will help with this type of coding.
Thanks - I just saw my typo as well…
Hey - It works 
Thanks so much for the code Brandon - Still don’t full understand it but it is getting what I need!
Yeah it loads those assemblies super slow. It’s always fun waiting for the list to populate!
Curse that list! Be gone with it! @Bart_Elia





