Table field event handler recap in Microsoft Dynamics 365 Finance and Operations apps
Table field event handler recap in Microsoft Dynamics 365 Finance and Operations apps
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
[DataEventHandler(tableStr(CustGroup), DataEventType::ModifiedField)] ------this is table field level event handler (Framework event) - preferred way
public static void CustGroup_onModifiedField(Common sender, DataEventArgs e)
{
CustGroup cgrp;
cgrp=sender;
if(sender.datasource().object(fieldNum(CustGroup, PaymTermid)).getvalue() == "Net30")
{
info("Cust group with payment term N30");
cgrp.Name="123";
}
else
{
info("Cust group WITHOUT payment term N30");
cgrp.Name="789";
}
}
*This post is locked for comments