Friday, December 5, 2014

Next Routing Sequence for Work Orders in Dynamics GP

I was asked to create a SmartList using SmartList Builder, which, among other things, would show the next Routing Sequence for Work Orders.  The client wanted the Work Center Description and not the Sequence Number.

In the end I had to nest a query within a nested query to get the required results.  Here is the core of the query - feel free to use it in your own endeavors:

Select A.MANUFACTUREORDER_I,WR.RTSEQDES_I
From WR010130 WR
inner join
(Select MANUFACTUREORDER_I,MIN(RTSEQNUM_I) Sequence from WR010130 where DONECB_I !=1 Group by MANUFACTUREORDER_I) A
on WR.MANUFACTUREORDER_I = A.MANUFACTUREORDER_I
and WR.RTSEQNUM_I = A.Sequence  

No comments:

Post a Comment