Below is the event handler code to write at the table level for inserting any value.
[DataEventHandler(tablestr(FMRentalCharge),DataEventType::Inserting),
SuppressBPWarningAttribute('BPParameterNotUsed', 'This is not production code')]
public static void FMRentalChargeInsertingEvent(Common c, DataEventArgs e)
{
FMRentalCharge rentalCharge = c;
FEDiscountEngine discountEngine;
discountEngine = FMTotalsEngineBase::GetInstance() as FEDiscountEngine;
if (discountEngine)
{
discountEngine.calculateChargeRate(rentalCharge);
}
}
FMRentalChargeInsertingEvent -> you can write any name .
SuppressBPWarningAttribute - > is optional( it is for not using the e parameter of the dataeventargs.)
[DataEventHandler(tablestr(FMRentalCharge),DataEventType::Inserting),
SuppressBPWarningAttribute('BPParameterNotUsed', 'This is not production code')]
public static void FMRentalChargeInsertingEvent(Common c, DataEventArgs e)
{
FMRentalCharge rentalCharge = c;
FEDiscountEngine discountEngine;
discountEngine = FMTotalsEngineBase::GetInstance() as FEDiscountEngine;
if (discountEngine)
{
discountEngine.calculateChargeRate(rentalCharge);
}
}
FMRentalChargeInsertingEvent -> you can write any name .
SuppressBPWarningAttribute - > is optional( it is for not using the e parameter of the dataeventargs.)
No comments:
Post a Comment