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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How can I referee to the element of array of the field of DataSource in DataEntity?

(0) ShareShare
ReportReport
Posted on by 737

I have custom DataEntity (Let’s say STATUS). One of not root DataSource is StateDateTable Table, which contains two fields (InventSerialId and StateDate)

StateDateTable_5F00_1.jpg

For StateDateTable.StateDate field I use an EDT StateDate (Date type), which is array and which contains 29 elements.

EDTStateDate_5F00_2.jpg

So If we look into SQL, we will see something like this

SQL_5F00_3.jpg

At the same time,

In my DataEntity STATUS, I need to create several Unmapped fields, and in order to calculate values for these Unmapped fields I need to take values of array elements from StateDateTable.StateDate field, something like 

Code_5F00_4.jpg

But as you can see from screenshot, the reference to STAEDATE2_ field is not correct, so the question is:

How can I referee to the element of array of the field of DataSource in DataEntity?

*This post is locked for comments

I have the same question (0)
  • Verified answer
    André Arnaud de Calavon Profile Picture
    306,118 Super User 2026 Season 1 on at

    Hi Ragoza,

    You can use array fields in x++ like "StateDate[2]" or "StateDate[28]".

    I wonder why you used an array if the date fields do have an explicit meaning. If you created 29 fields, the naming and using in coding would be more easy to understand for you, but also other developers who could potentially work on this table in future.

  • Suggested answer
    Community Member Profile Picture
    on at

    [quote user="Oleksandr Ragoza"]

    I have custom DataEntity (Let’s say STATUS). One of not root DataSource is StateDateTable Table, which contains two fields (InventSerialId and StateDate)

    Code_5F00_4.jpg

    For StateDateTable.StateDate field I use an EDT StateDate (Date type), which is array and which contains 29 elements.

    EDTStateDate_5F00_2.jpg

    So If we look into SQL, we will see something like this

    SQL_5F00_3.jpg

    At the same time,

    In my DataEntity STATUS, I need to create several Unmapped fields, and in order to calculate values for these Unmapped fields I need to take values of array elements from StateDateTable.StateDate field, something like 

    Code_5F00_4.jpg

    But as you can see from screenshot, the reference to STAEDATE2_ field is not correct, so the question is:

    How can I referee to the element of array of the field of DataSource in DataEntity?

    [/quote]

  • Community Member Profile Picture
    on at

    Hi How you resolved this problem i also have the same problem?

    Thanks,

    Rajesh

  • Ragoza Oleksandr Profile Picture
    737 on at

    You can use array fields in x++ like "StateDate[2]" or "StateDate[28]". (see André Arnaud de Calavon's answer )

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Sanhthosh.Kumar.K Profile Picture

Sanhthosh.Kumar.K 2

#2
Raed Salah Bzour Profile Picture

Raed Salah Bzour 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans