MES Work Queue

I’m trying to dial in the logic that Epicor uses to determine which items are listed on the “Active Work”, “Current Work”, “Available Work” and “Expected Work” tabs on the MES Work Queue. My goal is to construct a SQL Query to recreate this status.

I ran a trace and I can see what I’m looking for is calculated and returned as the RegionCode and RegionDescription as part of the WorkQueueDataset. Is there any way to see the actual SQL Epicor used to calculate this field so that I can recreate the SQL myself for a report that I’m working on?

If you’re trying to recreate this, why not just call the BO to do the work for you? It may use code to group the records.
If you are doing it with just a query, then you may need nested case statements or union of 4 selects. The help is pretty clear about the criteria for each ‘regioncode’:

  • Active operations are defined as operations that have already been started for the current user; these are jobs that have been selected in the Current, Available and Expected sheets, and for which activity has been started (user has clocked in on these operations).
  • Current operations are defined as operations that are scheduled for the selected resource group that are not yet started, but where previous operations for the job are complete.
  • Available operations are defined as operations scheduled for the selected resource group where a completed quantity exists from a previous job operation, making it possible to start work on the operation.
  • Expected operations are defined as operations scheduled for the selected resource group, but quantities have not yet been completed on previous operations.

The priority dispatch report has break out built in.


Hi David, I’m looking to also replicate the logic of the work queue via sql, did you ever find the code on how to do so?

Apologies if this doesn’t fit your reqs, but the trace below details the BO call, could you use the REST API to call this object and return the data as JSON?

  <localTime>20/12/2018 08:57:38:1176093 AM</localTime>
      <executionTime total="1714" roundTrip="1483" channel="215" bpm="0" other="16" />
        <parameter name="pcResourceGrpID" type="System.String"><![CDATA[SMT]]></parameter>
        <parameter name="pcEmpID" type="System.String"><![CDATA[SMITHB]]></parameter>
        <parameter name="pcwhereClauseWorkQueue" type="System.String"><![CDATA[]]></parameter>
        <parameter name="pcwhereClausePartWip" type="System.String"><![CDATA[]]></parameter>
        <parameter name="pageSize" type="System.Int32"><![CDATA[0]]></parameter>
        <parameter name="absolutePage" type="System.Int32"><![CDATA[1]]></parameter>
        <parameter name="morePages" type="System.Boolean"><![CDATA[False]]></parameter>
        <parameter name="LaborType" type="System.String"><![CDATA[]]></parameter>
        <parameter name="totalWorkQueueRecords" type="System.Int32"><![CDATA[0]]></parameter>
        <parameter name="clearCache" type="System.Boolean"><![CDATA[True]]></parameter>
        <parameter name="filterParameters" type="System.String"><![CDATA[]]></parameter>

Thanks Andrew, that most definitely helps. I was hoping to try in Sql, so that the dataset could be used for other dashboards, but this will be just as useful as well.

I am looking to do exactly this, use REST to get the work queue data using C# and the EpicorRest API but I am struggling with how to send the required information to the server to get the correct response. I wonder if @josecgomez would be willing to help with the proper way to do this?

When I send the following information using swagger, I get exactly what I am looking for. The question is how do I do it with the API?

Here is what is required for the BO:
“pcResourceGrpID”: “MSMILL02”,
“pcEmpID”: “10389”,
“pcwhereClauseWorkQueue”: “”,
“pcwhereClausePartWip”: “”,
“pageSize”: 0,
“absolutePage”: 0,
“LaborType”: “”,
“clearCache”: true,
“filterParameters”: “”

Any help is appreciated