Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8036123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:30:56+00:00 2026-06-05T02:30:56+00:00

I have an MS Dynamics AX 2012 project and I am using .Net interop.

  • 0

I have an MS Dynamics AX 2012 project and I am using .Net interop.
There is a C# method inside a static class called Database:

 public static List<String> GetAllDatabases(string dataSource)

After referencing this assembly, I can execute in X++:

ADOMD.ADOMD.Model.Database::GetAllDatabases();

But I can’t read the string list that it’s returning.
I would like to use something like:

List databaNameCollection = new List( Types::String ); 
;

databaNameCollection =  ADOMD.ADOMD.Model.Database::GetAllDatabases();

But it trows an error:

Error executing code:  (object) has no valid runable code in method 'GetSID'.

How could I do it?

——-EDITED——

I found this post:

http://blogs.msdn.com/b/x/archive/2010/01/19/traversing-elements-in-an-ienumerable-from-x.aspx

But it was in 2010, probably for AX 2009, I tried to assign:

ClrObject enumerator; 
str theValue;
;

enumerator = ADOMD.ADOMD.Model.Database::GetAllDatabases();
while (enumerator.MoveNext()) 
    { 
        theValue = enumerator.get_Current(); 
        print theValue; 
    } 

The GetallDatabases method is working with another .Net project, it is returning 10 objects, but at the X++ code, is returning nothing.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T02:30:57+00:00Added an answer on June 5, 2026 at 2:30 am

    To answer your question about .NET types in X++ and get_{x} and set_{x}:

    .NET properties are shown in X++ as methods. For example, the get & set property below in C#

    string Name {get;set;}
    

    will show in X++ as

    string get_Name();
    void set_Name(str value);
    

    Basically C# properties are just syntactic sugar. The C# compiler will create a get_{x} method for each get property and a set_{x} for each set property.

    In your case, if you want to access the Name property in the cubeDef object you would have to write something like this in X++:

    info(cubeDef.get_Name());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a web page (ASP.NET) that includes a stylesheet to mimic Dynamics
What is the algorithm to have random reals using x++ in Dynamics AX?
i have a Listview with dynamics rows that read them from database. now i
i'm desperately searching for dynamics ax 2009 database diagram. Does anyone have it ?
We are using the Advanced Developer Extension against Dynamics CRM 4.0. We have generated
I have problem with intellisense in my asp net mvc 3 project in new
I have installed Dynamic AX 2012 and I have checked AOS. After steps of
I have Dynamics CRM 4.0 installed and wrote a plugin, registered it, and setup
I have a Microsoft dynamics Ax client instance. While posting packing slip on Sales
In Dynamics 2011 installation i have an Attribute with Secured option enabled. And I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.