Creating a batch editing script that handles locked records
I'm creating a pretty simple script that applies a tag to all records in a found set. Loops through each records and creates a new tag (tags are just records in a child table). Works fine. However, I want the script to behave well in the event of any locked records. I've been googling about for how to do this.
First of all, I thought I'd be able to test this by simply having another open window with a record from the found set open for editing. Indeed, this prevents that one record from having a tag generated. However all the methods I've read to capture this event (Get last error, Get record Open State) fail to register an error or locked record (or perhaps I'm doing it wrong). Get last error equals 0 and Get record open state = 0 for all records (so I must be misunderstanding it's function).
My questions- first of all, am I on the right track? Are get last error and/or Record open state the preferred methods for capturing and alerting the user that a record was not editing by a batch script? Second of all, is a record locked the same for records being used by different users vs. records being edited by the same user but in different windows? The latter is all I have been able to test for, but the former is the only one with significant discussion on the web. My expereience with records open in multiple windows so far seems quite different to what I'm reading about records locked on account of multiple users viewing the same record.