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

Notifications

Announcements

No record found.

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
    237,965 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
    237,965 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
    237,965 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans