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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Multi-table AOT query with Query::update_recordset

(2) ShareShare
ReportReport
Posted on by 626
Hello,
Not sure if it's possible - I haven't seen examples of this. I have an AOT query joining ProjTable, ProjForecastCost, and a custom table (MyProjTable) linked by ProjId. I'm trying to update a boolean flag on MyProjTable if it is returned in the query. I provide the field mapping to MyCustTable for this boolean flag field. When Query::update_recordset() is called, I get an error (something to the affect of "field 'projects' is not found on table 'projtable'"). Doesn't appear Query::update_recordset is widely used -- maybe for a reason?
I have the same question (0)
  • Bharani Preetham Peraka Profile Picture
    3,634 Moderator on at
    Please share your code for better understanding.
  • Layan Jwei Profile Picture
    8,282 Super User 2026 Season 1 on at
    Please show us your full code and maybe take screenshot of your query and if u have any ranges
  • Anton Venter Profile Picture
    20,940 Super User 2026 Season 1 on at
    Why don't you just use the regular update_recordset statement instead?
  • Suggested answer
    RT-23081044-0 Profile Picture
    6 on at
    It looks like Query::update_recordset() might not be ideal for your complex join scenario. Instead, try using a while select loop to update the Boolean flag in MyProjTable
     
    MyProjTable myProjTable;
    ProjTable projTable;
    ProjForecastCost projForecastCost;
    while select forUpdate myProjTable
        join projTable
        on projTable.ProjId == myProjTable.ProjId
        join projForecastCost
        on projForecastCost.ProjId == projTable.ProjId
    {
        myProjTable.BooleanFlag = true;
        myProjTable.update();
    }

     
    thanks,
    ramjee
  • CU29041349-0 Profile Picture
    626 on at
    @Bharani @Layan,
    I will try to get some details in hopes you can help.
     
    @Anton,
    I did try a solution using SQL and update_recordset (yet to be validated) but as my form uses the AOT query, I was hoping to utilize Query::update_recordset instead. Otherwise, I would have to find all the range values and plug them into the SQL. 
     
    @RT-23081044-0,
    This approach is just too slow for my needs. 
  • CU07100805-0 Profile Picture
    2 on at
    How is everything, Any update on it?

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 June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 385 Super User 2026 Season 1

#2
Subra Profile Picture

Subra 270

#3
Martin Dráb Profile Picture

Martin Dráb 243 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans