Показать сообщение отдельно
Старый 04.02.2019, 22:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
alirazazaidi: Data source filter using extension Dynamics 365 for finance and operations
Источник: https://www.tech.alirazazaidi.com/da...nd-operations/
==============

Hi every one, Today I have very small tip. During customization we need to add filters at run time. Specially in the case of inquiry forms. But Now we have to work with extension. Extensions are much more powerful then over layering.



So first one thing to copy Datasource  OnQueryEXecuting event. And paste in Extension class.



The sample code snippet is here.






 [FormDataSourceEventHandler(formDataSourceStr(HcmDiscussion, HcmTopicRef), FormDataSourceEventType::QueryExecuting)]

public static void HcmTopicRef_OnQueryExecuting(FormDataSource sender, FormDataSourceEventArgs e)

{

FormRun          HcmDiscussionForm = sender.formRun();

sender.query().dataSourceName(sender.name()).addRange(fieldnum(HcmTopicRef,     HeadingRefRecId)).value(queryValue(_heading.RecId));

}

Источник: https://www.tech.alirazazaidi.com/da...nd-operations/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.