BAQ to show the FIRST Operation on a Job

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.

1 Like

Does that help ?

Johnny

Unfortunately, no.
I might be missing something though.

Do not use Group By for the calculated field

I don’t think that is working.
I added the Calculated Field and the Syntax was OK, but it is just showing all the OprSeq’s.


It should work.

First delete everything between JobNum and MinOprSeq.

Test it just with those 2 fields, and then you may insert additional columns.

But additional columns will have to be aggregated somehow as well.

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.

Patrick Winter

I don’t think I have that option.
We are on version 10.1.400.13.

Try to do min of OpDesc as well

Assuming you need to display data from both the JobHead and JobOper tables I would suggest this:

  1. 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)
  2. 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
2 Likes

GREAT!
That worked perfectly.

Thank you so much.