Показать сообщение отдельно
Старый 31.05.2019, 10:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
goshoom: Getting service operations from metadata (D365FO)
Источник: http://dev.goshoom.net/en/2019/05/ge...tadata-d365fo/
==============

When working with metadata in Dynamics 365 for Finance and Operation, the usual approach is using the MetadataSupport class. It’s a simplified interface to actual metadata classes, which is easy to use, but it doesn’t expose everything. For instance, it doesn’t return operations of custom services.

Nothing is lost, because you still can get all details from other classes of the metadata API, you just have to deal with a more implementation details such as metadata providers.

To get service operations, you can write code like this:

using Microsoft.Dynamics.AX.Metadata.MetaModel;using Microsoft.Dynamics.Ax.Xpp.AxShared; class Demo{ public static void main(Args _args) { AxService service = MetadataShared::Provider.Services.Read('DimensionService'); System.Collections.IEnumerator enumerator = service.ServiceOperations.GetEnumerator(); while (enumerator.MoveNext()) { AxServiceOperation operation = enumerator.Current; info(operation.Name); } }}






Note that if you’re interested in service operations from outside F&O, you can use web service themselves (see Discovery of JSON-based custom services in AX 7).



Источник: http://dev.goshoom.net/en/2019/05/ge...tadata-d365fo/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.