The typical cause for that is that one user has opened a record for editing and a second user then attempts to modify the same record. This type of "edit lock" can happen even though the users are on different layouts. "Just looking" doesn't mean that the cursor isn't in a field somewhere on that layout and that might be all it takes to lock a record. This can be even harder to spot if you have more than one window open at the time.
But she was on a separate record to the one that I was trying to enter.
By default when i go to clients it takes me to the first record she was on the second record.
You really need to describe the design of your tables, relationships and layouts.
I think i understand why now but not sure how to change it
when I enter clients layout I trigger this script (see attached), the script filters active clients from deactivate clients, and puts the current month into field to help filter some of the portals. I believe this is the problem as I am writing to all the records.
That will definitely trigger an "edit lock" error message if one or more of the records are open for editing by another user. Such "Batch" updates of data are best done via a schedule that runs the script at a time when users are not accessing the file, such as early morning hours.
But looking at your script, I don't quite see why you need to do this update in the first place. An unstored calculation could show the current month and year on every record where the status is "active".
If one of the fields being changed is global, does it automatically 'edit lock' all records on the table (not just the layout) until committed (adding a commit records script step)?
I wouldn't think it would lock all, just current record. If that is true, would having a global field in a global table change that behavior.
Or is this more of a transaction problem (OP said it's changing the way portals are filtering records)
Just curious (as usual :) )
That particular field can be any month year and it then gives a total hours worked for a particular client for that month. the reason I have the script is that I want it to default to current month when entering a record as this is predominantly what we use it for.
I have changed it so that it only happens when I enter a new record which has sorted the problem unless I look at a record already being browsed.
I am intrigued by the idea of a global table, that holds global values so will have to look into that.
Try using OnRecordLoad as your trigger to set the default value.
I am always humbled by the help I get on this sight, I really do appreciate it.