Hello!
I´m trying to create a report updating prices in a table with variations of items.
IF NewPriceNormalCall <> 0 THEN BEGIN
"Contract Standard Price".SETRANGE("Price Type","Price Type"::"Normal Call");
NewPrice := NewPriceAlarmCall + "Contract Standard Price"."Unit Price";
"Contract Standard Price"."Unit Price" := NewPrice;
"Contract Standard Price".MODIFY;
END;
IF NewPriceExtraCall <> 0 THEN BEGIN
"Contract Standard Price".SETRANGE("Price Type","Price Type"::"Extra Call");
NewPrice := NewPriceExtraTime + "Contract Standard Price"."Unit Price";
"Contract Standard Price"."Unit Price" := NewPrice;
"Contract Standard Price".MODIFY;
END;
As long as only condition one is met the update runs smoothly, but if option 2 runs, both variations gets modified. I guess I´m doing something wrong with the filters but I can´t figure out what.
0
Answers
Your SETRANGE's in this snippet actually do nothing at all.
However feel free to PM me the object, if you mind sharing it in the thread. This shouldn't take long.