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)

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

  • Mohammed Altaf Profile Picture
    435 on at

    Thanks @Crispin John Augustine.

    You just made my day.

  • Martin Dráb Profile Picture
    240,742 Most Valuable Professional on at

    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.

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 Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans