I'm working with Customer records in a User Event beforeLoad script. Since record.setValue doesn't work in beforeLoad, I'm using record.submitFields to submit 3 field values. This works most of the time, however rarely there is a USER_ERROR:
{"type": "error.SuiteScriptError", "name":"USER_ERROR", "message": "This entity was marked as a master in a duplicate resolution operation.<br><br>This operation is in progress, and the entity is temporarily unavailable for editing."}
In the error it points to the line where my record.submitFields is located. From my research into the issue, I think there is somehow a separate process also trying to submitFields and creating a second record to be saved. But I've been through the scripted records and can't seem to find any scripts that could be causing that. Does anyone have thoughts on what could be happening and how it's typically fixed?