Good morning! I work with a large codebase that has had many developers over the years. Consequently, when building something new, I will sometimes look to see how something was done previously. More often it has been the case that I will go straight to the documentation to see the currently recommended 4D approach to the issue.
Today I was looking at capturing the 'approval of selected records'. Selected is a boolean value in the database. Stepping through the code I could see that where we were supposed to be looping over the records in the current selection, we were instead dealing with the whole selection. Stepping back from the context of the application, I created a scratchpad sort of method, which contains a simple query and a code snippet directly from the documentation. The 4th basic example in on this page: http://doc.4d.com/4Dv15/4D/15.6/ForEnd-for.300-3818649.en.html produces an -28 communication error after trying to SEND RECORD. QUERY([Approvals];[Approvals]approved=False) FIRST RECORD([Approvals]) For ($vlRecord;1;Records in selection([Approvals])) // Do something with the record SEND RECORD([Approvals]) // ... // Go to the next record NEXT RECORD([Approvals]) End for Am I missing something in my understanding of looping over records? ********************************************************************** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **********************************************************************