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

Notifications

Announcements

No record found.

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 604
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,118 Super User 2025 Season 2 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,346 Super User 2025 Season 2 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
    604 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 451 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 428 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans