In principle, every solution in Dynamics 365 for Finance and Operations should be free of best-practice deviations, but sometimes there is the need to suppress them.
Such a case are for example, event handlers that have a predefined parameter profile, but if one of these parameters is not used, it causes a BP deviation.
class MyFreeTextInvoiceHeaderFooterTmpEH
{
[DataEventHandler(tableStr(FreeTextInvoiceHeaderFooterTmp), DataEventType::Inserting)]
public static void FreeTextInvoiceHeaderFooterTmp_onInserting(Common sender, DataEventArgs e)
{
FreeTextInvoiceHeaderFooterTmp freeTextInvoiceHeaderFooterTmp;
freeTextInvoiceHeaderFooterTmp = sender;
if (freeTextInvoiceHeaderFooterTmp.CompanyBankAccount == "")
{
freeTextInvoiceHeaderFooterTmp.CompanyBankName = "Unknown";
}
}
}
With the above EH, the following BP deviation would be output because the parameter e is not used:
BP Rule: [BPParameterNotUsed]:The parameter 'e' is not used.
In principle, every solution in Dynamics 365 for Finance and Operations should be free of best-practice deviations, but sometimes there is the need to suppress them.
Such a case are for example, event handlers that have a predefined parameter profile, but if one of these parameters is not used, it causes a BP deviation.
With the above EH, the following BP deviation would be output because the parameter e is not used: