Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)
Under review by Community Managers

Under review

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

“The record has never been selected” error after Join/Group By clause

Posted on by

Hi Teams,

I'm new in Ax 2009. I would like to update the field of a record in table A after joining with another table B on which I want to apply Group by on its ID.

I tried to run the following code but it throws me an error "Cannot edit a record in tableA. The record has never been selected":

where select forupdate tableA group by tabAid, Dimension[5]
join tableB group by tabBid, Dimension[5]
where tableA.tabAid == tableB.tabBid && tableB.Dimension[5] != "" && tableA.Dimension[5]
{
    if(tableA.Dimension[5] != lines.Dimension[5])
    {
        ttsbegin;
        tableA.Dimension[5] = tableB.Dimension[5];
        tableA.update()
        ttscommit;
    }
}

If I try to remove the group by clause on tableA, tableA.Dimension[5 is empty.

Please someone help me.

Thanks in advance

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,703 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,433 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans