AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 08.08.2018, 14:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
d365technext: Class Extension D365FO
Источник: http://d365technext.blogspot.com/201...on-d365fo.html
==============



Class Extension D365FO


In this blog I will show you class extension in D365 and add new method in the existing class without any over-layer..


There are two way to create Extension of the existing class...

  1. Static Class
  2. ExtensionOf


Static class

Create a new public static class use the name pattern ClassName + _Extension

You can use the following code for reference....
publicstaticclassSLD_PaymFee_Extension
{

publicstaticvoid paymfeeFind(PaymFee _this)
{
/// You can write your code here


_this.findFees(); //Use _this to call methods from the base class;
}



}




ExtensionOf

Create new class add the annotation of ExtensionOf and enter the class name... In this type of extension add final keyword.

[ExtensionOf(classStr(PaymFee))]
finalclass SLD_PaymFee_Extension
{

publicstaticvoid paymfeeFind(PaymFee _this)
{
/// You can write your code here


_this.findFees(); //Use _this to call methods from the base class;
}



}


For verification you can use the below code

classSLD_DemoClass
{



publicstaticvoid main(Args _args)
{
PaymFee obj =new PaymFee();
obj.paymfeeFind();
}

}





Источник: http://d365technext.blogspot.com/201...on-d365fo.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
d365technext: Label Extension D365FO Blog bot DAX Blogs 0 07.08.2018 19:11
d365technext: FormHasMethod extension in D365FO Blog bot DAX Blogs 0 03.08.2018 18:11
d365technext: Private, Protected and Public attribute access in Class Extension Blog bot DAX Blogs 0 30.07.2018 20:13
goshoom: Class extensions Blog bot DAX Blogs 0 18.07.2016 17:11
german_nav_developer: Codepage und Multilinguale Dynamics NAV Installationen Blog bot Dynamics CRM: Blogs 0 05.06.2011 15:51
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 21:28.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.