AXForum  
Go Back   AXForum > Microsoft Dynamics AX > DAX Blogs
CRM
Forgotten Your Password?
Register Forum Rules FAQ Members List Today's Posts Search

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 22.09.2018, 08:24   #1  
Blog bot is offline
Blog bot
Участник
 
25,646 / 848 (80) +++++++
Join Date: 28.10.2006
ievgensaxblog: MSDyn365FO. How-to pass generic types to .Net method
Источник: https://ievgensaxblog.wordpress.com/...to-net-method/
==============



There is a wonderful blog post about Generic types in X++. And as It says, the easiest way to work with generic types in X++ is to create .Net library and expose non-generic interface, because X++ compiler has lots of limitations.

However, if you really want to have some fun and stick to X++, it’s possible with a help of reflection.

Let’s say we have a C# class that accepts  List and we want to invoke it from X++:

public class Class1{ public static string myMethod(List list) { string res = string.Empty; foreach (var array in list) { foreach (string s in array) { res += s; } }return res; }}We cannot simply declare:

var stringList = new System.Collections.Generic.List();
Looks like X++ parser cannot handle “
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Similar Threads
Thread Thread Starter Forum Replies Last Post
ievgensaxblog: D365FOE. How to override form data source field lookup method. Blog bot DAX Blogs 0 10.01.2018 05:11
goshoom: Generic types in X++ (AX 7) Blog bot DAX Blogs 0 10.04.2017 13:11
Navigate Into Success: Try..Catch for .NET Interoperability Blog bot Dynamics CRM: Blogs 0 29.10.2014 09:00
atinkerersnotebook: Walkthrough & Tutorial Summary Blog bot DAX Blogs 1 09.09.2013 09:11
fed: Net requirements update in MRP Module and Working Set of MRP Blog bot DAX Blogs 14 08.05.2012 13:09

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Рейтинг@Mail.ru
All times are GMT +3. The time now is 19:25.
Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Contacts E-mail, Advertising.