Event for Table in D365 F&O
Table of Content:
Event Handler for Table
[DataEventHandler(tableStr(SalesTable), DataEventType::Inserting)] public static void SalesTable_onInserting(Common sender, DataEventArgs e) { SalesTable salesTableObj = sender as SalesTable; SalesAgreementHeader salesAgreement; AgreementHeaderDefault agreementHeaderDefault; SalesAgreementHeaderDefault SalesAgreementHeaderDefault; str tmpVal; TM_CustomDocumentListParms docList = TM_CustomDocumentListParms::find(TM_DocsCustom::SalesConfirmation, salesTableObj.TaxGroup); if(docList && docList.TermsAndConditions && docList.TermsAndConditions != "" && salesTableObj.SalesId && salesTableObj.SalesId != "" && salesTableObj.TM_TermsAndConditions == "") { salesTableObj.TM_TermsAndConditions = docList.TermsAndConditions; } }
Event Handler for Table in D365 F&O
/// /// /// /// /// [DataEventHandler(tableStr(CustTable), DataEventType::Deleted)] public static void CustTable_onDeleted(Common sender, DataEventArgs e) { }
Event Handler for Table - Pre and Post Event Handler in D365 F&O
Pre Handler
/// /// /// /// [PreHandlerFor(tableStr(CustTable), tableMethodStr(CustTable, balanceMST))] public static void CustTable_Pre_balanceMST(XppPrePostArgs args) { }
Post Handler
/// /// /// /// [PostHandlerFor(tableStr(CustTable), tableMethodStr(CustTable, balanceMST))] public static void CustTable_Post_balanceMST(XppPrePostArgs args) { }