Is Production order still busy/active, can I filter on this?

ajhvdbajhvdb Member Posts: 672
I'd like to show which production orders are "busy".

Most PO's are busy for about 3 weeks. For example; Start date = 1-1-09, End date 21-1-09

Is there a filter for this? I'd like to ask "Which PO's are still busy on the following days; 7-1-09..12-1-09"

It is working now by using the table "date" but with a key and a filter it will be much faster. Now i'm looping through all records. Thx.

Comments

  • garakgarak Member Posts: 3,263
    u can use the compination of

    setfilter("Starting Date",'<=%1',SelectedDay);
    setfilter("Ending Date",'>=%1',SelectedDay);

    and also the other Date filter combinations or you set the the filter on Date Rec with filtergroup(2). Then you loop throught all released Prod. Orders and store all Prod. order which are in the filter in a temp Table and show them.

    fast example
    DateRec.filtergroup(2);
    DateRec.setrange("Period Type",DateRec."Period type"::Day);
    DateRec.setrange("Period Start",StartDateVar,EndDateVar);
    DateRec.filtergroup(0);
    
    RelProdOrders.reset;
    //some filtercriterias
    RelProdOrders.setrange(SomeFields);
    
    if RelProdOrders.findset(false,false) then begin
      repeat
        //here filter <=%1 / >=%2 and >=%1 / <=%2 and so on .... for "Starting Date" and "Ending Date"
        DateRec.setfilter("Period Start",'<=%1&>=%2',RelProdOrders."Starting Date",RelProdOrders."Endinging Date");
        if not DateRec.isempty then begin
          TempRelProdOrder.init;
          TempRelProdOrder.Fields := RelProdOrder.Field;
          TempRelProdOrder.insert;
        end;
      untli RelProdOrders.next = 0;
    end; 
    
    Do you make it right, it works too!
  • ajhvdbajhvdb Member Posts: 672
    Thx for the example. Yes I'm using the daterec too. This does work but I need to loop thru all the PO records.

    I'd like to set filters on the PO and only get the PO records, busy/active during this filter period (010109..210109). It is possible if I use 1 day in the filter but from/untill doesn't work.
Sign In or Register to comment.