Eventhandler code for updating a value at the table level .
[DataEventHandler(tablestr(FMRentalCharge),DataEventType::Updating),
SuppressBPWarningAttribute('BPParameterNotUsed', 'This is not production code')]
public static void FMRentalChargeUpdatingEvent(Common c, DataEventArgs e)
{
FMRentalCharge rentalCharge = c;
FEDiscountEngine discountEngine;
if (rentalCharge.orig().PerUnitAmount != rentalCharge.PerUnitAmount ||
rentalCharge.orig().Quantity != rentalCharge.Quantity)
{
discountEngine = FMTotalsEngineBase::GetInstance() as FEDiscountEngine;
if (discountEngine)
{
discountEngine.calculateChargeRate(rentalCharge);
}
}
}
{
FMRentalCharge rentalCharge = c;
FEDiscountEngine discountEngine;
if (rentalCharge.orig().PerUnitAmount != rentalCharge.PerUnitAmount ||
rentalCharge.orig().Quantity != rentalCharge.Quantity)
{
discountEngine = FMTotalsEngineBase::GetInstance() as FEDiscountEngine;
if (discountEngine)
{
discountEngine.calculateChargeRate(rentalCharge);
}
}
}
No comments:
Post a Comment