Lockedrecordlist returns a list of locked records, but it isn’t an array. If it is, what’s the separator?If not, how can I extract the serverIDs from that list so I can display a list of invoice numbers for those IDs? Also, I keep getting the same list of locked records over and over again. 2 hours later, it’s showing the same list of records which doesn’t seem accurate at all.
The format of the result is shown in the documentation.
It doesn’t explicitly say, but each line is separated by a carriage return. That’s implied by the fact that each item is on a separate line. You could use nthline( or array( to extract individual items from this list.
I just now did a quick test and the lockedrecordlist statement worked as expected.
What does the Server Admin window show? It can show you a list of all the locked records for a database, including the record numbers and what computer locked each record. That should match up with the results of the lockedrecordlist statement.
Thanks Jim; I know the format. I thought it was CR retuned but when I loaded it in a variable and ran arraysize(thevariable,¶), it returned 1. It could have from 1 to 10 recordIDs after the first line. If I can’t get a record count, I won’t know how to handle them.
Whenever invoices are selected to print, the procedure looks to see if there are any locked records. It always displays a message that there are locked records when they print a batch.It works the first time after opening the file but it keeps showing the same records afterwards. Checking the server Admin window is a good idea.
Ok, I chose the invoices to print this morning and received a message that there were 6 locked records. I followed your advice and compared this to the locked records in the Server Administration window. There were indeed 6 locked records in the server administration window. The problem is, these same records have been locked for two days. I located one and did a forceunlock. When I ran the procedure again, there were 5 locked records. So, the question becomes, why are these records not unlocking?
After hunting down the locked records, one of them was 7 days old and another was over a year old which they haven’t touched. I’ll keep an eye on this.