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, ...
Answered

Documentation or guides for Query::update_recordset() method

(0) ShareShare
ReportReport
Posted on by 32

Hi.

Could I ask for help in navigating any resources with documentation or some explanation of usage for Query::update_recordset(..) method in Dynamics 365 Finance & Operations?

I'd be grateful for any information (especially on the parameters meaning and usage) since there was nothing I could find on the web or in Microsoft Documentation despite one article concerning another method of this class: insert_recordset (http://kashperuk.blogspot.com/2017/09/development-tutorial-insertrecordset.html).

Thanks in advance for any help.

I have the same question (0)
  • Verified answer
    Pedro Tornich Profile Picture
    955 on at

    Hi,

    Unfortunately, there is no official document for bulk operations using query objects, but they are supported.

    You can check the method executeLabelTemplateLines() from WHSPrintLabels class:

    ...
    
    //update wave labels
    Query                   waveLabelQuery = new Query();
    QueryBuildDataSource    qbdsWaveLabel = waveLabelQuery.addDataSource(tableNum(WHSWaveLabel));
    
    str rangeValue = con2Str(labelTranslator.getWaveLabelIdCon());
    
    qbdsWaveLabel.addRange(fieldNum(WHSWaveLabel, WaveLabelId)).value(rangeValue);
    
    Map fieldSetMap = new Map(Types::String, Types::String);
    
    fieldSetMap.insert(fieldStr(WHSWaveLabel, WaveLabelHistoryRecId), any2Str(labelHistory.RecId));
    
    Query::update_recordset(fieldSetMap, waveLabelQuery);
    
    ...

    You can also right click the "update_recordset" method and choose "Find all references", then it will list other places where the method is used.

    For the parameters, as you can see the first one that is a Map, will hold the field name and it will be mapped to a string value. The mapped value can be a scalar value, but can also use fields from other tables on the query.

    It's also possible to use calculations, as you can see in the buildUpdateCalculationStrForBalances() method from CustBalanceList class:

    private str buildUpdateCalculationStrForBalances(str _custTmpAccountSumQbdsName, FieldId _custTmpAccountSumField, str _agingCalculatedTmpQbdsName, FieldId _agingCalculatedTmpField)
    {
        return strFmt('%1.%3   %2.%4',
            _custTmpAccountSumQbdsName,
            _agingCalculatedTmpQbdsName,
            fieldId2Name(tableNum(CustTmpAccountSum), _custTmpAccountSumField),
            fieldId2Name(tableNum(CustVendAgingCalculatedTmp), _agingCalculatedTmpField));
    }

  • Verified answer
    Satish Panwar Profile Picture
    14,671 Moderator on at

    Hi Pedro,

    You can use Metadata search to see where all MS may have used the Query::update_recordset in the code.

    pastedimage1570809170276v1.png

    From first example above, we can see that it's used to update data in query from map.

    pastedimage1570809286451v2.png

    Thanks,
    Satish Panwar
    Please take time to click 'Yes' against the answers that help you guide in right direction to help other community members.

  • tgudwanski Profile Picture
    32 on at

    Thank you very much, Pedro and Satish, for your help. Wish you all the best :)

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 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans