Restrict view to one user at a time

How would I restrict a view to one user at a time. We have a screen for technicians to record use of raw materials and if the batch does not have a lot number, a new lot number is generated. How do we restrict that specific view to only one user to avoid errors in our records?

Iā€™m guessing this is going to be very difficult to implement.

Perhaps set a Tag as a flag that the view is currently in use?

If the lot number is generated, where is it generated, and what type of error does it cause?

the lot is generated in the SQL proc if a current lot number is not passed into it. Our company size makes it very unlikely, but two users could be entering raw materials for a batch on the same equipment.

the issue is our records will show two batches which do not show release dates from the equipment. I could check for an open batch when a lot is generated. that is a good error check. one lot would essentially be lost/forgotten until the data is audited.

In addition, your tag idea game me an idea to use it for disabling the submit option on the screen.

where am I able to know if a view is in use or a count to how many ocurrances of it are being viewed?

I did something in a project where I used message handlers to throw a message to the users that more than one person was on the same view. I opted not to use a tag as I was afraid it would get hung, then nobody could access the view. So I left it up to them to duke it out. It worked well, just an idea.

1 Like

Well, there has to be some navigation type event that displays the view, so you could read and set the tag there.

Read the tag prior to allowing navigation, and then set it if navigation is allowed. Reset it upon submittal for the batch.

Sending a message as @jlandwerlen suggests is also viable and would also occur in whatever event is navigating to the view. In this case you would need to use system.util.sendMessage with a Scope of ā€˜Sā€™ and ensure that the view has the message handler.

thank you both