We have Operations set up so that the production manager can assign jobs to pickers based on the first operation.
I am trying to write a BAQ that will return the first Operation in a job.
Does anyone know what the code might look like to show only the first OpSeq in each job?
This is just a “catch-all” for jobs that do not start with OpSeq 10.
It is working now, for the most part!
I added all the other columns back in and the results were the same until I tried to add the OpCode back and it showed all of the Operations in each job again.
On the join to JobOper can you select FIRST EACH or LAST like in Epicor 9.
Selecting FIRST would be a much better method than passing all the job operation records and picking the first one for performance reasons.
Assuming you need to display data from both the JobHead and JobOper tables I would suggest this:
Create an Inner subquery using just the JobOper table.
Select jobNum to display and check group by
Create a calculated field as suggested: MIN(JobOper.OprSeq)
Create a top level subquery with all the tables you wish to include
Add the subquery to the top level query
Join the subquery to the JobOper table on JobNum to JobNum and OprSeq to Calculated_OprSeq