Important note: The document you attached is for 2019 - you should get more up to date training materials. I didn’t do T190 but, instead, did the T200 series (T200..T250).
However, in my T220 documentation it reads as you have typed it. When I look at the supplied code files it shows something different. So I think that the documentation might be incorrect, even in the updated version. My full code listing for that method looks like this:
//Validate that Quantity is greater than or equal to 0 and
//correct the value to the default if the value is less than the default.
protected virtual void _(Events.FieldVerifying<RSSVWorkOrderLabor,
RSSVWorkOrderLabor.quantity> e)
{
if (e.Row == null || e.NewValue == null) return;
if ((decimal)e.NewValue < 0)
{
//Throwing an exception to cancel the assignment of the new value to the field
throw new PXSetPropertyException(Messages.QuantityCannotBeNegative);
}
var workOrder = WorkOrders.Current;
if (workOrder != null)
{
//Retrieving the default labor item related to the work order labor
RSSVLabor labor = SelectFrom<RSSVLabor>.
Where<RSSVLabor.serviceID.IsEqual<@P.AsInt>.
And<RSSVLabor.deviceID.IsEqual<@P.AsInt>>.
And<RSSVLabor.inventoryID.IsEqual<@P.AsInt>>>
.View.Select(this, workOrder.ServiceID, workOrder.DeviceID, e.Row.InventoryID);
if (labor != null && (decimal)e.NewValue < labor.Quantity)
{
//Correcting the LineQty value
e.NewValue = labor.Quantity;
//Raising the ExceptionHandling event for the Quantity field
//to attach the exception object to the field
e.Cache.RaiseExceptionHandling<RSSVWorkOrderLabor.quantity>(e.Row, e.NewValue,
new PXSetPropertyException(Messages.QuantityToSmall, PXErrorLevel.Warning));
}
}
}
Have a look for a HelpAndTraining folder within your Acumatica installation - in there you will have the source code for the whole project.