Skip to main content
Post a question

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id : S2es4FONKnRU3tIlbrKFqP
Finance | Project Operations, Human Resources, ...
Suggested answer

Looping through recordInsertList

Like (0) ShareShare
ReportReport
Posted on 20 Aug 2023 18:58:36 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
    231,723 Most Valuable Professional on 21 Aug 2023 at 04:34:55
    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
    27,823 Moderator on 21 Aug 2023 at 03:36:42
    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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 231,723 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans
Loading complete