Skip to content

[Event Request] table 5406 prod. order line > Influence calculation Direction #30298

Description

Why do you need this change?

When creating a production order, users can manually set the Scheduling Direction to Forward to ensure that the start date of the production order remains unchanged. The default setting however is Backwards for most scenario's where changes are made to the production order, or production order line.
When planning production orders based on inventory, this behavior can become inconvenient. For example, when the quantity of a production order line is changed, the start date will automatically be moved backwards due to the scheduling calculation.

Describe the request

Image

In the OnValidate of field Quantity (40) the field "Ending Time" gets validated. This recalculates the Production Order with the option "Backward" hardcoded.

Image

The validation of field "Starting Time" will trigger the recalculation with the option "Forward" hardcoded.

Image

Based on a new setting we have created in our product, we would like to either trigger the "Ending Time" or "Starting Time" field. To achieve this we will need an event before validating the "Ending Time" field.

The code would look as follows:

if CurrFieldNo <> 0 then begin
IsHandled := false;
OnBeforeValidateEndingTimeOnValidateQuantity(Rec, IsHandled);
if not IsHandled then
Validate("Ending Time");
end;

The same thing happens on the "Quantity (Base)" field.

Image
IsHandled := false;
OnBeforeValidateEndingTimeOnValidateQuantityBase(Rec, IsHandled);
if not IsHandled then
Validate("Ending Time");

A counter-point you could make is that both fields have an IsHandled structure at the top of the validation. I do not think these are futureproof possibilities.

Performance note: Adding an event has no affect on the performance of the system.

Data sensitivity/security statement: No sensitive data will be exposed.

Multi-extension interaction assessment: Multiple subscribes could set the IsHandled property to true, as a software vendor and consultancy partner it is always your responsibility to verify cross-compatibility with other apps installed in the environment. You should also format your code like;

if IsHandled then
exit;

or

IsHandled := true or IsHandled;

Internal work item: AB#644773

Metadata

Metadata

Assignees

No one assigned

    Labels

    SCMGitHub request for SCM areaevent-requestRequest for adding an eventext-ready-to-implementReviewed and ready to implement and create PR

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions