Показать сообщение отдельно
Старый 31.01.2017, 23:14   #1  
Blog bot is offline
Blog bot
Участник
 
25,646 / 848 (80) +++++++
Регистрация: 28.10.2006
mfp: Subscribing to onValidatingWrite
Источник: https://blogs.msdn.microsoft.com/mfp...lidatingwrite/
==============
Most event handlers are straight forward. One exception is when subscribing to a table’s onValidated and onValidating events. The trick is to realize that the DataEventArgs instance passed to the event handler, is a validateEventArgs – a specialization of DataEventArgs. Here is a template to use: [DataEventHandler(tableStr(<TableName>), DataEventType::ValidatingWrite)]public static void <TableName>_onValidatingWrite(Common _sender, DataEventArgs _e){    boolean result = true;    ValidateEventArgs validateEventArgs = _e as ValidateEventArgs;    <TableName> <table> = _sender as <TableName>;     if (<validation>)    {        result = checkFailed(“Validation failed”);    }    validateEventArgs.parmValidateResult(result);}   The platform will keep raising the...

==============
Источник: https://blogs.msdn.microsoft.com/mfp...lidatingwrite/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.