Blocked Production Orders and Qty. On Component Lines

poppinspoppins Member Posts: 647
Hi everyone,

I have an issue with the calculation of Qty. On Component Lines field displayed in the Item Card.

I checked in the Item table about that field, it is a flow field....The CalcFormula is:
Sum("Prod. Order Component"."Remaining Qty. (Base)" WHERE (Status=FILTER(Planned..Released),
Item No.=FIELD(No.),
Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),
Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter),
Location Code=FIELD(Location Filter),
Variant Code=FIELD(Variant Filter),
Due Date=FIELD(Date Filter)))

The problem is that I want to exclude the remaining quantities of the blocked production
orders from the calculation...

How can I do that???

Answers

  • MarkHamblinMarkHamblin Member Posts: 118
    You will have to add a "Blocked" field to component lines as well, and update it when the blocked field on the production order changes. You will then be able to use this field in the flow field's CalcFormula.
  • poppinspoppins Member Posts: 647
    You will have to add a "Blocked" field to component lines as well, and update it when the blocked field on the production order changes. You will then be able to use this field in the flow field's CalcFormula.
    Where should I place the code for the update (in which trigger)???
  • poppinspoppins Member Posts: 647
    I will try the OnValidate() trigger of the field...
  • MarkHamblinMarkHamblin Member Posts: 118
    poppins wrote:
    I will try the OnValidate() trigger of the field...
    Yes, in OnValidate of the Blocked field on table 5405, add something along these lines should do it:
    ProdComps.SETRANGE(Status, Status);
    ProdComps.SETRANGE("Prod. Order No.", "No.");
    ProdComps.MODIFYALL(Blocked, Blocked);
    
  • poppinspoppins Member Posts: 647
    Thank you for your help, it worked :)
Sign In or Register to comment.