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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 02.02.2024, 07:33   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
dynamicsaxinsight: D365: When and how to use postLoad() method
Источник: https://dynamicsaxinsight.wordpress....stload-method/
==============

Purpose:

Understand when and how to use postLoad method in data management.

Application:

Dynamics 365 for Finance and Operations

Prerequisites:
  • Basic understanding of data entities and how data management works
Business requirement:

Consider, for example, we need to add new field to standard data entity EcoResReleasedProductV2Entity to export a custom field called Manufacturer.

If we come across this business requirement to add a new field to a standard data entity to export additional information then we can achieve this requirement by using the postLoad() method.

PostLoad:

PostLoad() method can be used to provide values in export scenarios for unmapped fields which are created as non-computed fields (Is Computed Field property is set to No) on a data entity.

In the code below, we can see how we can use postLoad() method to populate a custom field added to a standard data entity to export additional information from released products.

Please note, you will need to add a virtual unmapped field to the data entity first before you could use this code.

Code

[ExtensionOf(tableStr(EcoResReleasedProductV2Entity))]internal final class MAK_EcoResReleasedProductV2Entity_Entity_Extension{ public void postLoad() { InventTable inventTable; MAK_ManufacturerTable manufacturerTable; next postLoad(); inventTable = InventTable::find(this.ItemNumber); manufacturerTable = MAK_ManufacturerTable::findRecId(inventTable.MAK_Manufacturer); this.ManufacturerId = manufacturerTable.ManufacturerId; }}


Источник: https://dynamicsaxinsight.wordpress....stload-method/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 


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

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

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