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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 04.01.2024, 19:16   #1  
Blog bot is offline
Blog bot
Участник
 
25,631 / 848 (80) +++++++
Регистрация: 28.10.2006
goshoom: Entity collection as OData action parameter
Источник: https://dev.goshoom.net/2024/01/enti...ion-parameter/
==============

Data entities in F&O can be exposed through OData protocol. You can also add OData actions by creating methods in X++ and decorating them with SysODataCollectionAttribute.

You can see an example in MssLeaveRequestDateEntity.getDirects():

[ SysODataActionAttribute('getDirects', false), SysODataCollectionAttribute('return', Types::Record, 'MssLeaveRequestDateEntity')]public static List getDirects( str reportingPersonnelNumber, date fromDate, date toDate, LeaveRequestApprovalStatus leaveRequestStatus){ List list = new List(Types::Record); ... return list;}






It has parameters of several types and it returns a collection of entity records (additional metadata is provided in SysODataActionAttribute).

Now what if you want to add such a collection as an input parameter? It sounds straightforward, but if you do it, the action will completely disappear from the entity because it fails to generate.

I was able to get a confirmation that such a parameter type isn’t supported. It’s another case when event logs helped me. Namely, I found a warning in Application and Services Logs > Microsoft > Dynamics > AX-ODataService > Operational log. At the General tab, it said merely OData Metadata Build Warning, but the Details tab revealed much more:

ComponentNameODataServiceMetadataBuilderinfoMessageAction myTest (Method = myTest) on Entity MyEntity has a parameter (Type = Microsoft.Dynamics.Ax.Xpp.List, Name = inRecords) that resolves to an EntityType collection, which is not currently supported. Remove the parameter.All right, so it’s explicitly unsupported. Note that this is just about a collection of records; you can use collections of primitive types such as numbers and strings.

The fact that this kind of warning can be found in event logs may be the most important information in this blog post. It may help with debugging of other issues related to OData in F&O.





Источник: https://dev.goshoom.net/2024/01/enti...ion-parameter/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
littleax: Simple Rest API in D365FO, D365F, D365SCM Blog bot DAX Blogs 0 23.06.2020 14:12
atinkerersnotebook: Configuring a BYODB and Creating a Full and Incremental Entity Export Blog bot DAX Blogs 0 25.05.2018 15:11
saurav-nav: NAV 2018 - Lots of New Objects! Blog bot NAV: Blogs 0 04.12.2017 10:11
dennis365foroperations: Yes, it’s here! The Copy configurations feature (and a look at other improvements related to Data Management) Blog bot DAX Blogs 0 12.10.2017 16:11
Вопрос про Demand Planner slava09 DAX: Функционал 4 25.09.2006 11:43

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

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

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 22:41.