Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

Looping through recordInsertList

(0) ShareShare
ReportReport
Posted on by 1,550
Hi,
 
if we have recordInsertList filled..is there a way to loop through it and take the values? Is there sth like listEnumerator to use?
  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,962 Most Valuable Professional on at
    Looping through recordInsertList
    If you need such a thing, your design must be wrong. If you explain your business requirements to us, we can help with designing a technical solution that can actually do the job.
     
    You seem to think that the purpose of RecordInsertList is to store a list of records in memory, but that's not the case. You can use other classes for that, such as List or RecordSortedList, or to utilize a temporary table. RecordInsertList is used for inserting records on batches. For example, let's say you added 950 records there (and didn't call insertDatabase() yet. You may find that 900 records were already insert to DB (in nine batches of 100 records) and only 50 are waiting to be inserted. You can't find all those 95o records in the RecordInsertList object.
  • Suggested answer
    GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    Looping through recordInsertList
    Hi JuniorAx,
     
    There is a method named toString method - Call this method and check whether it's returning the list values.
    If not, then there is no method available in RecordInsertList to loop through the records.
    You need to create your own List type variable and insert into it, while adding the records to RecordInsertList using add method.
    Later you can use the ListEnumerator to loop through all the records.
     
    Thanks,
    Girish S.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,160 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,962 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans