[Extensibility Request] New Event needed after average price calculation, and before setting negative values to 0.
To set a negative Value in Item."Unit Cost", two things would be great to have.
The first one is an event in the ItemCostManagement(5804) Codeunit:
`
current:
AverageCost := CostAmt / AverageQty;
AverageCostACY := CostAmtACY / AverageQty;
if AverageCost < 0 then
AverageCost := 0;
if AverageCostACY < 0 then
AverageCostACY := 0;
end else begin
AverageCost := 0;
AverageCostACY := 0;
end;
if AverageQty <= 0 then
exit(false);
`
` please change to:
AverageCost := CostAmt / AverageQty;
AverageCostACY := CostAmtACY / AverageQty;
OnBeforeChangeNegativeValues();
if AverageCost < 0 then
AverageCost := 0;
if AverageCostACY < 0 then
AverageCostACY := 0;
end else begin
AverageCost := 0;
AverageCostACY := 0;
end;
if AverageQty <= 0 then
exit(false);
`
` the Event should be:
[IntegrationEvent(false, false)]
local procedure OnBeforeChangeNegativeValues(var Item: Record Item; var AverageCost: Decimal; var AverageCostACY)
begin
end;
`
This should overall fix the unnecessary developement.
The Second one is just additional, but would be a nice to have for customer development-deleting the Field Property (MinValue) of "Unit Cost" in the table Item (27).
Background is a customer uses also a negative Unit Cost, due to the Field Property, we can not use this Field. As mentioned this would be nice to have.
`
current:
field(22; "Unit Cost"; Decimal)
{
AutoFormatType = 2;
Caption = 'Unit Cost';
MinValue = 0;
trigger OnValidate()
please change to:
field(22; "Unit Cost"; Decimal)
{
AutoFormatType = 2;
Caption = 'Unit Cost';
trigger OnValidate()
` please make these changes, thank you in advance :D
Kind Regards
MKatTEGOS
Hello, is there any Update on this? Would be good to know, if this developement will be done, and by chance when it can be expected.
Kind Regards and thanks in advance
MKatTEGOS
Hello,
First part, with adding publisher, is in progress. For second part, with adding MinValue, please open change request. Thank you
Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.
Build ID: 10924.