web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Q about some terms in AIF like EntityKey[]

(0) ShareShare
ReportReport
Posted on by 576

Hello ..

when i search about hot to call read operation in AIF services or write i found a lot of example ..

my problem to understand some terms like..

        EntityKey[] keys;
        EntityKey key = new EntityKey();
        KeyField fld = new KeyField();


and other wrote the code like 

            EntityKey[] readRespKeys = new EntityKey[1];
            readRespKeys[0] = new EntityKey();
            readRespKeys[0].KeyData = new KeyField[1];
            readRespKeys[0].KeyData[0] = new KeyField();
            readRespKeys[0].KeyData[0].Field = "TransferId";

in the previous code there  new EntityKey[1] and  new EntityKey() what is different between the two

other term is 

            // Create the service client proxy
            InventTransferOrderServiceClient client = new InventTransferOrderServiceClient();


there is comment Said client proxy . is it to open connection to AX service  

last thing is 

            // Add the result to the entity key value.

            readRespKeys[0].KeyData[0].Value = Console.ReadLine();


what entity key and key field means .

thank you

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    239,392 Most Valuable Professional on at

    If you ask about a difference between EntityKey[1] and new EntityKey(), the question isn't actually about terms but about the syntax of C# language.

    • Abc[] is a declaration of an array of Abc objects.
    • new Abc[1] creates an empty array of Abc objects with a single element. new Abc[5] would be an array with five elements.
    • new Abc() creates a new object of instance of Abc class, the same way as you would do it in X++ (e.g. new Dialog()).
    • xyz[0] is the first element of an array called xyz. In C#, index numbers start from 0, therefore the first element has index 0.
    • xyz[0] = w; is an assignment of w to the first element of array xyz.

    Does it make sense?

    Note that you can find more details in C# documentation, such as Arrays (C# Programming Guide).

  • Suggested answer
    Martin Dráb Profile Picture
    239,392 Most Valuable Professional on at

    An entity key identifies a single entity. It can consist of several fields, such as DataAreaId and AccountNumber. The combination of these fields must be unique.

    It's like a primary key on a table.

  • Codehunter Profile Picture
    10,280 on at

    Hi martin.

    I am just asking if it is possible to insert values inside aif entity key and then add this object inside the list of entitykey list X++.

    Your quick feedback would be greatly appreciated.

  • Martin Dráb Profile Picture
    239,392 Most Valuable Professional on at

    Yes, you can, although these things aren't normally used from X++. There intended for other applications calling AX web services.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 39

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans