Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to insert the data retrieved from Query into a Container

(0) ShareShare
ReportReport
Posted on by 435

Hi there,

  i am trying to retrieve all the ItemIds from InventTable and want to store in an container,  when the values are stored in the container,when i am trying to see the length of container its showing length = 1.

Can you please help me how to insert the data into container followed by comma (,) after each item id.

here is the code which i am using

InventTable invTable;

container conItemID;
str readitmIds;
int conLength , cnt;
while select ItemId from invTable
{
conItemID = [invTable.ItemId];
}

conLength = conLen(conItemID);
info(strFmt("Container Length %1", conLength));

}

*This post is locked for comments

  • Martin Dráb Profile Picture
    233,326 Most Valuable Professional on at
    RE: How to insert the data retrieved from Query into a Container

    Your code is overwriting conItemID every time.

    Another solution is using conIns() function, but += is faster.

    Note that the result is indeed a container, not a string with comma-separated values.

  • Mohammed Altaf Profile Picture
    435 on at
    RE: How to insert the data retrieved from Query into a Container

    Thanks @Crispin John Augustine.

    You just made my day.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics AX (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 100 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 48

#3
shanawaz davood basha Profile Picture

shanawaz davood basha 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans