I have a situation in which sometimes two agents end up working on the classification of the same case, at the same time; and I need to stop that from happening.

Is there any way to detect if a record is getting updated, so that I could perhaps show a notification such as "someone else is already working on this case" as soon as someone starts editing a record?

I really appreciate any recommendations/ideas! Thanks!

1 Answer 1



It doesn't look like there's a way to detect if someone has clicked the pencil icon. There is another question to that end here on SSE that did not recieve an answer. If you coded your own custom page you could maybe do it.

There is an idea on the IdeaExchange for preventing two people from taking ownership of the same case, but it looks like you need multiple people to be able to classify without requiring them to 'accept' the case.

I would do something like this: Make certain fields read-only on the UI and force the user to use a flow to modify them. After the first screen of the flow you could 'get' the record afresh so you know you have the most recent data, even if another user has changed it since you initially got to page. This would allow the user to see if the classification has already been done.

The second purpose of the flow would be, when a user does click past the first page of the flow, you could set some type of checkbox that indicates that they are 'editing' the record, and effectively lock it. Since you can't guarantee they will actually finish the flow to uncheck the box again, you'd also need to use a datetime field to 'time out' the edit so others could edit it again.

Here's my full solution.

  • Create a datetime field edits_started_at__c
  • Create a boolean formula field currently_being_edited__c. This would be true if edits_started_at__c is not null and the current time is within a certain window of time (1 minute? 5 minutes?) since edits_started_at__c.

The flow:

  • Page: Title
  • Get Case to check currently_being_edited__c
  • Decision: if currently_being_edited__c is true, give error message and end
  • else: Set edits_started_at__c to the current time
  • Page: Where field are populated
  • Update the Case with that data and set edits_started_at__c to null
  • End

I'd be interested to hear if something like this might work for your use case or if others have a simpler solution.

  • 1
    Hi Jerry! I really like the idea! But I'm working with dynamic forms, and there is a lot of complexity here, which is where it gets complicated... there are quite a few different record types, and depending on which one it is, there are lots of different fields that needs to be filled out during the classification. So I don't think it would work to rebuild the screens in the flow. Or is there another way of doing this/did I misinterpret it?
    – Mariana M
    Oct 23, 2023 at 14:15
  • Hi Mariana. It sounds like you probably could handle the complexity with a flow, but it sounds like it'd be a lot of work. You may be able to make my idea work with Dynamic forms instead though. You could just add a criteria to how you show/hide the dynamic forms to include the concept of making sure only the user who initiated the classifiction process (maybe still through a flow) is the one who can view the forms. So you'd need to add a field for who started the edits, and compare it to the current running user when deciding whether to show a form. Oct 23, 2023 at 15:35
  • Hey Jerry! I appreciate your help and ideas! What I ended up doing here is that I replaced the Edit button from the record page with a new one that I created which uses a screen flow. The screen flow has the option to select the record type, and some of the more generic fields necessary to make the classification, just before switching to the main page of the record type, where there will be the actual main fields to be filled out.
    – Mariana M
    Oct 24, 2023 at 16:46
  • The purpose of this flow though is to check/uncheck an “invisible” field that is being used control the display of a rich text message of “Case in edition” which is going to show in the event another user tries to edit the case at the same time someone else is already working on it. As of hiding the pencil, the way I found for doing this is by making the fields read-only on the record page, and available for editing only on the screen flow. I apologize if I didn't explain it too well, I have such a hard time writing this out instead of speaking :(
    – Mariana M
    Oct 24, 2023 at 16:46
  • Awesome. It all makes sense, actually. Sounds pretty similar to my suggestion with some of your own tweaks. Good teamwork - and thanks for the feedback! If you mark my answer as 'accepted' that will remove it from the 'unanswered questions' page. Regards. Oct 24, 2023 at 21:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .